diff options
-rw-r--r-- | system/musl/APKBUILD | 10 | ||||
-rw-r--r-- | system/musl/amalgamation.patch | 42 | ||||
-rw-r--r-- | system/musl/signed-wchar_t-fixes.patch | 77 |
3 files changed, 21 insertions, 108 deletions
diff --git a/system/musl/APKBUILD b/system/musl/APKBUILD index 9816d009e..2522deed5 100644 --- a/system/musl/APKBUILD +++ b/system/musl/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: A. Wilcox <awilfox@adelielinux.org> pkgname=musl -pkgver=1.2.3 -pkgrel=1 +pkgver=1.2.4 +pkgrel=0 pkgdesc="System library (libc) implementation" url="https://www.musl-libc.org/" arch="all" @@ -27,7 +27,6 @@ source="https://musl.libc.org/releases/musl-${pkgver}.tar.gz handle-aux-at_base.patch fgetspent_r.patch realpath.patch - signed-wchar_t-fixes.patch ldconfig getent.c @@ -120,13 +119,12 @@ utils() { install -D -m755 "$srcdir"/ldconfig "$subpkgdir"/sbin } -sha512sums="9332f713d3eb7de4369bc0327d99252275ee52abf523ee34b894b24a387f67579787f7c72a46cf652e090cffdb0bc3719a4e7b84dca66890b6a37f12e8ad089c musl-1.2.3.tar.gz -f7b05d8c5f804ba3ad6998b3de5fa4d9dfceac4aca63dd67298c2d5f27cdd28a91eba74f6e428c258323da80635dd333bae2c47ff918894797cba92bd5700909 amalgamation.patch +sha512sums="498ec5d7941194a8806f4d42f0f6d218c862996ef1398b737d0d06995e0b7a6574b240a48088f6b84016b14b2776fe463f829dcb11149cdfc1023d496b235c55 musl-1.2.4.tar.gz +bf0a6623203b8665ac466746f790fc8ca8c3cdc7a39be127363cc270d88410c844d20d6d72bd44b19119ec52afb2573df2304dc6cebe987c4b1e3b461e59e5a0 amalgamation.patch 88ae443dbb8e0a4368235bdc3a1c5c7b718495afa75e06deb8e01becc76cb1f0d6964589e2204fc749c9c1b3190b8b9ac1ae2c0099cab8e2ce3ec877103d4332 3001-make-real-lastlog-h.patch 1f4e9aea5a546015c75f77aa0dec10d56fc14831ccc15cf71ff27fc15ac5230ffeadb382ebe1c87c1ea07a462620e16ed01cd36252d997d1a9c2af11cb5c9ff3 handle-aux-at_base.patch ded41235148930f8cf781538f7d63ecb0c65ea4e8ce792565f3649ee2523592a76b2a166785f0b145fc79f5852fd1fb1729a7a09110b3b8f85cba3912e790807 fgetspent_r.patch d5ec3f1a86f2194e0af83c2391508811b939d0f8f2fd2ac5ac7f03774f8a250ce42399110d2ae04d32b864ee292863fed683a029b64598dbbcb21d9811a825d0 realpath.patch -3770af3bc961e5d5b8c152c428cd20dc54e026b23b31d764fbc2e71ee38140d160db2267755f23800bc8586fd4b51554b1caebb2415bef82fd0f4a6dd8bf640d signed-wchar_t-fixes.patch cb71d29a87f334c75ecbc911becde7be825ab30d8f39fa6d64cb53812a7c9abaf91d9804c72540e5be3ddd3c84cfe7fd9632274309005cb8bcdf9a9b09b4b923 ldconfig 378d70e65bcc65bb4e1415354cecfa54b0c1146dfb24474b69e418cdbf7ad730472cd09f6f103e1c99ba6c324c9560bccdf287f5889bbc3ef0bdf0e08da47413 getent.c 9d42d66fb1facce2b85dad919be5be819ee290bd26ca2db00982b2f8e055a0196290a008711cbe2b18ec9eee8d2270e3b3a4692c5a1b807013baa5c2b70a2bbf iconv.c" diff --git a/system/musl/amalgamation.patch b/system/musl/amalgamation.patch index 5e273ce7f..0e46ee131 100644 --- a/system/musl/amalgamation.patch +++ b/system/musl/amalgamation.patch @@ -8,7 +8,7 @@ index e9ca94cb..b39b12ee 100644 #include <time.h> #include <errno.h> diff --git a/include/stdlib.h b/include/stdlib.h -index b507ca33..5e14b07c 100644 +index 475190bf..6ac26741 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -41,14 +41,18 @@ void *malloc (size_t); @@ -91,10 +91,10 @@ index 3d948372..deb4a450 100644 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) diff --git a/include/unistd.h b/include/unistd.h -index ee2dbe8a..ed75e578 100644 +index 5bc7f798..e6bf2ca7 100644 --- a/include/unistd.h +++ b/include/unistd.h -@@ -35,16 +35,23 @@ extern "C" { +@@ -37,16 +37,23 @@ extern "C" { #include <bits/alltypes.h> int pipe(int [2]); @@ -121,7 +121,7 @@ index ee2dbe8a..ed75e578 100644 ssize_t read(int, void *, size_t); ssize_t write(int, const void *, size_t); ssize_t pread(int, void *, size_t, off_t); -@@ -206,8 +213,6 @@ pid_t gettid(void); +@@ -208,8 +215,6 @@ pid_t gettid(void); #define off64_t off_t #endif @@ -130,7 +130,7 @@ index ee2dbe8a..ed75e578 100644 #define _XOPEN_VERSION 700 #define _XOPEN_UNIX 1 #define _XOPEN_ENH_I18N 1 -@@ -280,6 +285,7 @@ pid_t gettid(void); +@@ -282,6 +287,7 @@ pid_t gettid(void); #define _PC_ALLOC_SIZE_MIN 18 #define _PC_SYMLINK_MAX 19 #define _PC_2_SYMLINKS 20 @@ -138,38 +138,27 @@ index ee2dbe8a..ed75e578 100644 #define _SC_ARG_MAX 0 #define _SC_CHILD_MAX 1 -@@ -423,6 +429,7 @@ pid_t gettid(void); - #define _SC_XOPEN_STREAMS 246 - #define _SC_THREAD_ROBUST_PRIO_INHERIT 247 +@@ -427,6 +433,7 @@ pid_t gettid(void); #define _SC_THREAD_ROBUST_PRIO_PROTECT 248 -+#define _SC_XOPEN_UUCP 249 + #define _SC_MINSIGSTKSZ 249 + #define _SC_SIGSTKSZ 250 ++#define _SC_XOPEN_UUCP 251 #define _CS_PATH 0 #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1 -@@ -465,6 +472,8 @@ pid_t gettid(void); - #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147 - #define _CS_V6_ENV 1148 - #define _CS_V7_ENV 1149 -+#define _CS_POSIX_V7_THREADS_CFLAGS 1150 -+#define _CS_POSIX_V7_THREADS_LDFLAGS 1151 - - #ifdef __cplusplus - } diff --git a/src/conf/confstr.c b/src/conf/confstr.c -index 02cb1aa2..8f870a69 100644 +index 3d417284..8f870a69 100644 --- a/src/conf/confstr.c +++ b/src/conf/confstr.c -@@ -6,8 +6,8 @@ size_t confstr(int name, char *buf, size_t len) +@@ -6,7 +6,7 @@ size_t confstr(int name, char *buf, size_t len) { const char *s = ""; if (!name) { - s = "/bin:/usr/bin"; -- } else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>33U) { + s = "/usr/5bin:/usr/bin:/bin"; -+ } else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>35U) { + } else if ((name&~4U)!=1 && name-_CS_POSIX_V6_ILP32_OFF32_CFLAGS>35U) { errno = EINVAL; return 0; - } diff --git a/src/conf/fpathconf.c b/src/conf/fpathconf.c index e6aca5cf..83e47e87 100644 --- a/src/conf/fpathconf.c @@ -196,13 +185,16 @@ index e6aca5cf..83e47e87 100644 if (name >= sizeof(values)/sizeof(values[0])) { errno = EINVAL; diff --git a/src/conf/sysconf.c b/src/conf/sysconf.c -index 3baaed32..04369596 100644 +index 60d3e745..20d91de7 100644 --- a/src/conf/sysconf.c +++ b/src/conf/sysconf.c -@@ -165,6 +165,7 @@ long sysconf(int name) +@@ -168,9 +168,9 @@ long sysconf(int name) [_SC_XOPEN_STREAMS] = JT_ZERO, [_SC_THREAD_ROBUST_PRIO_INHERIT] = -1, [_SC_THREAD_ROBUST_PRIO_PROTECT] = -1, +- + [_SC_MINSIGSTKSZ] = JT_MINSIGSTKSZ, + [_SC_SIGSTKSZ] = JT_SIGSTKSZ, + [_SC_XOPEN_UUCP] = -1, }; diff --git a/system/musl/signed-wchar_t-fixes.patch b/system/musl/signed-wchar_t-fixes.patch deleted file mode 100644 index 0d5309315..000000000 --- a/system/musl/signed-wchar_t-fixes.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 99b84a793669c69acc705a61d339441b50bd09a8 Mon Sep 17 00:00:00 2001
-From: Gabriel Ravier <gabravier@gmail.com>
-Date: Wed, 4 Jan 2023 16:07:19 +0100
-Subject: [PATCH] fix return value of wcs{,n}cmp for near-limits signed wchar_t values
-
-The standard states that:
-
- > Unless explicitly stated otherwise, the functions described in
- this subclause order two wide characters the same way as two
- integers of the underlying integer type designated by `wchar_t`.
- > [...]
- > The `wcscmp` function returns an integer greater than, equal to,
- or less than zero, accordingly as the wide string pointed to by s1
- is greater than, equal to, or less than the wide string pointed to
- by s2.
- > The `wcsncmp` function returns an integer greater than, equal to,
- or less than zero, accordingly as the possibly null-terminated
- array pointed to by s1 is greater than, equal to, or less than the
- possibly null-terminated array pointed to by s2
- - N3047 (latest C draft as of the time of writing)
-
-Yet a simple test program such as this:
-
- #include <wchar.h>
- #include <stdio.h>
-
- int main()
- {
- wchar_t str1[2] = { WCHAR_MAX, L'\0' };
- wchar_t str2[2] = { WCHAR_MIN, L'\0' };
-
- printf("%d\n", wcscmp(str1, str2));
- printf("%d\n", wcsncmp(str1, str2, 1));
- }
-
-Will fail to run correctly according to this specification on musl (on
-targets that have signed wchar_t), as it will print -1 instead of
-1 (it should print 1, since WCHAR_MAX > WCHAR_MIN).
-
-This appears to be due to the fact that musl uses a simple subtraction
-to implement wcscmp and wcsncmp, which may result in an overflow.
-
-This patch fixes this by replacing the subtraction with a little bit
-of code that orders the characters correctly, returning -1 if the
-character from the first string is smaller than the one from the
-second, 0 if they are equal and 1 if the character from the first
-string is larger than the one from the second
----
- src/string/wcscmp.c | 2 +-
- src/string/wcsncmp.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/string/wcscmp.c b/src/string/wcscmp.c
-index 26eeee70..286ec3ea 100644
---- a/src/string/wcscmp.c
-+++ b/src/string/wcscmp.c
-@@ -3,5 +3,5 @@
- int wcscmp(const wchar_t *l, const wchar_t *r)
- {
- for (; *l==*r && *l && *r; l++, r++);
-- return *l - *r;
-+ return *l < *r ? -1 : *l > *r;
- }
-diff --git a/src/string/wcsncmp.c b/src/string/wcsncmp.c
-index 4ab32a92..2b3558bf 100644
---- a/src/string/wcsncmp.c
-+++ b/src/string/wcsncmp.c
-@@ -3,5 +3,5 @@
- int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n)
- {
- for (; n && *l==*r && *l && *r; n--, l++, r++);
-- return n ? *l - *r : 0;
-+ return n ? (*l < *r ? -1 : *l > *r) : 0;
- }
---
-2.38.1
-
|