diff options
author | Timo Teräs <timo.teras@iki.fi> | 2018-04-10 05:48:31 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2018-04-10 05:48:31 +0000 |
commit | bda9cddfa33708bb55b5cc1ccf4c844ba6c9284a (patch) | |
tree | cbdfc7fa531b41e3d13380a1a10b7a23790d4cb0 /main/musl | |
parent | cbd6d5b76a903b24dc51fe354c0c8265f3f1a9a3 (diff) | |
download | aports-bda9cddfa33708bb55b5cc1ccf4c844ba6c9284a.tar.bz2 aports-bda9cddfa33708bb55b5cc1ccf4c844ba6c9284a.tar.xz |
main/musl: cherry-pick additional upstream fixes
Diffstat (limited to 'main/musl')
-rw-r--r-- | main/musl/0003-fix-fmaf-wrong-result.patch | 35 | ||||
-rw-r--r-- | main/musl/0004-implement-wcsftime-padding-specifier-extensions.patch | 63 | ||||
-rw-r--r-- | main/musl/0005-fix-wrong-result-in-casin-and-many-related-complex-f.patch (renamed from main/musl/complex-math.patch) | 10 | ||||
-rw-r--r-- | main/musl/APKBUILD | 10 |
4 files changed, 110 insertions, 8 deletions
diff --git a/main/musl/0003-fix-fmaf-wrong-result.patch b/main/musl/0003-fix-fmaf-wrong-result.patch new file mode 100644 index 0000000000..1fdaf2571a --- /dev/null +++ b/main/musl/0003-fix-fmaf-wrong-result.patch @@ -0,0 +1,35 @@ +From 282b1cd26649d69de038111f5876853df6ddc345 Mon Sep 17 00:00:00 2001 +From: Szabolcs Nagy <nsz@port70.net> +Date: Sun, 1 Apr 2018 20:02:01 +0000 +Subject: [PATCH] fix fmaf wrong result + +if double precision r=x*y+z is not a half way case between two single +precision floats or it is an exact result then fmaf returns (float)r. + +however the exactness check was wrong when |x*y| < |z| and could cause +incorrectly rounded result in nearest rounding mode when r is a half +way case. + +fmaf(-0x1.26524ep-54, -0x1.cb7868p+11, 0x1.d10f5ep-29) +was incorrectly rounded up to 0x1.d117ap-29 instead of 0x1.d1179ep-29. +(exact result is 0x1.d1179efffffffecp-29, r is 0x1.d1179fp-29) +--- + src/math/fmaf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/math/fmaf.c b/src/math/fmaf.c +index aa57feb6..80f5cd8a 100644 +--- a/src/math/fmaf.c ++++ b/src/math/fmaf.c +@@ -50,7 +50,7 @@ float fmaf(float x, float y, float z) + /* Common case: The double precision result is fine. */ + if ((u.i & 0x1fffffff) != 0x10000000 || /* not a halfway case */ + e == 0x7ff || /* NaN */ +- result - xy == z || /* exact */ ++ (result - xy == z && result - z == xy) || /* exact */ + fegetround() != FE_TONEAREST) /* not round-to-nearest */ + { + /* +-- +2.17.0 + diff --git a/main/musl/0004-implement-wcsftime-padding-specifier-extensions.patch b/main/musl/0004-implement-wcsftime-padding-specifier-extensions.patch new file mode 100644 index 0000000000..93eb7fb6de --- /dev/null +++ b/main/musl/0004-implement-wcsftime-padding-specifier-extensions.patch @@ -0,0 +1,63 @@ +From ea81529fb92932a50f06bf7a19cae812ae6cdb59 Mon Sep 17 00:00:00 2001 +From: Samuel Holland <samuel@sholland.org> +Date: Sat, 7 Apr 2018 09:47:16 -0500 +Subject: [PATCH] implement wcsftime padding specifier extensions + +Commit 8a6bd7307da3fc4d08dd6a9277b611ccb4971354 added support for +padding specifier extensions to strftime, but did not modify wcsftime. +In the process, it added a parameter to __strftime_fmt_1 in strftime.c, +but failed to update the prototype in wcsftime.c. This was found by +compiling musl with LTO: + + src/time/wcsftime.c:7:13: warning: type of '__strftime_fmt_1' does \ + not match original declaration [-Wlto-type-mismatch] + +Fix the prototype of __strftime_fmt_1 in wcsftime.c, and generate the +'pad' argument the same way as it is done in strftime. +--- + src/time/wcsftime.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/time/wcsftime.c b/src/time/wcsftime.c +index 638e64f6..23500cc8 100644 +--- a/src/time/wcsftime.c ++++ b/src/time/wcsftime.c +@@ -4,7 +4,7 @@ + #include "locale_impl.h" + #include "libc.h" + +-const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *tm, locale_t loc); ++const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *tm, locale_t loc, int pad); + + size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, const struct tm *restrict tm, locale_t loc) + { +@@ -14,7 +14,7 @@ size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, co + wchar_t *p; + const char *t_mb; + const wchar_t *t; +- int plus; ++ int pad, plus; + unsigned long width; + for (l=0; l<n; f++) { + if (!*f) { +@@ -26,6 +26,8 @@ size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, co + continue; + } + f++; ++ pad = 0; ++ if (*f == '-' || *f == '_' || *f == '0') pad = *f++; + if ((plus = (*f == '+'))) f++; + width = wcstoul(f, &p, 10); + if (*p == 'C' || *p == 'F' || *p == 'G' || *p == 'Y') { +@@ -35,7 +37,7 @@ size_t __wcsftime_l(wchar_t *restrict s, size_t n, const wchar_t *restrict f, co + } + f = p; + if (*f == 'E' || *f == 'O') f++; +- t_mb = __strftime_fmt_1(&buf, &k, *f, tm, loc); ++ t_mb = __strftime_fmt_1(&buf, &k, *f, tm, loc, pad); + if (!t_mb) break; + k = mbstowcs(wbuf, t_mb, sizeof wbuf / sizeof *wbuf); + if (k == (size_t)-1) return 0; +-- +2.17.0 + diff --git a/main/musl/complex-math.patch b/main/musl/0005-fix-wrong-result-in-casin-and-many-related-complex-f.patch index fff4b59c17..d6326369dc 100644 --- a/main/musl/complex-math.patch +++ b/main/musl/0005-fix-wrong-result-in-casin-and-many-related-complex-f.patch @@ -1,7 +1,7 @@ From ae2a01da2e388535da243b3d974aef74a3c06ae0 Mon Sep 17 00:00:00 2001 From: Rich Felker <dalias@aerifal.cx> Date: Mon, 9 Apr 2018 12:33:17 -0400 -Subject: fix wrong result in casin and many related complex functions +Subject: [PATCH] fix wrong result in casin and many related complex functions the factor of -i noted in the comment at the top of casin.c was omitted from the actual code, yielding a result rotated 90 degrees and @@ -18,7 +18,7 @@ finite. here, the rotation is the actual intent, anyway. 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/complex/casin.c b/src/complex/casin.c -index dfdda98..01ed618 100644 +index dfdda988..01ed6184 100644 --- a/src/complex/casin.c +++ b/src/complex/casin.c @@ -12,5 +12,6 @@ double complex casin(double complex z) @@ -30,7 +30,7 @@ index dfdda98..01ed618 100644 + return CMPLX(cimag(r), -creal(r)); } diff --git a/src/complex/casinf.c b/src/complex/casinf.c -index 93f0e33..4fcb76f 100644 +index 93f0e335..4fcb76fc 100644 --- a/src/complex/casinf.c +++ b/src/complex/casinf.c @@ -10,5 +10,6 @@ float complex casinf(float complex z) @@ -42,7 +42,7 @@ index 93f0e33..4fcb76f 100644 + return CMPLXF(cimagf(r), -crealf(r)); } diff --git a/src/complex/casinl.c b/src/complex/casinl.c -index 0916c60..3b7ceba 100644 +index 0916c60f..3b7ceba7 100644 --- a/src/complex/casinl.c +++ b/src/complex/casinl.c @@ -15,6 +15,7 @@ long double complex casinl(long double complex z) @@ -55,5 +55,5 @@ index 0916c60..3b7ceba 100644 } #endif -- -cgit v0.11.2 +2.17.0 diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD index 5f13e496a8..0ff8fc1a47 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.19 -pkgrel=5 +pkgrel=6 pkgdesc="the musl c library (libc) implementation" url="http://www.musl-libc.org/" arch="all" @@ -19,10 +19,12 @@ esac source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz 0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch 0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch + 0003-fix-fmaf-wrong-result.patch + 0004-implement-wcsftime-padding-specifier-extensions.patch + 0005-fix-wrong-result-in-casin-and-many-related-complex-f.patch 1000-cloudflare-stupidity.patch 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch - complex-math.patch handle-aux-at_base.patch ldconfig @@ -150,9 +152,11 @@ compat() { sha512sums="abee52d53af4b3c14c9088866c911a24d2b6ef67dc494f38a7a09dfe77250026f77528c24c52469c89cffa8ced2f0fa95badbdcf8d4460c90faba47e3927bcc5 musl-1.1.19.tar.gz 7a6480c454ad25d156727818cf61961880e526abcb00382ed81e40256ac5b06af546837652e47187132d64c261d9f01ce91a952762afd439a8faf5825306a880 0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch 1c649ebd4814ee22364d8766fdf93732e0c0c54361fcfcc994be254b52e9beb276fca5031a1cef9d4f971c96dc3d3774a1738ba3a38263d8e139ea3947c9b7c3 0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch +b0bcfc837f888f2b1c2d65c06dcc0a2fa12da78986ba9c7c86a64123ce44c21a63c13c1cc2e93fdf564a3ca4472c29f0acabaff367914c52bf101d6d8a56ee2e 0003-fix-fmaf-wrong-result.patch +1fedaf691ac394dec3158cff7839e36383d4107b59f003b75c8fb85a5fceb2143e2bb4aae58c08d68ccdf02d5ebf8c9e5031fa6063aa5c3112b4f8c66adab3dd 0004-implement-wcsftime-padding-specifier-extensions.patch +6d7bbb493ccb7006270ace71266c0daf2c87842480f01cafb25609c9a3c77ae35934ee2a2bf00d78be8cce391204dcb9aba33e4d96dbf2a258595cf7a3939130 0005-fix-wrong-result-in-casin-and-many-related-complex-f.patch 26465058345bcb0d8f5ebd4645b43b2cb3dec26ac55f8cb97a13961f28046fe04bd68e48ba585cc3c036ba75e3cabadf096595e71d1c8c9ec0fb69ebc8340cf5 1000-cloudflare-stupidity.patch 2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch -8909dc260968770ace8f3ffdc04c6c7d20933ff115b4fa3e512fb7460860a8216c73ca7a7ad54f59cb5988ef011f02bf18aa13cc2287cc64ffdb8db84ef69d47 complex-math.patch 6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch 8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c |