diff options
author | Milan P. Stanić <mps@arvanta.net> | 2020-03-04 23:32:12 +0100 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-03-21 13:35:50 +0200 |
commit | 4024cc3b29ad4c65544ad068b8f59172b5494306 (patch) | |
tree | 401124e7142a4c7e3f186335e351e4fa9f53b1f5 | |
parent | 67d25886a93e8d871f2e626244d99f796aed612b (diff) | |
download | alpine_aports-4024cc3b29ad4c65544ad068b8f59172b5494306.tar.bz2 alpine_aports-4024cc3b29ad4c65544ad068b8f59172b5494306.tar.xz alpine_aports-4024cc3b29ad4c65544ad068b8f59172b5494306.zip |
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
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 @@ | |||
2 | # Maintainer: Timo Teräs <timo.teras@iki.fi> | 2 | # Maintainer: Timo Teräs <timo.teras@iki.fi> |
3 | pkgname=musl | 3 | pkgname=musl |
4 | pkgver=1.1.24 | 4 | pkgver=1.1.24 |
5 | pkgrel=1 | 5 | pkgrel=2 |
6 | pkgdesc="the musl c library (libc) implementation" | 6 | pkgdesc="the musl c library (libc) implementation" |
7 | url="https://musl.libc.org/" | 7 | url="https://musl.libc.org/" |
8 | arch="all" | 8 | arch="all" |
@@ -20,6 +20,12 @@ esac | |||
20 | source="https://musl.libc.org/releases/musl-$pkgver.tar.gz | 20 | source="https://musl.libc.org/releases/musl-$pkgver.tar.gz |
21 | handle-aux-at_base.patch | 21 | handle-aux-at_base.patch |
22 | 0001-add-thumb2-support-to-arm-assembler-memcpy.patch | 22 | 0001-add-thumb2-support-to-arm-assembler-memcpy.patch |
23 | fix-wcwidth-wrongly-returning-0-for-most-of-planes-4.patch | ||
24 | add-missing-case-mapping-between-U-03F3-and-U-037F.patch | ||
25 | fix-cacosh-results-for-arguments-with-negative-imagi.patch | ||
26 | fix-incorrect-results-for-catanf-and-catanl-with-som.patch | ||
27 | fix-return-value-of-ungetc-when-argument-is-outside-.patch | ||
28 | fix-errno-for-posix_openpt-with-no-free-ptys-availab.patch | ||
23 | 29 | ||
24 | ldconfig | 30 | ldconfig |
25 | __stack_chk_fail_local.c | 31 | __stack_chk_fail_local.c |
@@ -163,6 +169,12 @@ compat() { | |||
163 | sha512sums="8987f1e194ea616f34f4f21fe9def28fb7f81d7060e38619206c6349f79db3bbb76bae8b711f5f9b8ed038799c9aea1a4cbec69e0bc4131e246203e133149e77 musl-1.1.24.tar.gz | 169 | sha512sums="8987f1e194ea616f34f4f21fe9def28fb7f81d7060e38619206c6349f79db3bbb76bae8b711f5f9b8ed038799c9aea1a4cbec69e0bc4131e246203e133149e77 musl-1.1.24.tar.gz |
164 | 6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch | 170 | 6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch |
165 | 2b26c20112e3984a2501bc6c2f5162c6e60d4a521d9367dc7721ec66c974986e9f98a67e9f4f4c1510e82a0ac47de783317ab254786837c2e86a54122efcc1dd 0001-add-thumb2-support-to-arm-assembler-memcpy.patch | 171 | 2b26c20112e3984a2501bc6c2f5162c6e60d4a521d9367dc7721ec66c974986e9f98a67e9f4f4c1510e82a0ac47de783317ab254786837c2e86a54122efcc1dd 0001-add-thumb2-support-to-arm-assembler-memcpy.patch |
172 | 7a9d7f16461d1e7906764cc5366af057d9402556d7bb1d022016faa8a250947c0d901f84cf02200ebc2e153d572104529097fb6f3a65f67695912d0ea40eb2d4 fix-wcwidth-wrongly-returning-0-for-most-of-planes-4.patch | ||
173 | 402b663b5ff77bdde6f5ea9ccec60a16971e5e7881c29259273a167b5b4d9f81734751b7375e5cb856c1e3db86fc46ee2084a244a74ed3bd47a8f97b37e40fd9 add-missing-case-mapping-between-U-03F3-and-U-037F.patch | ||
174 | 40c369ca393970461f19371542fa5881d0745abaaf99d1f71a3093605a306ccbc1dc120c41a8cea1542be79a82918807749ede786f836406f6c1b3dc4ec2de32 fix-cacosh-results-for-arguments-with-negative-imagi.patch | ||
175 | 41934951bbc16f155d40824abf30d818b4c124f668f74f5a13674b5251650bb9d9bf9fde0b75462bb2a4b80dc00871ba122960fa027998e71970d533df1cb987 fix-incorrect-results-for-catanf-and-catanl-with-som.patch | ||
176 | 81bddb171fc2171a7aa86e74bf674e3a99508d27416dfc1cfcf2824f17b33ee7dda7c5968a8a69a542fdd6eecded5b8e3973e81079d9a061aa80142d08fc1a90 fix-return-value-of-ungetc-when-argument-is-outside-.patch | ||
177 | 144b4525483cbc97f0414955b7e5ce42c9ff69580e5be714b56330da30b0687911bd6019aef3c8611bd0a5bd7671d690b66b4920ae47cf3442a1c982ed000e22 fix-errno-for-posix_openpt-with-no-free-ptys-availab.patch | ||
166 | 8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig | 178 | 8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig |
167 | 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c | 179 | 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c |
168 | 0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c | 180 | 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 @@ | |||
1 | From e8aba58ab19a18f83d7f78e80d5e4f51e7e4e8a9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rich Felker <dalias@aerifal.cx> | ||
3 | Date: Fri, 25 Oct 2019 12:20:22 -0400 | ||
4 | Subject: [PATCH] add missing case mapping between U+03F3 and U+037F | ||
5 | |||
6 | somehow this seems to have been overlooked. add it now so that | ||
7 | subsequent overhaul of case mapping implementation will not introduce | ||
8 | a functional change at the same time. | ||
9 | --- | ||
10 | src/ctype/towctrans.c | 1 + | ||
11 | 1 file changed, 1 insertion(+) | ||
12 | |||
13 | diff --git a/src/ctype/towctrans.c b/src/ctype/towctrans.c | ||
14 | index 8f681018..9b91b2de 100644 | ||
15 | --- a/src/ctype/towctrans.c | ||
16 | +++ b/src/ctype/towctrans.c | ||
17 | @@ -176,6 +176,7 @@ static const unsigned short pairs[][2] = { | ||
18 | { 0x243, 0x180 }, | ||
19 | { 0x244, 0x289 }, | ||
20 | { 0x245, 0x28c }, | ||
21 | + { 0x37f, 0x3f3 }, | ||
22 | { 0x3f4, 0x3b8 }, | ||
23 | { 0x3f9, 0x3f2 }, | ||
24 | { 0x3fd, 0x37b }, | ||
25 | -- | ||
26 | 2.24.1 | ||
27 | |||
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 @@ | |||
1 | From aa2d23e57c9c95f0ffeb80cb035e5a5be52d8ef0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Morrell <mmorrell@tachyum.com> | ||
3 | Date: Mon, 14 Oct 2019 09:07:31 -0400 | ||
4 | Subject: [PATCH] fix cacosh results for arguments with negative imaginary part | ||
5 | |||
6 | --- | ||
7 | src/complex/cacosh.c | 5 ++++- | ||
8 | src/complex/cacoshf.c | 5 ++++- | ||
9 | src/complex/cacoshl.c | 5 ++++- | ||
10 | 3 files changed, 12 insertions(+), 3 deletions(-) | ||
11 | |||
12 | diff --git a/src/complex/cacosh.c b/src/complex/cacosh.c | ||
13 | index 8e42f1ae..76127f75 100644 | ||
14 | --- a/src/complex/cacosh.c | ||
15 | +++ b/src/complex/cacosh.c | ||
16 | @@ -4,6 +4,9 @@ | ||
17 | |||
18 | double complex cacosh(double complex z) | ||
19 | { | ||
20 | + int zineg = signbit(cimag(z)); | ||
21 | + | ||
22 | z = cacos(z); | ||
23 | - return CMPLX(-cimag(z), creal(z)); | ||
24 | + if (zineg) return CMPLX(cimag(z), -creal(z)); | ||
25 | + else return CMPLX(-cimag(z), creal(z)); | ||
26 | } | ||
27 | diff --git a/src/complex/cacoshf.c b/src/complex/cacoshf.c | ||
28 | index d7e6b545..8bd80581 100644 | ||
29 | --- a/src/complex/cacoshf.c | ||
30 | +++ b/src/complex/cacoshf.c | ||
31 | @@ -2,6 +2,9 @@ | ||
32 | |||
33 | float complex cacoshf(float complex z) | ||
34 | { | ||
35 | + int zineg = signbit(cimagf(z)); | ||
36 | + | ||
37 | z = cacosf(z); | ||
38 | - return CMPLXF(-cimagf(z), crealf(z)); | ||
39 | + if (zineg) return CMPLXF(cimagf(z), -crealf(z)); | ||
40 | + else return CMPLXF(-cimagf(z), crealf(z)); | ||
41 | } | ||
42 | diff --git a/src/complex/cacoshl.c b/src/complex/cacoshl.c | ||
43 | index d3eaee20..3a284be9 100644 | ||
44 | --- a/src/complex/cacoshl.c | ||
45 | +++ b/src/complex/cacoshl.c | ||
46 | @@ -8,7 +8,10 @@ long double complex cacoshl(long double complex z) | ||
47 | #else | ||
48 | long double complex cacoshl(long double complex z) | ||
49 | { | ||
50 | + int zineg = signbit(cimagl(z)); | ||
51 | + | ||
52 | z = cacosl(z); | ||
53 | - return CMPLXL(-cimagl(z), creall(z)); | ||
54 | + if (zineg) return CMPLXL(cimagl(z), -creall(z)); | ||
55 | + else return CMPLXL(-cimagl(z), creall(z)); | ||
56 | } | ||
57 | #endif | ||
58 | -- | ||
59 | 2.24.1 | ||
60 | |||
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 @@ | |||
1 | From 4fd0f2056082441a4503f6bfcb787a7c15754518 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rich Felker <dalias@aerifal.cx> | ||
3 | Date: Tue, 22 Oct 2019 10:22:22 -0400 | ||
4 | Subject: [PATCH] fix errno for posix_openpt with no free ptys available | ||
5 | |||
6 | linux fails the open with ENOSPC, but POSIX mandates EAGAIN. | ||
7 | --- | ||
8 | src/misc/pty.c | 4 +++- | ||
9 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/src/misc/pty.c b/src/misc/pty.c | ||
12 | index b9cb5eaa..a0577147 100644 | ||
13 | --- a/src/misc/pty.c | ||
14 | +++ b/src/misc/pty.c | ||
15 | @@ -7,7 +7,9 @@ | ||
16 | |||
17 | int posix_openpt(int flags) | ||
18 | { | ||
19 | - return open("/dev/ptmx", flags); | ||
20 | + int r = open("/dev/ptmx", flags); | ||
21 | + if (r < 0 && errno == ENOSPC) errno = EAGAIN; | ||
22 | + return r; | ||
23 | } | ||
24 | |||
25 | int grantpt(int fd) | ||
26 | -- | ||
27 | 2.24.1 | ||
28 | |||
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 @@ | |||
1 | From 11020620813b828917bc31b4636d8a142f7a564a Mon Sep 17 00:00:00 2001 | ||
2 | From: Rich Felker <dalias@aerifal.cx> | ||
3 | Date: Wed, 5 Feb 2020 09:40:11 -0500 | ||
4 | Subject: [PATCH] fix incorrect results for catanf and catanl with some inputs | ||
5 | |||
6 | catan was fixed in 10e4bd3780050e75b72aac5d85c31816419bb17d but the | ||
7 | same bug in catanf and catanl was overlooked. the patch is completely | ||
8 | analogous. | ||
9 | --- | ||
10 | src/complex/catanf.c | 14 +------------- | ||
11 | src/complex/catanl.c | 14 +------------- | ||
12 | 2 files changed, 2 insertions(+), 26 deletions(-) | ||
13 | |||
14 | diff --git a/src/complex/catanf.c b/src/complex/catanf.c | ||
15 | index e10d9c09..ef3907a5 100644 | ||
16 | --- a/src/complex/catanf.c | ||
17 | +++ b/src/complex/catanf.c | ||
18 | @@ -87,29 +87,17 @@ float complex catanf(float complex z) | ||
19 | x = crealf(z); | ||
20 | y = cimagf(z); | ||
21 | |||
22 | - if ((x == 0.0f) && (y > 1.0f)) | ||
23 | - goto ovrf; | ||
24 | - | ||
25 | x2 = x * x; | ||
26 | a = 1.0f - x2 - (y * y); | ||
27 | - if (a == 0.0f) | ||
28 | - goto ovrf; | ||
29 | |||
30 | t = 0.5f * atan2f(2.0f * x, a); | ||
31 | w = _redupif(t); | ||
32 | |||
33 | t = y - 1.0f; | ||
34 | a = x2 + (t * t); | ||
35 | - if (a == 0.0f) | ||
36 | - goto ovrf; | ||
37 | |||
38 | t = y + 1.0f; | ||
39 | a = (x2 + (t * t))/a; | ||
40 | - w = w + (0.25f * logf (a)) * I; | ||
41 | - return w; | ||
42 | - | ||
43 | -ovrf: | ||
44 | - // FIXME | ||
45 | - w = MAXNUMF + MAXNUMF * I; | ||
46 | + w = CMPLXF(w, 0.25f * logf(a)); | ||
47 | return w; | ||
48 | } | ||
49 | diff --git a/src/complex/catanl.c b/src/complex/catanl.c | ||
50 | index a9fc02db..e62526c0 100644 | ||
51 | --- a/src/complex/catanl.c | ||
52 | +++ b/src/complex/catanl.c | ||
53 | @@ -97,30 +97,18 @@ long double complex catanl(long double complex z) | ||
54 | x = creall(z); | ||
55 | y = cimagl(z); | ||
56 | |||
57 | - if ((x == 0.0L) && (y > 1.0L)) | ||
58 | - goto ovrf; | ||
59 | - | ||
60 | x2 = x * x; | ||
61 | a = 1.0L - x2 - (y * y); | ||
62 | - if (a == 0.0L) | ||
63 | - goto ovrf; | ||
64 | |||
65 | t = atan2l(2.0L * x, a) * 0.5L; | ||
66 | w = redupil(t); | ||
67 | |||
68 | t = y - 1.0L; | ||
69 | a = x2 + (t * t); | ||
70 | - if (a == 0.0L) | ||
71 | - goto ovrf; | ||
72 | |||
73 | t = y + 1.0L; | ||
74 | a = (x2 + (t * t)) / a; | ||
75 | - w = w + (0.25L * logl(a)) * I; | ||
76 | - return w; | ||
77 | - | ||
78 | -ovrf: | ||
79 | - // FIXME | ||
80 | - w = LDBL_MAX + LDBL_MAX * I; | ||
81 | + w = CMPLXF(w, 0.25L * logl(a)); | ||
82 | return w; | ||
83 | } | ||
84 | #endif | ||
85 | -- | ||
86 | 2.24.1 | ||
87 | |||
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 @@ | |||
1 | From f6ecd0c296181bf6a2a7f54e3406c846500e8e63 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rich Felker <dalias@aerifal.cx> | ||
3 | Date: Fri, 18 Oct 2019 21:11:44 -0400 | ||
4 | Subject: [PATCH] fix return value of ungetc when argument is outside unsigned | ||
5 | char range | ||
6 | |||
7 | aside from the special value EOF, ungetc is specified to accept and | ||
8 | convert values outside the range of unsigned char. conversion takes | ||
9 | place automatically as part of assignment when storing into the | ||
10 | buffer, but the return value is also required to be the resulting | ||
11 | converted value, and this requirement was not satisfied. | ||
12 | |||
13 | simplified from patch by Wang Jianjian. | ||
14 | --- | ||
15 | src/stdio/ungetc.c | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/src/stdio/ungetc.c b/src/stdio/ungetc.c | ||
19 | index 180673a4..bc629d4c 100644 | ||
20 | --- a/src/stdio/ungetc.c | ||
21 | +++ b/src/stdio/ungetc.c | ||
22 | @@ -16,5 +16,5 @@ int ungetc(int c, FILE *f) | ||
23 | f->flags &= ~F_EOF; | ||
24 | |||
25 | FUNLOCK(f); | ||
26 | - return c; | ||
27 | + return (unsigned char)c; | ||
28 | } | ||
29 | -- | ||
30 | 2.24.1 | ||
31 | |||
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 @@ | |||
1 | From 70d80609558153a996833392999c69cdb74e1119 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rich Felker <dalias@aerifal.cx> | ||
3 | Date: Wed, 1 Jan 2020 20:02:51 -0500 | ||
4 | Subject: [PATCH] fix wcwidth wrongly returning 0 for most of planes 4 and up | ||
5 | |||
6 | commit 1b0ce9af6d2aa7b92edaf3e9c631cb635bae22bd introduced this bug | ||
7 | back in 2012 and it was never noticed, presumably since the affected | ||
8 | planes are essentially unused in Unicode. | ||
9 | --- | ||
10 | src/ctype/wcwidth.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/src/ctype/wcwidth.c b/src/ctype/wcwidth.c | ||
14 | index 49c40eea..36256a53 100644 | ||
15 | --- a/src/ctype/wcwidth.c | ||
16 | +++ b/src/ctype/wcwidth.c | ||
17 | @@ -23,7 +23,7 @@ int wcwidth(wchar_t wc) | ||
18 | return -1; | ||
19 | if (wc-0x20000U < 0x20000) | ||
20 | return 2; | ||
21 | - if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100 < 0xef) | ||
22 | + if (wc == 0xe0001 || wc-0xe0020U < 0x5f || wc-0xe0100U < 0xef) | ||
23 | return 0; | ||
24 | return 1; | ||
25 | } | ||
26 | -- | ||
27 | 2.24.1 | ||
28 | |||