aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-03-08 13:27:16 +0000
committerTimo Teräs <timo.teras@iki.fi>2016-03-08 13:28:32 +0000
commit05ce1370975a5a4585f4f5da9e05d97c489ed2ab (patch)
tree61a8eaf4da541e91e6fb7cf3f3405f46afeb8426 /main/musl
parentff6077a1aadbd77723d97a5dc1f83b7d76e6818c (diff)
downloadaports-05ce1370975a5a4585f4f5da9e05d97c489ed2ab.tar.bz2
aports-05ce1370975a5a4585f4f5da9e05d97c489ed2ab.tar.xz
main/musl: cherry-pick fixes, remove ucontext.h
Diffstat (limited to 'main/musl')
-rw-r--r--main/musl/0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch43
-rw-r--r--main/musl/0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch27
-rw-r--r--main/musl/APKBUILD24
3 files changed, 84 insertions, 10 deletions
diff --git a/main/musl/0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch b/main/musl/0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch
new file mode 100644
index 0000000000..e9eadc9718
--- /dev/null
+++ b/main/musl/0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch
@@ -0,0 +1,43 @@
+From b023c03b574acdfd73418314a5dcaa83e5cea5a0 Mon Sep 17 00:00:00 2001
+From: Szabolcs Nagy <nsz@port70.net>
+Date: Fri, 4 Mar 2016 21:23:33 +0000
+Subject: [PATCH] math: fix expf(-NAN) and exp2f(-NAN) to return -NAN instead
+ of 0
+
+expf(-NAN) was treated as expf(-large) which unconditionally
+returns +0, so special case +-NAN.
+reported by Petr Hosek.
+---
+ src/math/exp2f.c | 2 ++
+ src/math/expf.c | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/src/math/exp2f.c b/src/math/exp2f.c
+index cf6126e..296b634 100644
+--- a/src/math/exp2f.c
++++ b/src/math/exp2f.c
+@@ -91,6 +91,8 @@ float exp2f(float x)
+ /* Filter out exceptional cases. */
+ ix = u.i & 0x7fffffff;
+ if (ix > 0x42fc0000) { /* |x| > 126 */
++ if (ix > 0x7f800000) /* NaN */
++ return x;
+ if (u.i >= 0x43000000 && u.i < 0x80000000) { /* x >= 128 */
+ x *= 0x1p127f;
+ return x;
+diff --git a/src/math/expf.c b/src/math/expf.c
+index 16e9afe..feee2b0 100644
+--- a/src/math/expf.c
++++ b/src/math/expf.c
+@@ -39,6 +39,8 @@ float expf(float x)
+
+ /* special cases */
+ if (hx >= 0x42aeac50) { /* if |x| >= -87.33655f or NaN */
++ if (hx > 0x7f800000) /* NaN */
++ return x;
+ if (hx >= 0x42b17218 && !sign) { /* x >= 88.722839f */
+ /* overflow */
+ x *= 0x1p127f;
+--
+2.7.2
+
diff --git a/main/musl/0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch b/main/musl/0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch
new file mode 100644
index 0000000000..411e802fd1
--- /dev/null
+++ b/main/musl/0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch
@@ -0,0 +1,27 @@
+From 9543656cc32fda48fc463f332ee20e91eed2b768 Mon Sep 17 00:00:00 2001
+From: Alexander Monakov <amonakov@ispras.ru>
+Date: Sun, 6 Mar 2016 20:22:38 +0300
+Subject: [PATCH] env: avoid leaving dangling pointers in __env_map
+
+This is the minimal fix for __putenv leaving a pointer to freed heap
+storage in __env_map array, which could later on lead to errors such
+as double-free.
+---
+ src/env/putenv.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/env/putenv.c b/src/env/putenv.c
+index 4042869..7153042 100644
+--- a/src/env/putenv.c
++++ b/src/env/putenv.c
+@@ -30,6 +30,7 @@ int __putenv(char *s, int a)
+ }
+ } else {
+ free(__env_map[j]);
++ __env_map[j] = s;
+ }
+ }
+ }
+--
+2.7.2
+
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index a9dcff0f0b..a1dd62b719 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=2
+pkgrel=3
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -15,6 +15,8 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
0001-handle-non-matching-address-family-entries-in-hosts-.patch
0002-fix-at-the-start-of-a-BRE-subexpression.patch
0003-fix-at-the-start-of-a-complete-BRE.patch
+ 0004-math-fix-expf-NAN-and-exp2f-NAN-to-return-NAN-instea.patch
+ 0005-env-avoid-leaving-dangling-pointers-in-__env_map.patch
ldconfig
__stack_chk_fail_local.c
@@ -24,15 +26,6 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
"
_builddir="$srcdir"/musl-$pkgver
-prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
-}
install_sysroot_headers() {
cd "$_builddir"
@@ -93,6 +86,11 @@ package() {
# and use GNU gettext where needed. the plan is to migrate to
# musl gettext() later on as fully as possible.
rm "$pkgdir"/usr/include/libintl.h || return 1
+
+ # remote ucontext.h since musl does not implement any of the functions
+ # defined there. this can and does confuse applications to think
+ # makecontext() is usable while it's not. one notable example is mariadb.
+ rm "$pkgdir"/usr/include/ucontext.h || return 1
}
utils() {
@@ -134,6 +132,8 @@ md5sums="d529ce4a2f7f79d8c3fd4b8329417b57 musl-1.1.14.tar.gz
c683094384c5726a99d1047f01aeb331 0001-handle-non-matching-address-family-entries-in-hosts-.patch
3b9089a017ac90b303fad94a6aa71219 0002-fix-at-the-start-of-a-BRE-subexpression.patch
6cee220f293754cd1e7126f3d4db5b43 0003-fix-at-the-start-of-a-complete-BRE.patch
+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
830d01f7821b978df770b06db3790921 ldconfig
0df687757221bbb0fc1aa67f1bd646f9 __stack_chk_fail_local.c
57ef2c63b9ec6a2041694ace97d4ffa2 getconf.c
@@ -143,6 +143,8 @@ sha256sums="35f6c00c84a6091bd5dab29eedde7508dae755ead92dcc0239f3677d1055b9b5 mu
87d3161c69b347c1cb826a886d098bc03a17a00172c5839c4e30ed1745fb92ec 0001-handle-non-matching-address-family-entries-in-hosts-.patch
0bd21cab29a7a2f6644d1046e7bd91dd5aadf6748e207ddda3ff99e353548775 0002-fix-at-the-start-of-a-BRE-subexpression.patch
13d285aba7e5e33dca32e6adbb5ada69f0f88f0320968b201d03fe02f1a70d4c 0003-fix-at-the-start-of-a-complete-BRE.patch
+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
b4a2c06db38742e8c42c3c9838b285a7d8cdac6c091ff3df5ff9a15f1e41b9c7 ldconfig
299a7d75a09de3e2e11e7fb4acc3182e4a14e868093d2f30938fce9bfcff13da __stack_chk_fail_local.c
d87d0cbb3690ae2c5d8cc218349fd8278b93855dd625deaf7ae50e320aad247c getconf.c
@@ -152,6 +154,8 @@ sha512sums="9016246b44a7e6ef51477f0a246373c79f3e796c70031c3323be1b6c4c0518a2d457
8546b31b04effe8d863e26ecd1677890e925b0f65f46e09f03804024c36595c944c3d7e758160f57862b9e6c85e431139ff8b2412a29c57eb9773cce327647a5 0001-handle-non-matching-address-family-entries-in-hosts-.patch
18b2f436de9e1c3b8720c93d4a013f069f1f7bb8d71203c157a4670b4fa5749347fd2eba74b47e527f9bb7d98442eaf69837ee69ea1840bf6d1577f14029f089 0002-fix-at-the-start-of-a-BRE-subexpression.patch
51a16e88f602d1db175d82d8276273006b74dc7e87340207e26db80820bab368c50f4d1539175bf3b5b3b23ae6da2e452e81f858029bfef49c54f548bc1a4674 0003-fix-at-the-start-of-a-complete-BRE.patch
+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
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c