aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorMilan P. Stanić <mps@arvanta.net>2020-03-04 23:32:12 +0100
committerTimo Teräs <timo.teras@iki.fi>2020-03-21 13:35:50 +0200
commit4024cc3b29ad4c65544ad068b8f59172b5494306 (patch)
tree401124e7142a4c7e3f186335e351e4fa9f53b1f5 /main
parent67d25886a93e8d871f2e626244d99f796aed612b (diff)
downloadaports-4024cc3b29ad4c65544ad068b8f59172b5494306.tar.bz2
aports-4024cc3b29ad4c65544ad068b8f59172b5494306.tar.xz
main/musl: backport fixes from 1.2.0
wcwidth wrongly returned 0 for most of planes 4 and up missing case mapping between U+03F3 and U+037F wrong cacosh results for arguments with negative imaginary part wrong catanf/catanl results for various classes of arguments wrong return value for ungetc with argument outside [0,UCHAR_MAX] posix_openpt with no ptys available produced wrong errno
Diffstat (limited to 'main')
-rw-r--r--main/musl/APKBUILD14
-rw-r--r--main/musl/add-missing-case-mapping-between-U-03F3-and-U-037F.patch27
-rw-r--r--main/musl/fix-cacosh-results-for-arguments-with-negative-imagi.patch60
-rw-r--r--main/musl/fix-errno-for-posix_openpt-with-no-free-ptys-availab.patch28
-rw-r--r--main/musl/fix-incorrect-results-for-catanf-and-catanl-with-som.patch87
-rw-r--r--main/musl/fix-return-value-of-ungetc-when-argument-is-outside-.patch31
-rw-r--r--main/musl/fix-wcwidth-wrongly-returning-0-for-most-of-planes-4.patch28
7 files changed, 274 insertions, 1 deletions
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index 7b8467d6d9..4c7621ae73 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.24
-pkgrel=1
+pkgrel=2
pkgdesc="the musl c library (libc) implementation"
url="https://musl.libc.org/"
arch="all"
@@ -20,6 +20,12 @@ esac
source="https://musl.libc.org/releases/musl-$pkgver.tar.gz
handle-aux-at_base.patch
0001-add-thumb2-support-to-arm-assembler-memcpy.patch
+ fix-wcwidth-wrongly-returning-0-for-most-of-planes-4.patch
+ add-missing-case-mapping-between-U-03F3-and-U-037F.patch
+ fix-cacosh-results-for-arguments-with-negative-imagi.patch
+ fix-incorrect-results-for-catanf-and-catanl-with-som.patch
+ fix-return-value-of-ungetc-when-argument-is-outside-.patch
+ fix-errno-for-posix_openpt-with-no-free-ptys-availab.patch
ldconfig
__stack_chk_fail_local.c
@@ -163,6 +169,12 @@ compat() {
sha512sums="8987f1e194ea616f34f4f21fe9def28fb7f81d7060e38619206c6349f79db3bbb76bae8b711f5f9b8ed038799c9aea1a4cbec69e0bc4131e246203e133149e77 musl-1.1.24.tar.gz
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch
2b26c20112e3984a2501bc6c2f5162c6e60d4a521d9367dc7721ec66c974986e9f98a67e9f4f4c1510e82a0ac47de783317ab254786837c2e86a54122efcc1dd 0001-add-thumb2-support-to-arm-assembler-memcpy.patch
+7a9d7f16461d1e7906764cc5366af057d9402556d7bb1d022016faa8a250947c0d901f84cf02200ebc2e153d572104529097fb6f3a65f67695912d0ea40eb2d4 fix-wcwidth-wrongly-returning-0-for-most-of-planes-4.patch
+402b663b5ff77bdde6f5ea9ccec60a16971e5e7881c29259273a167b5b4d9f81734751b7375e5cb856c1e3db86fc46ee2084a244a74ed3bd47a8f97b37e40fd9 add-missing-case-mapping-between-U-03F3-and-U-037F.patch
+40c369ca393970461f19371542fa5881d0745abaaf99d1f71a3093605a306ccbc1dc120c41a8cea1542be79a82918807749ede786f836406f6c1b3dc4ec2de32 fix-cacosh-results-for-arguments-with-negative-imagi.patch
+41934951bbc16f155d40824abf30d818b4c124f668f74f5a13674b5251650bb9d9bf9fde0b75462bb2a4b80dc00871ba122960fa027998e71970d533df1cb987 fix-incorrect-results-for-catanf-and-catanl-with-som.patch
+81bddb171fc2171a7aa86e74bf674e3a99508d27416dfc1cfcf2824f17b33ee7dda7c5968a8a69a542fdd6eecded5b8e3973e81079d9a061aa80142d08fc1a90 fix-return-value-of-ungetc-when-argument-is-outside-.patch
+144b4525483cbc97f0414955b7e5ce42c9ff69580e5be714b56330da30b0687911bd6019aef3c8611bd0a5bd7671d690b66b4920ae47cf3442a1c982ed000e22 fix-errno-for-posix_openpt-with-no-free-ptys-availab.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c
diff --git a/main/musl/add-missing-case-mapping-between-U-03F3-and-U-037F.patch b/main/musl/add-missing-case-mapping-between-U-03F3-and-U-037F.patch
new file mode 100644
index 0000000000..6b06c15b2f
--- /dev/null
+++ b/main/musl/add-missing-case-mapping-between-U-03F3-and-U-037F.patch
@@ -0,0 +1,27 @@
+From e8aba58ab19a18f83d7f78e80d5e4f51e7e4e8a9 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Fri, 25 Oct 2019 12:20:22 -0400
+Subject: [PATCH] add missing case mapping between U+03F3 and U+037F
+
+somehow this seems to have been overlooked. add it now so that
+subsequent overhaul of case mapping implementation will not introduce
+a functional change at the same time.
+---
+ src/ctype/towctrans.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/ctype/towctrans.c b/src/ctype/towctrans.c
+index 8f681018..9b91b2de 100644
+--- a/src/ctype/towctrans.c
++++ b/src/ctype/towctrans.c
+@@ -176,6 +176,7 @@ static const unsigned short pairs[][2] = {
+ { 0x243, 0x180 },
+ { 0x244, 0x289 },
+ { 0x245, 0x28c },
++ { 0x37f, 0x3f3 },
+ { 0x3f4, 0x3b8 },
+ { 0x3f9, 0x3f2 },
+ { 0x3fd, 0x37b },
+--
+2.24.1
+
diff --git a/main/musl/fix-cacosh-results-for-arguments-with-negative-imagi.patch b/main/musl/fix-cacosh-results-for-arguments-with-negative-imagi.patch
new file mode 100644
index 0000000000..b9f812d0cc
--- /dev/null
+++ b/main/musl/fix-cacosh-results-for-arguments-with-negative-imagi.patch
@@ -0,0 +1,60 @@
+From aa2d23e57c9c95f0ffeb80cb035e5a5be52d8ef0 Mon Sep 17 00:00:00 2001
+From: Michael Morrell <mmorrell@tachyum.com>
+Date: Mon, 14 Oct 2019 09:07:31 -0400
+Subject: [PATCH] fix cacosh results for arguments with negative imaginary part
+
+---
+ src/complex/cacosh.c | 5 ++++-
+ src/complex/cacoshf.c | 5 ++++-
+ src/complex/cacoshl.c | 5 ++++-
+ 3 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/src/complex/cacosh.c b/src/complex/cacosh.c
+index 8e42f1ae..76127f75 100644
+--- a/src/complex/cacosh.c
++++ b/src/complex/cacosh.c
+@@ -4,6 +4,9 @@
+
+ double complex cacosh(double complex z)
+ {
++ int zineg = signbit(cimag(z));
++
+ z = cacos(z);
+- return CMPLX(-cimag(z), creal(z));
++ if (zineg) return CMPLX(cimag(z), -creal(z));
++ else return CMPLX(-cimag(z), creal(z));
+ }
+diff --git a/src/complex/cacoshf.c b/src/complex/cacoshf.c
+index d7e6b545..8bd80581 100644
+--- a/src/complex/cacoshf.c
++++ b/src/complex/cacoshf.c
+@@ -2,6 +2,9 @@
+
+ float complex cacoshf(float complex z)
+ {
++ int zineg = signbit(cimagf(z));
++
+ z = cacosf(z);
+- return CMPLXF(-cimagf(z), crealf(z));
++ if (zineg) return CMPLXF(cimagf(z), -crealf(z));
++ else return CMPLXF(-cimagf(z), crealf(z));
+ }
+diff --git a/src/complex/cacoshl.c b/src/complex/cacoshl.c
+index d3eaee20..3a284be9 100644
+--- a/src/complex/cacoshl.c
++++ b/src/complex/cacoshl.c
+@@ -8,7 +8,10 @@ long double complex cacoshl(long double complex z)
+ #else
+ long double complex cacoshl(long double complex z)
+ {
++ int zineg = signbit(cimagl(z));
++
+ z = cacosl(z);
+- return CMPLXL(-cimagl(z), creall(z));
++ if (zineg) return CMPLXL(cimagl(z), -creall(z));
++ else return CMPLXL(-cimagl(z), creall(z));
+ }
+ #endif
+--
+2.24.1
+
diff --git a/main/musl/fix-errno-for-posix_openpt-with-no-free-ptys-availab.patch b/main/musl/fix-errno-for-posix_openpt-with-no-free-ptys-availab.patch
new file mode 100644
index 0000000000..a7afdd3dbd
--- /dev/null
+++ b/main/musl/fix-errno-for-posix_openpt-with-no-free-ptys-availab.patch
@@ -0,0 +1,28 @@
+From 4fd0f2056082441a4503f6bfcb787a7c15754518 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Tue, 22 Oct 2019 10:22:22 -0400
+Subject: [PATCH] fix errno for posix_openpt with no free ptys available
+
+linux fails the open with ENOSPC, but POSIX mandates EAGAIN.
+---
+ src/misc/pty.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/misc/pty.c b/src/misc/pty.c
+index b9cb5eaa..a0577147 100644
+--- a/src/misc/pty.c
++++ b/src/misc/pty.c
+@@ -7,7 +7,9 @@
+
+ int posix_openpt(int flags)
+ {
+- return open("/dev/ptmx", flags);
++ int r = open("/dev/ptmx", flags);
++ if (r < 0 && errno == ENOSPC) errno = EAGAIN;
++ return r;
+ }
+
+ int grantpt(int fd)
+--
+2.24.1
+
diff --git a/main/musl/fix-incorrect-results-for-catanf-and-catanl-with-som.patch b/main/musl/fix-incorrect-results-for-catanf-and-catanl-with-som.patch
new file mode 100644
index 0000000000..4aa3487bb2
--- /dev/null
+++ b/main/musl/fix-incorrect-results-for-catanf-and-catanl-with-som.patch
@@ -0,0 +1,87 @@
+From 11020620813b828917bc31b4636d8a142f7a564a Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Wed, 5 Feb 2020 09:40:11 -0500
+Subject: [PATCH] fix incorrect results for catanf and catanl with some inputs
+
+catan was fixed in 10e4bd3780050e75b72aac5d85c31816419bb17d but the
+same bug in catanf and catanl was overlooked. the patch is completely
+analogous.
+---
+ src/complex/catanf.c | 14 +-------------
+ src/complex/catanl.c | 14 +-------------
+ 2 files changed, 2 insertions(+), 26 deletions(-)
+
+diff --git a/src/complex/catanf.c b/src/complex/catanf.c
+index e10d9c09..ef3907a5 100644
+--- a/src/complex/catanf.c
++++ b/src/complex/catanf.c
+@@ -87,29 +87,17 @@ float complex catanf(float complex z)
+ x = crealf(z);
+ y = cimagf(z);
+
+- if ((x == 0.0f) && (y > 1.0f))
+- goto ovrf;
+-
+ x2 = x * x;
+ a = 1.0f - x2 - (y * y);
+- if (a == 0.0f)
+- goto ovrf;
+
+ t = 0.5f * atan2f(2.0f * x, a);
+ w = _redupif(t);
+
+ t = y - 1.0f;
+ a = x2 + (t * t);
+- if (a == 0.0f)
+- goto ovrf;
+
+ t = y + 1.0f;
+ a = (x2 + (t * t))/a;
+- w = w + (0.25f * logf (a)) * I;
+- return w;
+-
+-ovrf:
+- // FIXME
+- w = MAXNUMF + MAXNUMF * I;
++ w = CMPLXF(w, 0.25f * logf(a));
+ return w;
+ }
+diff --git a/src/complex/catanl.c b/src/complex/catanl.c
+index a9fc02db..e62526c0 100644
+--- a/src/complex/catanl.c
++++ b/src/complex/catanl.c
+@@ -97,30 +97,18 @@ long double complex catanl(long double complex z)
+ x = creall(z);
+ y = cimagl(z);
+
+- if ((x == 0.0L) && (y > 1.0L))
+- goto ovrf;
+-
+ x2 = x * x;
+ a = 1.0L - x2 - (y * y);
+- if (a == 0.0L)
+- goto ovrf;
+
+ t = atan2l(2.0L * x, a) * 0.5L;
+ w = redupil(t);
+
+ t = y - 1.0L;
+ a = x2 + (t * t);
+- if (a == 0.0L)
+- goto ovrf;
+
+ t = y + 1.0L;
+ a = (x2 + (t * t)) / a;
+- w = w + (0.25L * logl(a)) * I;
+- return w;
+-
+-ovrf:
+- // FIXME
+- w = LDBL_MAX + LDBL_MAX * I;
++ w = CMPLXF(w, 0.25L * logl(a));
+ return w;
+ }
+ #endif
+--
+2.24.1
+
diff --git a/main/musl/fix-return-value-of-ungetc-when-argument-is-outside-.patch b/main/musl/fix-return-value-of-ungetc-when-argument-is-outside-.patch
new file mode 100644
index 0000000000..b03b1861de
--- /dev/null
+++ b/main/musl/fix-return-value-of-ungetc-when-argument-is-outside-.patch
@@ -0,0 +1,31 @@
+From f6ecd0c296181bf6a2a7f54e3406c846500e8e63 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Fri, 18 Oct 2019 21:11:44 -0400
+Subject: [PATCH] fix return value of ungetc when argument is outside unsigned
+ char range
+
+aside from the special value EOF, ungetc is specified to accept and
+convert values outside the range of unsigned char. conversion takes
+place automatically as part of assignment when storing into the
+buffer, but the return value is also required to be the resulting
+converted value, and this requirement was not satisfied.
+
+simplified from patch by Wang Jianjian.
+---
+ src/stdio/ungetc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/stdio/ungetc.c b/src/stdio/ungetc.c
+index 180673a4..bc629d4c 100644
+--- a/src/stdio/ungetc.c
++++ b/src/stdio/ungetc.c
+@@ -16,5 +16,5 @@ int ungetc(int c, FILE *f)
+ f->flags &= ~F_EOF;
+
+ FUNLOCK(f);
+- return c;
++ return (unsigned char)c;
+ }
+--
+2.24.1
+
diff --git a/main/musl/fix-wcwidth-wrongly-returning-0-for-most-of-planes-4.patch b/main/musl/fix-wcwidth-wrongly-returning-0-for-most-of-planes-4.patch
new file mode 100644
index 0000000000..1290aca5db
--- /dev/null
+++ b/main/musl/fix-wcwidth-wrongly-returning-0-for-most-of-planes-4.patch
@@ -0,0 +1,28 @@
+From 70d80609558153a996833392999c69cdb74e1119 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Wed, 1 Jan 2020 20:02:51 -0500
+Subject: [PATCH] fix wcwidth wrongly returning 0 for most of planes 4 and up
+
+commit 1b0ce9af6d2aa7b92edaf3e9c631cb635bae22bd introduced this bug
+back in 2012 and it was never noticed, presumably since the affected
+planes are essentially unused in Unicode.
+---
+ src/ctype/wcwidth.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ctype/wcwidth.c b/src/ctype/wcwidth.c
+index 49c40eea..36256a53 100644
+--- a/src/ctype/wcwidth.c
++++ b/src/ctype/wcwidth.c
+@@ -23,7 +23,7 @@ int wcwidth(wchar_t wc)
+ return -1;
+ if (wc-0x20000U < 0x20000)
+ return 2;
+- if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100 < 0xef)
++ if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100U < 0xef)
+ return 0;
+ return 1;
+ }
+--
+2.24.1
+