summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-04-18 03:54:24 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-04-18 03:54:24 -0500
commit752c72a485371af594aa449521439c70e60ecf75 (patch)
treed898b674b1d434cde2dbbc8a8141b4dc8ab87d22
parent1b9fbd9e522f06d229a6016e4d045ac0de946266 (diff)
downloadpackages-752c72a485371af594aa449521439c70e60ecf75.tar.gz
packages-752c72a485371af594aa449521439c70e60ecf75.tar.bz2
packages-752c72a485371af594aa449521439c70e60ecf75.tar.xz
packages-752c72a485371af594aa449521439c70e60ecf75.zip
system/musl: more POSIX
-rw-r--r--system/musl/0001-sysconf-Add-_SC_XOPEN_UUCP.patch2
-rw-r--r--system/musl/0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch2
-rw-r--r--system/musl/0003-pathconf-add-_PC_TIMESTAMP_RESOLUTION.patch23
-rw-r--r--system/musl/0004-stdlib-Move-mkostemp-to-_GNU_SOURCE-_BSD_SOURCE.patch33
-rw-r--r--system/musl/0005-stdlib-Ensure-C11-fns-are-only-visible-in-C11.patch38
-rw-r--r--system/musl/0006-time-C11-visibility-fixes.patch51
-rw-r--r--system/musl/0007-abort-raise-SIGABRT-again-if-signal-is-ignored.patch55
-rw-r--r--system/musl/APKBUILD16
8 files changed, 210 insertions, 10 deletions
diff --git a/system/musl/0001-sysconf-Add-_SC_XOPEN_UUCP.patch b/system/musl/0001-sysconf-Add-_SC_XOPEN_UUCP.patch
index 67da315b6..d792ede57 100644
--- a/system/musl/0001-sysconf-Add-_SC_XOPEN_UUCP.patch
+++ b/system/musl/0001-sysconf-Add-_SC_XOPEN_UUCP.patch
@@ -1,7 +1,7 @@
From 6f592a7812de3190f567174bbb4baa40790831dd Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Wed, 11 Apr 2018 23:22:33 -0500
-Subject: [PATCH 1/2] sysconf: Add _SC_XOPEN_UUCP
+Subject: [PATCH 1/7] sysconf: Add _SC_XOPEN_UUCP
We definitely don't /support/ UUCP, so return -1 for it.
But this value is required to be present in <unistd.h>.
diff --git a/system/musl/0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch b/system/musl/0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch
index ab1203cca..cd253b993 100644
--- a/system/musl/0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch
+++ b/system/musl/0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch
@@ -1,7 +1,7 @@
From 94046871d24d5408adaf61941a4751c77abe06b6 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Wed, 11 Apr 2018 23:23:31 -0500
-Subject: [PATCH 2/2] confstr: Add _CS_POSIX_V7_THREADS_*
+Subject: [PATCH 2/7] confstr: Add _CS_POSIX_V7_THREADS_*
This is used to determine what CFLAGS/LDFLAGS are needed to enable
compilation with threads on musl. We don't have any special ones, so
diff --git a/system/musl/0003-pathconf-add-_PC_TIMESTAMP_RESOLUTION.patch b/system/musl/0003-pathconf-add-_PC_TIMESTAMP_RESOLUTION.patch
index 33b0d2379..21958a650 100644
--- a/system/musl/0003-pathconf-add-_PC_TIMESTAMP_RESOLUTION.patch
+++ b/system/musl/0003-pathconf-add-_PC_TIMESTAMP_RESOLUTION.patch
@@ -1,7 +1,7 @@
-From da7bab19d59a0ea50e23371462f688329cd6c1a7 Mon Sep 17 00:00:00 2001
+From 1d486ac55014c39f225f12bac80202197c2bf9c6 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Wed, 11 Apr 2018 23:43:19 -0500
-Subject: [PATCH 3/3] pathconf: add _PC_TIMESTAMP_RESOLUTION
+Subject: [PATCH 3/7] pathconf: add _PC_TIMESTAMP_RESOLUTION
Right now, this is a worst-case assumption; some kernels may actually
have a value of 100000 here (100 Hz timers). This is considered the
@@ -9,8 +9,9 @@ easiest implementation.
This is required to be present in <unistd.h>.
---
- include/unistd.h | 1 +
- 1 file changed, 1 insertion(+)
+ include/unistd.h | 1 +
+ src/conf/fpathconf.c | 3 ++-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/unistd.h b/include/unistd.h
index 68686dfd..1bdd3292 100644
@@ -24,6 +25,20 @@ index 68686dfd..1bdd3292 100644
#define _SC_ARG_MAX 0
#define _SC_CHILD_MAX 1
+diff --git a/src/conf/fpathconf.c b/src/conf/fpathconf.c
+index 8eb037e6..1eefac18 100644
+--- a/src/conf/fpathconf.c
++++ b/src/conf/fpathconf.c
+@@ -25,7 +25,8 @@ long fpathconf(int fd, int name)
+ [_PC_REC_XFER_ALIGN] = 4096,
+ [_PC_ALLOC_SIZE_MIN] = 4096,
+ [_PC_SYMLINK_MAX] = SYMLINK_MAX,
+- [_PC_2_SYMLINKS] = 1
++ [_PC_2_SYMLINKS] = 1,
++ [_PC_TIMESTAMP_RESOLUTION] = 1000000,
+ };
+ if (name >= sizeof(values)/sizeof(values[0])) {
+ errno = EINVAL;
--
2.15.0
diff --git a/system/musl/0004-stdlib-Move-mkostemp-to-_GNU_SOURCE-_BSD_SOURCE.patch b/system/musl/0004-stdlib-Move-mkostemp-to-_GNU_SOURCE-_BSD_SOURCE.patch
new file mode 100644
index 000000000..9814ba4eb
--- /dev/null
+++ b/system/musl/0004-stdlib-Move-mkostemp-to-_GNU_SOURCE-_BSD_SOURCE.patch
@@ -0,0 +1,33 @@
+From 3e9758004c131236d53e5fdca4bbeea7bf7efc28 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Tue, 17 Apr 2018 20:52:39 -0500
+Subject: [PATCH 4/7] stdlib: Move mkostemp to _GNU_SOURCE/_BSD_SOURCE
+
+This is not a POSIX function, it should not be visible there.
+---
+ include/stdlib.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/stdlib.h b/include/stdlib.h
+index 42ca8336..d1f99fe1 100644
+--- a/include/stdlib.h
++++ b/include/stdlib.h
+@@ -100,7 +100,6 @@ int posix_memalign (void **, size_t, size_t);
+ int setenv (const char *, const char *, int);
+ int unsetenv (const char *);
+ int mkstemp (char *);
+-int mkostemp (char *, int);
+ char *mkdtemp (char *);
+ int getsubopt (char **, char *const *, char **);
+ int rand_r (unsigned *);
+@@ -138,6 +137,7 @@ void lcong48 (unsigned short [7]);
+ #include <alloca.h>
+ char *mktemp (char *);
+ int mkstemps (char *, int);
++int mkostemp (char *, int);
+ int mkostemps (char *, int, int);
+ void *valloc (size_t);
+ void *memalign(size_t, size_t);
+--
+2.15.0
+
diff --git a/system/musl/0005-stdlib-Ensure-C11-fns-are-only-visible-in-C11.patch b/system/musl/0005-stdlib-Ensure-C11-fns-are-only-visible-in-C11.patch
new file mode 100644
index 000000000..53235e0dd
--- /dev/null
+++ b/system/musl/0005-stdlib-Ensure-C11-fns-are-only-visible-in-C11.patch
@@ -0,0 +1,38 @@
+From 36e0a4286937ccb25bc78392a679f496029765b0 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Tue, 17 Apr 2018 20:54:59 -0500
+Subject: [PATCH 5/7] stdlib: Ensure C11 fns are only visible in C11
+
+aligned_alloc, at_quick_exit, and quick_exit are new in C11 and C++11.
+Only make these symbols visible in those versions, to avoid polluting
+the namespace of C99 and POSIX 2008 sources.
+---
+ include/stdlib.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/include/stdlib.h b/include/stdlib.h
+index d1f99fe1..4bbaded0 100644
+--- a/include/stdlib.h
++++ b/include/stdlib.h
+@@ -39,14 +39,18 @@ void *malloc (size_t);
+ void *calloc (size_t, size_t);
+ void *realloc (void *, size_t);
+ void free (void *);
++#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
+ void *aligned_alloc(size_t, size_t);
++#endif
+
+ _Noreturn void abort (void);
+ int atexit (void (*) (void));
+ _Noreturn void exit (int);
+ _Noreturn void _Exit (int);
++#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
+ int at_quick_exit (void (*) (void));
+ _Noreturn void quick_exit (int);
++#endif
+
+ char *getenv (const char *);
+
+--
+2.15.0
+
diff --git a/system/musl/0006-time-C11-visibility-fixes.patch b/system/musl/0006-time-C11-visibility-fixes.patch
new file mode 100644
index 000000000..5252611b5
--- /dev/null
+++ b/system/musl/0006-time-C11-visibility-fixes.patch
@@ -0,0 +1,51 @@
+From 0979c50b831c67e0b4f4a560435b867b35cdac67 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Tue, 17 Apr 2018 21:03:15 -0500
+Subject: [PATCH 6/7] time: C11 visibility fixes
+
+The timespec_get function, and TIME_* macros, are only in C11.
+
+Since musl is compiled with -std=c99, TIME_UTC is unavailable in the
+timespec_get implementation, so we use the raw value 1.
+---
+ include/time.h | 7 +++++--
+ src/time/timespec_get.c | 2 +-
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/include/time.h b/include/time.h
+index 672b3fc3..c5946dd0 100644
+--- a/include/time.h
++++ b/include/time.h
+@@ -58,11 +58,14 @@ struct tm *gmtime (const time_t *);
+ struct tm *localtime (const time_t *);
+ char *asctime (const struct tm *);
+ char *ctime (const time_t *);
+-int timespec_get(struct timespec *, int);
+
+-#define CLOCKS_PER_SEC 1000000L
++#if __STDC_VERSION__ >= 201112L
++int timespec_get(struct timespec *, int);
+
+ #define TIME_UTC 1
++#endif
++
++#define CLOCKS_PER_SEC 1000000L
+
+ #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
+diff --git a/src/time/timespec_get.c b/src/time/timespec_get.c
+index 03c5a77b..c423b825 100644
+--- a/src/time/timespec_get.c
++++ b/src/time/timespec_get.c
+@@ -6,7 +6,7 @@ int __clock_gettime(clockid_t, struct timespec *);
+ * are considered erroneous. */
+ int timespec_get(struct timespec * ts, int base)
+ {
+- if (base != TIME_UTC) return 0;
++ if (base != 1) return 0;
+ int ret = __clock_gettime(CLOCK_REALTIME, ts);
+ return ret < 0 ? 0 : base;
+ }
+--
+2.15.0
+
diff --git a/system/musl/0007-abort-raise-SIGABRT-again-if-signal-is-ignored.patch b/system/musl/0007-abort-raise-SIGABRT-again-if-signal-is-ignored.patch
new file mode 100644
index 000000000..4ab303c7d
--- /dev/null
+++ b/system/musl/0007-abort-raise-SIGABRT-again-if-signal-is-ignored.patch
@@ -0,0 +1,55 @@
+From 1316aae0c862240ff58b1cf38c92cd8cefd02a91 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Tue, 17 Apr 2018 22:08:48 -0500
+Subject: [PATCH 7/7] abort: raise SIGABRT again if signal is ignored
+
+POSIX requires that abort() gives the SIGABRT status to waitpid(3) and
+friends. If a signal handler is installed, and erroneously returns,
+then the status given to waitpid(3) is SIGSEGV instead of SIGABRT.
+
+This change gives another opportunity for the proper SIGABRT status to
+be given to any process monitoring this one's process, before we fall
+back to a_crash(), which should be sufficient.
+---
+ src/exit/abort.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/src/exit/abort.c b/src/exit/abort.c
+index ecc0f735..5e5a87c3 100644
+--- a/src/exit/abort.c
++++ b/src/exit/abort.c
+@@ -1,13 +1,31 @@
+ #include <stdlib.h>
+ #include <signal.h>
++#include <string.h>
+ #include "syscall.h"
+ #include "pthread_impl.h"
+ #include "atomic.h"
+
+ _Noreturn void abort(void)
+ {
++ struct sigaction abrtaction;
++ sigset_t abrtset;
++
+ raise(SIGABRT);
+ __block_all_sigs(0);
++
++ /* Unblock just SIGABRT, and set default handler */
++ sigemptyset(&abrtset);
++ sigaddset(&abrtset, SIGABRT);
++ sigprocmask(SIG_UNBLOCK, &abrtset, 0);
++
++ memset(&abrtaction, 0, sizeof(struct sigaction));
++ abrtaction.sa_handler = SIG_DFL;
++
++ sigaction(SIGABRT, &abrtaction, NULL);
++
++ raise(SIGABRT);
++
++ /* Ok, give up. */
+ a_crash();
+ raise(SIGKILL);
+ _Exit(127);
+--
+2.15.0
+
diff --git a/system/musl/APKBUILD b/system/musl/APKBUILD
index 25c93f361..3e1df3eef 100644
--- a/system/musl/APKBUILD
+++ b/system/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.1.19
-pkgrel=3
+pkgrel=4
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -21,6 +21,10 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
0001-sysconf-Add-_SC_XOPEN_UUCP.patch
0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch
0003-pathconf-add-_PC_TIMESTAMP_RESOLUTION.patch
+ 0004-stdlib-Move-mkostemp-to-_GNU_SOURCE-_BSD_SOURCE.patch
+ 0005-stdlib-Ensure-C11-fns-are-only-visible-in-C11.patch
+ 0006-time-C11-visibility-fixes.patch
+ 0007-abort-raise-SIGABRT-again-if-signal-is-ignored.patch
2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
complex-math.patch
@@ -146,9 +150,13 @@ compat() {
}
sha512sums="abee52d53af4b3c14c9088866c911a24d2b6ef67dc494f38a7a09dfe77250026f77528c24c52469c89cffa8ced2f0fa95badbdcf8d4460c90faba47e3927bcc5 musl-1.1.19.tar.gz
-f274b1c3fff40494e44e68d5385d6f117bac43a10272e1415ed11d65f937e8c34639128860cff451357614a417bb9535a1c676be65a50dd33225c34f249dd4ff 0001-sysconf-Add-_SC_XOPEN_UUCP.patch
-e6d7ba709a53cfefb9b5fbb4ede3bde6926504e24d5111691e4a63d15085c0e6e896a3d2df84026fad9520e08b2d98a3be901f29ee47df0bd8c58f6a34ebc49f 0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch
-7981521fd3aed5c6b4d6798717945ebe30de83ef327c8c6da135e6e7793f4be533833b1ff87cb25c8646c019da127e73da9adccdc7cf1f91a1ba1b60387a9e91 0003-pathconf-add-_PC_TIMESTAMP_RESOLUTION.patch
+801e0d8adf1ca3bec1c35ce4fe319be7ce7776967630ec27fea39c896dd0e26f047cae34d1b2702e730815789cdc6bd4df526e9078bf68294bcef35a94c498b1 0001-sysconf-Add-_SC_XOPEN_UUCP.patch
+5b648ebfdff20f56c6b82b19361a0045a59be8dfef08f8c37f44e0f780ced5e7f3c4fcee12bb25b0cee62edf8c939bc60530550b4a8fcc2c3b1f40c1744f6307 0002-confstr-Add-_CS_POSIX_V7_THREADS_.patch
+4ddfdc5ca9d2f86b0ac278e70155c5fd64ba5b012423de89f8c7e07be42ad02a0a965e915c6ce4e139345c981f0103bdd0145f7d732508aba7e8bddd42541c66 0003-pathconf-add-_PC_TIMESTAMP_RESOLUTION.patch
+fb7ea456de9cd7cf36be8bc9fdd4e142c999758b1cf4ee93720724985f256ae80f4f426ced3ac5f732d1d9f4048993a017469b6755807da0231f08d5e0e8a467 0004-stdlib-Move-mkostemp-to-_GNU_SOURCE-_BSD_SOURCE.patch
+e99dab95932c0c03d67da0248d63b71581050efed40c5e58b28e226925f6f436b6e7ddfbf03dc83ef4cabead2c9a6bd55a30e09c7ee250ef3482ac5206eb309b 0005-stdlib-Ensure-C11-fns-are-only-visible-in-C11.patch
+d0d0817a4e1d57b74cb442a3bf8d8efe39a23a387275b75cba1b2fa354d8a7dc2fd843b5b67584aac86ec97ea394d602ec013c6e8a65da309915b0a80b4a8f98 0006-time-C11-visibility-fixes.patch
+6f5f9b5fb5eba638b0d98c68c280dbcc2bdae58d94d9f6966f5de55f6dd5d7f3cdddd9ca758e8861e30841b80ba616a945fb2b885a31481707d578293b187ff0 0007-abort-raise-SIGABRT-again-if-signal-is-ignored.patch
2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
8909dc260968770ace8f3ffdc04c6c7d20933ff115b4fa3e512fb7460860a8216c73ca7a7ad54f59cb5988ef011f02bf18aa13cc2287cc64ffdb8db84ef69d47 complex-math.patch
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch