diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-03-30 17:58:47 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-03-30 17:58:47 +0300 |
commit | 4f96ad9a2d095bb1285eee1c21ccc12b112a27b4 (patch) | |
tree | d12e56d20531351a4ab6945f4091ca2d6ab4f0be /main/musl | |
parent | 0f111409285097dcc78be93c7ffea6cf09757c7c (diff) | |
download | aports-4f96ad9a2d095bb1285eee1c21ccc12b112a27b4.tar.bz2 aports-4f96ad9a2d095bb1285eee1c21ccc12b112a27b4.tar.xz |
main/musl: cherry-pick upstream fixes
Diffstat (limited to 'main/musl')
-rw-r--r-- | main/musl/0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch (renamed from main/musl/1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch) | 2 | ||||
-rw-r--r-- | main/musl/0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch | 36 | ||||
-rw-r--r-- | main/musl/0009-fix-regression-disabling-use-of-pause-instruction-fo.patch | 62 | ||||
-rw-r--r-- | main/musl/APKBUILD | 18 |
4 files changed, 112 insertions, 6 deletions
diff --git a/main/musl/1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch b/main/musl/0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch index f126336e97..a8d8a5f5a9 100644 --- a/main/musl/1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch +++ b/main/musl/0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch @@ -1,4 +1,4 @@ -From d378d05848f745598216259b6dba7c70f0e90300 Mon Sep 17 00:00:00 2001 +From 5978eb703ce0e64dd778a88c1ffffb76fe5e2202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> Date: Tue, 22 Mar 2016 16:27:51 +0200 Subject: [PATCH] fix gethostbyaddr_r to fill struct hostent.h_length as diff --git a/main/musl/0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch b/main/musl/0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch new file mode 100644 index 0000000000..cd59785b29 --- /dev/null +++ b/main/musl/0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch @@ -0,0 +1,36 @@ +From 6d1a3dfeaf2caac4033a3c65822fb4e7e14866c7 Mon Sep 17 00:00:00 2001 +From: Rich Felker <dalias@aerifal.cx> +Date: Mon, 28 Mar 2016 23:41:17 -0400 +Subject: [PATCH] fix undefined pointer comparison in stdio-internal __toread + +the comparison f->wpos > f->buf has undefined behavior when f->wpos is +a null pointer, despite the intuition (and actual compiler behavior, +for all known compilers) being that NULL > ptr is false for all valid +pointers ptr. + +the purpose of the comparison is to determine if the write buffer is +non-empty, and the idiom used elsewhere for that is comparison against +f->wbase, which is either a null pointer when not writing, or equal to +f->buf when writing. in the former case, both f->wpos and f->wbase are +null; in the latter they are both non-null and point into the same +array. +--- + src/stdio/__toread.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/stdio/__toread.c b/src/stdio/__toread.c +index b08f5bb..35f67b8 100644 +--- a/src/stdio/__toread.c ++++ b/src/stdio/__toread.c +@@ -3,7 +3,7 @@ + int __toread(FILE *f) + { + f->mode |= f->mode-1; +- if (f->wpos > f->buf) f->write(f, 0, 0); ++ if (f->wpos > f->wbase) f->write(f, 0, 0); + f->wpos = f->wbase = f->wend = 0; + if (f->flags & F_NORD) { + f->flags |= F_ERR; +-- +2.7.4 + diff --git a/main/musl/0009-fix-regression-disabling-use-of-pause-instruction-fo.patch b/main/musl/0009-fix-regression-disabling-use-of-pause-instruction-fo.patch new file mode 100644 index 0000000000..58b2459f89 --- /dev/null +++ b/main/musl/0009-fix-regression-disabling-use-of-pause-instruction-fo.patch @@ -0,0 +1,62 @@ +From 5c3412d22555d03a1c00578ba8faaa8dc9206420 Mon Sep 17 00:00:00 2001 +From: Rich Felker <dalias@aerifal.cx> +Date: Tue, 29 Mar 2016 21:22:52 -0400 +Subject: [PATCH] fix regression disabling use of pause instruction for x86 + a_spin + +commits e24984efd5c6ac5ea8e6cb6cd914fa8435d458bc and +16b55298dc4b6a54d287d7494e04542667ef8861 inadvertently disabled the +a_spin implementations for i386, x86_64, and x32 by defining a macro +named a_pause instead of a_spin. this should not have caused any +functional regression, but it inhibited cpu relaxation while spinning +for locks. + +bug reported by George Kulakowski. +--- + arch/i386/atomic_arch.h | 2 +- + arch/x32/atomic_arch.h | 2 +- + arch/x86_64/atomic_arch.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/i386/atomic_arch.h b/arch/i386/atomic_arch.h +index 6e67c4c..2b1a049 100644 +--- a/arch/i386/atomic_arch.h ++++ b/arch/i386/atomic_arch.h +@@ -71,7 +71,7 @@ static inline void a_barrier() + __asm__ __volatile__( "" : : : "memory" ); + } + +-#define a_pause a_pause ++#define a_spin a_spin + static inline void a_spin() + { + __asm__ __volatile__( "pause" : : : "memory" ); +diff --git a/arch/x32/atomic_arch.h b/arch/x32/atomic_arch.h +index 26098d3..7daf4ae 100644 +--- a/arch/x32/atomic_arch.h ++++ b/arch/x32/atomic_arch.h +@@ -87,7 +87,7 @@ static inline void a_barrier() + __asm__ __volatile__( "" : : : "memory" ); + } + +-#define a_pause a_pause ++#define a_spin a_spin + static inline void a_spin() + { + __asm__ __volatile__( "pause" : : : "memory" ); +diff --git a/arch/x86_64/atomic_arch.h b/arch/x86_64/atomic_arch.h +index 9f47f80..55fc6fb 100644 +--- a/arch/x86_64/atomic_arch.h ++++ b/arch/x86_64/atomic_arch.h +@@ -96,7 +96,7 @@ static inline void a_barrier() + __asm__ __volatile__( "" : : : "memory" ); + } + +-#define a_pause a_pause ++#define a_spin a_spin + static inline void a_spin() + { + __asm__ __volatile__( "pause" : : : "memory" ); +-- +2.7.4 + diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD index e676afb4f7..3d574b43ce 100644 --- a/main/musl/APKBUILD +++ b/main/musl/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Timo Teräs <timo.teras@iki.fi> pkgname=musl pkgver=1.1.14 -pkgrel=5 +pkgrel=6 pkgdesc="the musl c library (libc) implementation" url="http://www.musl-libc.org/" arch="all" @@ -18,7 +18,9 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch 0006-fix-padding-string-formats-to-width-in-wide-printf-v.patch - 1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch + 0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch + 0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch + 0009-fix-regression-disabling-use-of-pause-instruction-fo.patch ldconfig __stack_chk_fail_local.c @@ -132,7 +134,9 @@ c683094384c5726a99d1047f01aeb331 0001-handle-non-matching-address-family-entrie 476dc9157a7ac6de5bb6f7c5a5ef7a2d 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch a372031134c17cefb9aad3c9c0e6bb19 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch d85fdb4d80c8372d8e63cf4382e4012a 0006-fix-padding-string-formats-to-width-in-wide-printf-v.patch -366e32f17cbe18b4d4855eda6b4f82cb 1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch +882309436377613d8b65a1fed573f125 0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch +4701e50c55b520e644c9e9a94e851d7f 0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch +a2457ce90f3e4d5ef04005b6f42e9bc3 0009-fix-regression-disabling-use-of-pause-instruction-fo.patch 830d01f7821b978df770b06db3790921 ldconfig 0df687757221bbb0fc1aa67f1bd646f9 __stack_chk_fail_local.c 57ef2c63b9ec6a2041694ace97d4ffa2 getconf.c @@ -145,7 +149,9 @@ sha256sums="35f6c00c84a6091bd5dab29eedde7508dae755ead92dcc0239f3677d1055b9b5 mu e4e36277864e1445295be1397c930c649905ddfa32f1ed65c6defb67f78dd0e8 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch 02cd2b0c92ab04a7e39ab4bf53687bc3354b8fffe3cb4aba9cb630532ce43d4a 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch 6037fa5aee8dba3d3b01ded5752d876954c23da3a53ed5a734f0816a2ef1d4bd 0006-fix-padding-string-formats-to-width-in-wide-printf-v.patch -4b54d17049582fa11b9e28406412ec0538af70476f9e2331e083e6ae37d938b9 1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch +7cec62c7a4ee9d1fa5cd79391aabe9363006ccc6c942fd09924b038e7224f144 0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch +b937311664b96b6272e4e62e1aa0d44edd58c825cbb95746c82fab85a6390968 0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch +4eefc6e8e95da425a519e093e6f9e15390d498070759256de4d86a89679236b9 0009-fix-regression-disabling-use-of-pause-instruction-fo.patch b4a2c06db38742e8c42c3c9838b285a7d8cdac6c091ff3df5ff9a15f1e41b9c7 ldconfig 299a7d75a09de3e2e11e7fb4acc3182e4a14e868093d2f30938fce9bfcff13da __stack_chk_fail_local.c d87d0cbb3690ae2c5d8cc218349fd8278b93855dd625deaf7ae50e320aad247c getconf.c @@ -158,7 +164,9 @@ sha512sums="9016246b44a7e6ef51477f0a246373c79f3e796c70031c3323be1b6c4c0518a2d457 bae8e0f4a1f73be42450945058c1106957da56dc7fa087515dd51bcac3c7099c4cfe4e8c44fb8efc059944d0675858b747396d60c884b031663983912262e992 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch 202f21518ca75373712430fb547662e7a4936c6947cb61fe97fd5dbd9f48217ca38f90439d51b03cafce9a2bfd90e360182a454f3b941abae033d90f2bffe50c 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch fb30c3d1113e3cdaf575b37257b1184f2d5cc7cea0eb0ee94a71e861f9c72fe924de5f63826701584f68c9e1c9c4c1357a967ebe00f637312193e268f7a7cf94 0006-fix-padding-string-formats-to-width-in-wide-printf-v.patch -e3e0ebc19362e93ed1a278688e3acc082c23993daf0eb14ba011917ad076b2348bbe3fc9a939011884223f2dada3280b63fb7e7cb50373bebff0cf857899acaa 1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch +ffb52c8a24bfa5fcad0561c6c4f6f265b0b3666f0c6e8c0a12b1f11c9aeb1c51b17f4f0fccdd70a3e94dccb17650efaf24635cd12b64d12c09469ca1399d99d7 0007-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch +afa17d63f3de02661709d3712d1586b3173518476d314ca2b1e72a3814536538c81aefa5a4ec0cee3470af7177dd4842ab6e62e891ae85a88102bb703ba09c59 0008-fix-undefined-pointer-comparison-in-stdio-internal-_.patch +5818f2563a7a335aec2cbaaeb4acb80d1380206dd03110331adb09fd1279c84f09883e2f92e0d8964079acf3d4fc173c1b5073091c874c492f2f5a966e1cccb7 0009-fix-regression-disabling-use-of-pause-instruction-fo.patch 8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c 0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c |