Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] musl
@ 2023-03-29 19:35 dkwo
  2023-03-29 19:36 ` musl dkwo
                   ` (12 more replies)
  0 siblings, 13 replies; 34+ messages in thread
From: dkwo @ 2023-03-29 19:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

There is a new pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl
- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along lines of https://github.com/void-linux/xbps/pull/331

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 68358 bytes --]

From 48d3ce47fd98df32f9f7d01b9e24ac2d55171930 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 01/17] musl: update to 1.2.3

---
 common/shlibs                                 |   2 +-
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   8 +-
 24 files changed, 31 insertions(+), 1221 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index ba99e3a7c99b..c70d2579a05f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -16,7 +16,7 @@
 # PLEASE NOTE: when multiple packages provide the same SONAME, the first
 # one (order top->bottom) is preferred over the next ones.
 #
-libc.so musl-1.1.24_7
+libc.so musl-1.2.3_1
 libc.so.6 glibc-2.36_1
 libm.so.6 glibc-2.36_1
 libpthread.so.0 glibc-2.36_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89a..000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 000000000000..1ca36263691c
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e3..000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a6..000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d950195..000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c5..000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce..000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f..000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e5..000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d4..000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8e..000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f9..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f8..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b88..000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd..000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188f..000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c70..000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f..000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d..000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f..000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea2..000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index c77cc2b6c405..7179b43b3f5a 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=15
+version=1.2.3
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"
@@ -24,6 +23,7 @@ post_build() {
 	$CC $CFLAGS $LDFLAGS -fpie -c ${FILESDIR}/__stack_chk_fail_local.c -o __stack_chk_fail_local.o
 	$AR r libssp_nonshared.a __stack_chk_fail_local.o
 }
+
 do_install() {
 	# Move everything to /usr.
 	vmkdir usr/lib

From f3b4801a2a9d7a3d273c7009c45f4924b454eaca Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 02/17] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index e6f1684ed370..793eb533d2a7 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=2
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.3_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From 29975ee98bb18dda01daf2956d821ce0911938cb Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 03/17] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca960..56101385c4f7 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.3_1";;
 	*) depends+=" glibc-devel";;
 esac

From bbf76ee5bde6ae8426bc7ab101a30f19b94321c8 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:03 -0400
Subject: [PATCH 04/17] cross-aarch64-linux-musl: bump musl version

---
 srcpkgs/cross-aarch64-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index 8038b28d70ad..f3605552569d 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"

From 18f9b5ef8f3c32c9f48315fbb9c8c76dcea38a91 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:04 -0400
Subject: [PATCH 05/17] cross-arm-linux-musleabi: bump musl version

---
 srcpkgs/cross-arm-linux-musleabi/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index ee59931d6d93..7ca19a89156a 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"

From 9e8e7ea45376ee3940d52c3207aa507a265727a2 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:04 -0400
Subject: [PATCH 06/17] cross-arm-linux-musleabihf: bump musl version

---
 srcpkgs/cross-arm-linux-musleabihf/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 333db95425dd..d02b609153dd 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"

From 9601e740e26d61ad84be6b8be34edf99f82450fc Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:04 -0400
Subject: [PATCH 07/17] cross-armv7l-linux-musleabihf: bump musl version

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 3c4ea2357661..c68615fe171d 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"

From 7985ed5ae0489fa3f24b0e1569013e7eb5f21887 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:05 -0400
Subject: [PATCH 08/17] cross-i686-linux-musl: bump musl version

---
 srcpkgs/cross-i686-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 6dc3fdcba07a..339cf43f25fa 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-i686-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel

From 451716c33a1e5d2aaf81a98100048db071ea7750 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:05 -0400
Subject: [PATCH 09/17] cross-mipsel-linux-musl: bump musl version

---
 srcpkgs/cross-mipsel-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 23247d5bc972..1d53290bdeb0 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"

From 0df89a5a1ce30e1cbcd3880f3de971eca45a3358 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:05 -0400
Subject: [PATCH 10/17] cross-mipsel-linux-muslhf: bump musl version

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 8cc208c7e86d..3ea2804b1911 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"

From 5ade3e7499495769154948c50383900387bb00ac Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:06 -0400
Subject: [PATCH 11/17] cross-mips-linux-musl: bump musl version

---
 srcpkgs/cross-mips-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index f783961d70d2..7ce96a730eb4 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"

From 315c036f434a2b9d5beaa8be537a85b4e5f2f9f1 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:06 -0400
Subject: [PATCH 12/17] cross-mips-linux-muslhf: bump musl version

---
 srcpkgs/cross-mips-linux-muslhf/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index fe41bc80d808..6b5e9363c9ec 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"

From a20ad86865b1942945d8c17a1d680c6f5f8fe4ab Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:06 -0400
Subject: [PATCH 13/17] cross-powerpc64le-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index a863233b5b32..797831b78e12 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"

From f1b2c825ab1884bbbb169231f8e55cddf4ad6a5b Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:07 -0400
Subject: [PATCH 14/17] cross-powerpc64-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index b081a136ef29..3a77ba4f4423 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"

From 3f426ce9cbd25687ac8d5f5a59584795110c8ef4 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:07 -0400
Subject: [PATCH 15/17] cross-powerpcle-linux-musl: bump musl version

---
 srcpkgs/cross-powerpcle-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 2f483e1f1ee5..5a0e54741db8 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"

From b2a952c348a824d394dae8f23adde273eb6314c3 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:07 -0400
Subject: [PATCH 16/17] cross-powerpc-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index e06970d76b9e..60e3c5847b9d 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"

From a66d6370652eb05155e2dc4fcf9ec5509111a3d4 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:08 -0400
Subject: [PATCH 17/17] cross-x86_64-linux-musl: bump musl version

---
 srcpkgs/cross-x86_64-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 4984cd77f149..93a1c378813f 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2023-03-29 19:35 [PR PATCH] musl dkwo
@ 2023-03-29 19:36 ` dkwo
  2023-03-29 19:57 ` [PR PATCH] [Updated] musl dkwo
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-03-29 19:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43106#issuecomment-1489191432

Comment:
ref for self:
```
for a in cross-aarch64-linux-musl cross-arm-linux-musleabi cross-arm-linux-musleabihf cross-armv7l-linux-musleabihf cross-i686-linux-musl cross-mipsel-linux-musl cross-mipsel-linux-muslhf cross-mips-linux-musl cross-mips-linux-muslhf cross-powerpc64le-linux-musl cross-powerpc64-linux-musl cross-powerpcle-linux-musl cross-powerpc-linux-musl cross-x86_64-linux-musl; do
	sed -i s/1.1.24/1.2.3/ srcpkgs/$a/template
	xrevbump "bump musl version" $a
done
```

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] musl
  2023-03-29 19:35 [PR PATCH] musl dkwo
  2023-03-29 19:36 ` musl dkwo
@ 2023-03-29 19:57 ` dkwo
  2023-03-29 20:04 ` musl dkwo
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-03-29 19:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl
- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along lines of https://github.com/void-linux/xbps/pull/331

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 75575 bytes --]

From e0ce77134b6bd49721003f1a073ac2394538de83 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 01/17] musl: update to 1.2.3

---
 common/shlibs                                 |   2 +-
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 srcpkgs/musl/patches/add-qsort_r.patch        | 201 ----------------
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   8 +-
 25 files changed, 31 insertions(+), 1422 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-qsort_r.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index 68c5f6e33a85..55aa40e000cd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -16,7 +16,7 @@
 # PLEASE NOTE: when multiple packages provide the same SONAME, the first
 # one (order top->bottom) is preferred over the next ones.
 #
-libc.so musl-1.1.24_7
+libc.so musl-1.2.3_1
 libc.so.6 glibc-2.36_1
 libm.so.6 glibc-2.36_1
 libpthread.so.0 glibc-2.36_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89a..000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 000000000000..1ca36263691c
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e3..000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a6..000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d950195..000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c5..000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce..000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f..000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e5..000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-qsort_r.patch b/srcpkgs/musl/patches/add-qsort_r.patch
deleted file mode 100644
index 3d85496afb69..000000000000
--- a/srcpkgs/musl/patches/add-qsort_r.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From b76f37fd5625d038141b52184956fb4b7838e9a5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
-Date: Tue, 9 Mar 2021 18:02:13 -0300
-Subject: [PATCH] add qsort_r and make qsort a wrapper around it
-
-we make qsort a wrapper by providing a wrapper_cmp function that uses
-the extra argument as a function pointer. should be optimized to a tail
-call on most architectures, as long as it's built with
--fomit-frame-pointer, so the performance impact should be minimal.
-
-to keep the git history clean, for now qsort_r is implemented in qsort.c
-and qsort is implemented in qsort_nr.c.  qsort.c also received a few
-trivial cleanups, including replacing (*cmp)() calls with cmp().
-qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
-itself.
----
- include/stdlib.h      |  1 +
- src/include/stdlib.h  |  1 +
- src/stdlib/qsort.c    | 37 ++++++++++++++++++++-----------------
- src/stdlib/qsort_nr.c | 14 ++++++++++++++
- 4 files changed, 36 insertions(+), 17 deletions(-)
- create mode 100644 src/stdlib/qsort_nr.c
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index b54a051fe..7af86e3bc 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -146,6 +146,7 @@ int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
- void *reallocarray (void *, size_t, size_t);
-+void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/include/stdlib.h b/src/include/stdlib.h
-index e9da20158..812b04de2 100644
---- a/src/include/stdlib.h
-+++ b/src/include/stdlib.h
-@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
- hidden int __mkostemps(char *, int, int);
- hidden int __ptsname_r(int, char *, size_t);
- hidden char *__randname(char *);
-+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- 
- hidden void *__libc_malloc(size_t);
- hidden void *__libc_malloc_impl(size_t);
-diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
-index da58fd317..314ddc29d 100644
---- a/src/stdlib/qsort.c
-+++ b/src/stdlib/qsort.c
-@@ -24,6 +24,7 @@
- /* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
-    Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
- 
-+#define _BSD_SOURCE
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -31,7 +32,7 @@
- #include "atomic.h"
- #define ntz(x) a_ctz_l((x))
- 
--typedef int (*cmpfun)(const void *, const void *);
-+typedef int (*cmpfun)(const void *, const void *, void *);
- 
- static inline int pntz(size_t p[2]) {
- 	int r = ntz(p[0] - 1);
-@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
- 	p[1] >>= n;
- }
- 
--static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
-+static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
- {
- 	unsigned char *rt, *lf;
- 	unsigned char *ar[14 * sizeof(size_t) + 1];
-@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 		rt = head - width;
- 		lf = head - width - lp[pshift - 2];
- 
--		if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
-+		if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
- 			break;
- 		}
--		if((*cmp)(lf, rt) >= 0) {
-+		if(cmp(lf, rt, arg) >= 0) {
- 			ar[i++] = lf;
- 			head = lf;
- 			pshift -= 1;
-@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 	cycle(width, ar, i);
- }
- 
--static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
-+static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
- {
- 	unsigned char *stepson,
- 	              *rt, *lf;
-@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	ar[0] = head;
- 	while(p[0] != 1 || p[1] != 0) {
- 		stepson = head - lp[pshift];
--		if((*cmp)(stepson, ar[0]) <= 0) {
-+		if(cmp(stepson, ar[0], arg) <= 0) {
- 			break;
- 		}
- 		if(!trusty && pshift > 1) {
- 			rt = head - width;
- 			lf = head - width - lp[pshift - 2];
--			if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
-+			if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
- 				break;
- 			}
- 		}
-@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	}
- 	if(!trusty) {
- 		cycle(width, ar, i);
--		sift(head, width, cmp, pshift, lp);
-+		sift(head, width, cmp, arg, pshift, lp);
- 	}
- }
- 
--void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
- {
- 	size_t lp[12*sizeof(size_t)];
- 	size_t i, size = width * nel;
-@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 
- 	while(head < high) {
- 		if((p[0] & 3) == 3) {
--			sift(head, width, cmp, pshift, lp);
-+			sift(head, width, cmp, arg, pshift, lp);
- 			shr(p, 2);
- 			pshift += 2;
- 		} else {
- 			if(lp[pshift - 1] >= high - head) {
--				trinkle(head, width, cmp, p, pshift, 0, lp);
-+				trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 			} else {
--				sift(head, width, cmp, pshift, lp);
-+				sift(head, width, cmp, arg, pshift, lp);
- 			}
--			
-+
- 			if(pshift == 1) {
- 				shl(p, 1);
- 				pshift = 0;
-@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 				pshift = 1;
- 			}
- 		}
--		
-+
- 		p[0] |= 1;
- 		head += width;
- 	}
- 
--	trinkle(head, width, cmp, p, pshift, 0, lp);
-+	trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 
- 	while(pshift != 1 || p[0] != 1 || p[1] != 0) {
- 		if(pshift <= 1) {
-@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 			pshift -= 2;
- 			p[0] ^= 7;
- 			shr(p, 1);
--			trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
-+			trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
- 			shl(p, 1);
- 			p[0] |= 1;
--			trinkle(head - width, width, cmp, p, pshift, 1, lp);
-+			trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
- 		}
- 		head -= width;
- 	}
- }
-+
-+weak_alias(__qsort_r, qsort_r);
-diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c
-new file mode 100644
-index 000000000..efe7ccecd
---- /dev/null
-+++ b/src/stdlib/qsort_nr.c
-@@ -0,0 +1,14 @@
-+#define _BSD_SOURCE
-+#include <stdlib.h>
-+
-+typedef int (*cmpfun)(const void *, const void *);
-+
-+static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
-+{
-+	return ((cmpfun)cmp)(v1, v2);
-+}
-+
-+void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+{
-+	__qsort_r(base, nel, width, wrapper_cmp, cmp);
-+}
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d4..000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8e..000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f9..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f8..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b88..000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd..000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188f..000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c70..000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f..000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d..000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f..000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea2..000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index c77cc2b6c405..7179b43b3f5a 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=15
+version=1.2.3
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"
@@ -24,6 +23,7 @@ post_build() {
 	$CC $CFLAGS $LDFLAGS -fpie -c ${FILESDIR}/__stack_chk_fail_local.c -o __stack_chk_fail_local.o
 	$AR r libssp_nonshared.a __stack_chk_fail_local.o
 }
+
 do_install() {
 	# Move everything to /usr.
 	vmkdir usr/lib

From e58899c106795c008307613e363ae3966624b63a Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 02/17] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index e6f1684ed370..793eb533d2a7 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=2
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.3_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From 749dcf8c1c2b4059dbd59c5709a20ab32edbc155 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 03/17] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca960..56101385c4f7 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.3_1";;
 	*) depends+=" glibc-devel";;
 esac

From f56499de4f689b6f382038d58aa0d3478e794009 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:03 -0400
Subject: [PATCH 04/17] cross-aarch64-linux-musl: bump musl version

---
 srcpkgs/cross-aarch64-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index 8038b28d70ad..f3605552569d 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"

From 0b9c72f5a450a0a263ce2dc93afbe45949a855e7 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:04 -0400
Subject: [PATCH 05/17] cross-arm-linux-musleabi: bump musl version

---
 srcpkgs/cross-arm-linux-musleabi/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index ee59931d6d93..7ca19a89156a 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"

From 1ce27378cdc883df35312f7c9e2a6a44af5be7ad Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:04 -0400
Subject: [PATCH 06/17] cross-arm-linux-musleabihf: bump musl version

---
 srcpkgs/cross-arm-linux-musleabihf/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 333db95425dd..d02b609153dd 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"

From a258c33edd8f364ec782a18bd78dee03a1374dae Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:04 -0400
Subject: [PATCH 07/17] cross-armv7l-linux-musleabihf: bump musl version

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 3c4ea2357661..c68615fe171d 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"

From 30d6ac8a6bb3178d0cc21ac76279a45bdc51a5d2 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:05 -0400
Subject: [PATCH 08/17] cross-i686-linux-musl: bump musl version

---
 srcpkgs/cross-i686-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 6dc3fdcba07a..339cf43f25fa 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-i686-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel

From 5a19f7fc9e9ffe20ed4c81fbfc97ae04bc16fdb6 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:05 -0400
Subject: [PATCH 09/17] cross-mipsel-linux-musl: bump musl version

---
 srcpkgs/cross-mipsel-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 23247d5bc972..1d53290bdeb0 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"

From 74339785a23d97591e828bc88ba5e253f402a9ec Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:05 -0400
Subject: [PATCH 10/17] cross-mipsel-linux-muslhf: bump musl version

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 8cc208c7e86d..3ea2804b1911 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"

From 24950a31d81a734240a62ce431ff773424bc4d46 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:06 -0400
Subject: [PATCH 11/17] cross-mips-linux-musl: bump musl version

---
 srcpkgs/cross-mips-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index f783961d70d2..7ce96a730eb4 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"

From 153805b34678345e7eef78eba250639d06b9c8c8 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:06 -0400
Subject: [PATCH 12/17] cross-mips-linux-muslhf: bump musl version

---
 srcpkgs/cross-mips-linux-muslhf/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index fe41bc80d808..6b5e9363c9ec 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"

From 2d1daac64d629ee7fabd410ba95157d57b399f71 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:06 -0400
Subject: [PATCH 13/17] cross-powerpc64le-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index a863233b5b32..797831b78e12 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"

From 0100ce23c443cc35d942de1bb994dba414688ea6 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:07 -0400
Subject: [PATCH 14/17] cross-powerpc64-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index b081a136ef29..3a77ba4f4423 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"

From ffb222737f7994cb8ea401d647a2e825a446f001 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:07 -0400
Subject: [PATCH 15/17] cross-powerpcle-linux-musl: bump musl version

---
 srcpkgs/cross-powerpcle-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 2f483e1f1ee5..5a0e54741db8 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"

From 2ae46b376113bd7be966bcecf8f628f414c82fad Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:07 -0400
Subject: [PATCH 16/17] cross-powerpc-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index e06970d76b9e..60e3c5847b9d 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"

From dc3bf16aaf58bf9dcb2b0b0cad8d00a856d9e73e Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:13:08 -0400
Subject: [PATCH 17/17] cross-x86_64-linux-musl: bump musl version

---
 srcpkgs/cross-x86_64-linux-musl/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 4984cd77f149..93a1c378813f 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2023-03-29 19:35 [PR PATCH] musl dkwo
  2023-03-29 19:36 ` musl dkwo
  2023-03-29 19:57 ` [PR PATCH] [Updated] musl dkwo
@ 2023-03-29 20:04 ` dkwo
  2023-03-29 20:04 ` [PR PATCH] [Updated] musl dkwo
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-03-29 20:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43106#issuecomment-1489191432

Comment:
ref for self:
```
for a in cross-aarch64-linux-musl cross-arm-linux-musleabi cross-arm-linux-musleabihf cross-armv7l-linux-musleabihf cross-i686-linux-musl cross-mipsel-linux-musl cross-mipsel-linux-muslhf cross-mips-linux-musl cross-mips-linux-muslhf cross-powerpc64le-linux-musl cross-powerpc64-linux-musl cross-powerpcle-linux-musl cross-powerpc-linux-musl cross-x86_64-linux-musl; do
	sed -i s/1.1.24/1.2.3/ srcpkgs/$a/template
        sed -i s/1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3/7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4/ srcpkgs/$a/template
	xrevbump "bump musl version" $a
done
```

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] musl
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (2 preceding siblings ...)
  2023-03-29 20:04 ` musl dkwo
@ 2023-03-29 20:04 ` dkwo
  2023-05-02 16:05 ` dkwo
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-03-29 20:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl
- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along lines of https://github.com/void-linux/xbps/pull/331

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 82693 bytes --]

From e0ce77134b6bd49721003f1a073ac2394538de83 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 01/17] musl: update to 1.2.3

---
 common/shlibs                                 |   2 +-
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 srcpkgs/musl/patches/add-qsort_r.patch        | 201 ----------------
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   8 +-
 25 files changed, 31 insertions(+), 1422 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-qsort_r.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index 68c5f6e33a85..55aa40e000cd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -16,7 +16,7 @@
 # PLEASE NOTE: when multiple packages provide the same SONAME, the first
 # one (order top->bottom) is preferred over the next ones.
 #
-libc.so musl-1.1.24_7
+libc.so musl-1.2.3_1
 libc.so.6 glibc-2.36_1
 libm.so.6 glibc-2.36_1
 libpthread.so.0 glibc-2.36_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89a..000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 000000000000..1ca36263691c
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e3..000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a6..000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d950195..000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c5..000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce..000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f..000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e5..000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-qsort_r.patch b/srcpkgs/musl/patches/add-qsort_r.patch
deleted file mode 100644
index 3d85496afb69..000000000000
--- a/srcpkgs/musl/patches/add-qsort_r.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From b76f37fd5625d038141b52184956fb4b7838e9a5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
-Date: Tue, 9 Mar 2021 18:02:13 -0300
-Subject: [PATCH] add qsort_r and make qsort a wrapper around it
-
-we make qsort a wrapper by providing a wrapper_cmp function that uses
-the extra argument as a function pointer. should be optimized to a tail
-call on most architectures, as long as it's built with
--fomit-frame-pointer, so the performance impact should be minimal.
-
-to keep the git history clean, for now qsort_r is implemented in qsort.c
-and qsort is implemented in qsort_nr.c.  qsort.c also received a few
-trivial cleanups, including replacing (*cmp)() calls with cmp().
-qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
-itself.
----
- include/stdlib.h      |  1 +
- src/include/stdlib.h  |  1 +
- src/stdlib/qsort.c    | 37 ++++++++++++++++++++-----------------
- src/stdlib/qsort_nr.c | 14 ++++++++++++++
- 4 files changed, 36 insertions(+), 17 deletions(-)
- create mode 100644 src/stdlib/qsort_nr.c
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index b54a051fe..7af86e3bc 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -146,6 +146,7 @@ int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
- void *reallocarray (void *, size_t, size_t);
-+void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/include/stdlib.h b/src/include/stdlib.h
-index e9da20158..812b04de2 100644
---- a/src/include/stdlib.h
-+++ b/src/include/stdlib.h
-@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
- hidden int __mkostemps(char *, int, int);
- hidden int __ptsname_r(int, char *, size_t);
- hidden char *__randname(char *);
-+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- 
- hidden void *__libc_malloc(size_t);
- hidden void *__libc_malloc_impl(size_t);
-diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
-index da58fd317..314ddc29d 100644
---- a/src/stdlib/qsort.c
-+++ b/src/stdlib/qsort.c
-@@ -24,6 +24,7 @@
- /* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
-    Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
- 
-+#define _BSD_SOURCE
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -31,7 +32,7 @@
- #include "atomic.h"
- #define ntz(x) a_ctz_l((x))
- 
--typedef int (*cmpfun)(const void *, const void *);
-+typedef int (*cmpfun)(const void *, const void *, void *);
- 
- static inline int pntz(size_t p[2]) {
- 	int r = ntz(p[0] - 1);
-@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
- 	p[1] >>= n;
- }
- 
--static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
-+static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
- {
- 	unsigned char *rt, *lf;
- 	unsigned char *ar[14 * sizeof(size_t) + 1];
-@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 		rt = head - width;
- 		lf = head - width - lp[pshift - 2];
- 
--		if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
-+		if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
- 			break;
- 		}
--		if((*cmp)(lf, rt) >= 0) {
-+		if(cmp(lf, rt, arg) >= 0) {
- 			ar[i++] = lf;
- 			head = lf;
- 			pshift -= 1;
-@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 	cycle(width, ar, i);
- }
- 
--static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
-+static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
- {
- 	unsigned char *stepson,
- 	              *rt, *lf;
-@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	ar[0] = head;
- 	while(p[0] != 1 || p[1] != 0) {
- 		stepson = head - lp[pshift];
--		if((*cmp)(stepson, ar[0]) <= 0) {
-+		if(cmp(stepson, ar[0], arg) <= 0) {
- 			break;
- 		}
- 		if(!trusty && pshift > 1) {
- 			rt = head - width;
- 			lf = head - width - lp[pshift - 2];
--			if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
-+			if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
- 				break;
- 			}
- 		}
-@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	}
- 	if(!trusty) {
- 		cycle(width, ar, i);
--		sift(head, width, cmp, pshift, lp);
-+		sift(head, width, cmp, arg, pshift, lp);
- 	}
- }
- 
--void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
- {
- 	size_t lp[12*sizeof(size_t)];
- 	size_t i, size = width * nel;
-@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 
- 	while(head < high) {
- 		if((p[0] & 3) == 3) {
--			sift(head, width, cmp, pshift, lp);
-+			sift(head, width, cmp, arg, pshift, lp);
- 			shr(p, 2);
- 			pshift += 2;
- 		} else {
- 			if(lp[pshift - 1] >= high - head) {
--				trinkle(head, width, cmp, p, pshift, 0, lp);
-+				trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 			} else {
--				sift(head, width, cmp, pshift, lp);
-+				sift(head, width, cmp, arg, pshift, lp);
- 			}
--			
-+
- 			if(pshift == 1) {
- 				shl(p, 1);
- 				pshift = 0;
-@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 				pshift = 1;
- 			}
- 		}
--		
-+
- 		p[0] |= 1;
- 		head += width;
- 	}
- 
--	trinkle(head, width, cmp, p, pshift, 0, lp);
-+	trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 
- 	while(pshift != 1 || p[0] != 1 || p[1] != 0) {
- 		if(pshift <= 1) {
-@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 			pshift -= 2;
- 			p[0] ^= 7;
- 			shr(p, 1);
--			trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
-+			trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
- 			shl(p, 1);
- 			p[0] |= 1;
--			trinkle(head - width, width, cmp, p, pshift, 1, lp);
-+			trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
- 		}
- 		head -= width;
- 	}
- }
-+
-+weak_alias(__qsort_r, qsort_r);
-diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c
-new file mode 100644
-index 000000000..efe7ccecd
---- /dev/null
-+++ b/src/stdlib/qsort_nr.c
-@@ -0,0 +1,14 @@
-+#define _BSD_SOURCE
-+#include <stdlib.h>
-+
-+typedef int (*cmpfun)(const void *, const void *);
-+
-+static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
-+{
-+	return ((cmpfun)cmp)(v1, v2);
-+}
-+
-+void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+{
-+	__qsort_r(base, nel, width, wrapper_cmp, cmp);
-+}
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d4..000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8e..000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f9..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f8..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b88..000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd..000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188f..000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c70..000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f..000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d..000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f..000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea2..000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index c77cc2b6c405..7179b43b3f5a 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=15
+version=1.2.3
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"
@@ -24,6 +23,7 @@ post_build() {
 	$CC $CFLAGS $LDFLAGS -fpie -c ${FILESDIR}/__stack_chk_fail_local.c -o __stack_chk_fail_local.o
 	$AR r libssp_nonshared.a __stack_chk_fail_local.o
 }
+
 do_install() {
 	# Move everything to /usr.
 	vmkdir usr/lib

From e58899c106795c008307613e363ae3966624b63a Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 02/17] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index e6f1684ed370..793eb533d2a7 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=2
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.3_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From 749dcf8c1c2b4059dbd59c5709a20ab32edbc155 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 03/17] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca960..56101385c4f7 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.3_1";;
 	*) depends+=" glibc-devel";;
 esac

From e9b2f6490053d68f8f8c8acff6a22f65b6a0ee04 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:24 -0400
Subject: [PATCH 04/17] cross-aarch64-linux-musl: bump musl version

---
 srcpkgs/cross-aarch64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index 8038b28d70ad..f19466ca77b6 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 7313127b00e8d4bcd96ffa6e36e3bd1cb2730c59 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:24 -0400
Subject: [PATCH 05/17] cross-arm-linux-musleabi: bump musl version

---
 srcpkgs/cross-arm-linux-musleabi/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index ee59931d6d93..400212c31c45 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 90d5179b472599e13e7b884a3302d7034e8bf575 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:24 -0400
Subject: [PATCH 06/17] cross-arm-linux-musleabihf: bump musl version

---
 srcpkgs/cross-arm-linux-musleabihf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 333db95425dd..8d5041ee4121 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 1b9e4ab98b3c35a38eda85560302ab0871d4ffca Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:25 -0400
Subject: [PATCH 07/17] cross-armv7l-linux-musleabihf: bump musl version

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 3c4ea2357661..76025185edbd 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 1880eb49b40d83f2420834afccc12d94ab11c6c4 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:25 -0400
Subject: [PATCH 08/17] cross-i686-linux-musl: bump musl version

---
 srcpkgs/cross-i686-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 6dc3fdcba07a..f5d59d0dd76f 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-i686-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
@@ -24,7 +24,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From a6051d87013f0acc59291cb94b2f18006540407c Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:25 -0400
Subject: [PATCH 09/17] cross-mipsel-linux-musl: bump musl version

---
 srcpkgs/cross-mipsel-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 23247d5bc972..9f48bae81a9a 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9b226f8042b37387914a12768967d6c7cdead752 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:26 -0400
Subject: [PATCH 10/17] cross-mipsel-linux-muslhf: bump musl version

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 8cc208c7e86d..c3c5fc329a6c 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3dfdfce83dc93dc24e47479d7281317433d698e6 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:26 -0400
Subject: [PATCH 11/17] cross-mips-linux-musl: bump musl version

---
 srcpkgs/cross-mips-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index f783961d70d2..0000c58e6dcf 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 432c52a8207108a3f3546b35b657c5be1bdbf2c5 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:27 -0400
Subject: [PATCH 12/17] cross-mips-linux-muslhf: bump musl version

---
 srcpkgs/cross-mips-linux-muslhf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index fe41bc80d808..8aa39c51409b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From b40320317d982dbe7926de0ee1e1f4347707843a Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:27 -0400
Subject: [PATCH 13/17] cross-powerpc64le-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index a863233b5b32..08493a635626 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -26,7 +26,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From f438865efa722317c411c04cc360d2c00a3255f4 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:28 -0400
Subject: [PATCH 14/17] cross-powerpc64-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index b081a136ef29..8016f16a36ca 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -26,7 +26,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 4887a2747ee8c50cc09db3718c5cecf6017a3169 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:28 -0400
Subject: [PATCH 15/17] cross-powerpcle-linux-musl: bump musl version

---
 srcpkgs/cross-powerpcle-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 2f483e1f1ee5..3e5ad073cc43 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9f0efbc1976933d96a4cf6fa4702d2313ae4c62c Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:28 -0400
Subject: [PATCH 16/17] cross-powerpc-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index e06970d76b9e..96dace8ad7e2 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 564fb3c6aecbfa2a1aeb8896129f5dde3d182cc5 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:29 -0400
Subject: [PATCH 17/17] cross-x86_64-linux-musl: bump musl version

---
 srcpkgs/cross-x86_64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 4984cd77f149..08fc39c37149 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
@@ -24,7 +24,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] musl
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (3 preceding siblings ...)
  2023-03-29 20:04 ` [PR PATCH] [Updated] musl dkwo
@ 2023-05-02 16:05 ` dkwo
  2023-05-02 20:14 ` [PR PATCH] [Updated] musl 1.2 dkwo
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-05-02 16:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl
- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along the lines of https://github.com/void-linux/xbps/pull/331

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 84934 bytes --]

From c6caddad1823c180048dfb176697a2c48cfb6d31 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 01/19] musl: update to 1.2.3

---
 common/shlibs                                 |   2 +-
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 srcpkgs/musl/patches/add-qsort_r.patch        | 201 ----------------
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   8 +-
 25 files changed, 31 insertions(+), 1422 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-qsort_r.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index 8c47e79b8c43..337dbbe30099 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -16,7 +16,7 @@
 # PLEASE NOTE: when multiple packages provide the same SONAME, the first
 # one (order top->bottom) is preferred over the next ones.
 #
-libc.so musl-1.1.24_7
+libc.so musl-1.2.3_1
 libc.so.6 glibc-2.36_1
 libm.so.6 glibc-2.36_1
 libpthread.so.0 glibc-2.36_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89a..000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 000000000000..1ca36263691c
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e3..000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a6..000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d950195..000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c5..000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce..000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f..000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e5..000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-qsort_r.patch b/srcpkgs/musl/patches/add-qsort_r.patch
deleted file mode 100644
index 3d85496afb69..000000000000
--- a/srcpkgs/musl/patches/add-qsort_r.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From b76f37fd5625d038141b52184956fb4b7838e9a5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
-Date: Tue, 9 Mar 2021 18:02:13 -0300
-Subject: [PATCH] add qsort_r and make qsort a wrapper around it
-
-we make qsort a wrapper by providing a wrapper_cmp function that uses
-the extra argument as a function pointer. should be optimized to a tail
-call on most architectures, as long as it's built with
--fomit-frame-pointer, so the performance impact should be minimal.
-
-to keep the git history clean, for now qsort_r is implemented in qsort.c
-and qsort is implemented in qsort_nr.c.  qsort.c also received a few
-trivial cleanups, including replacing (*cmp)() calls with cmp().
-qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
-itself.
----
- include/stdlib.h      |  1 +
- src/include/stdlib.h  |  1 +
- src/stdlib/qsort.c    | 37 ++++++++++++++++++++-----------------
- src/stdlib/qsort_nr.c | 14 ++++++++++++++
- 4 files changed, 36 insertions(+), 17 deletions(-)
- create mode 100644 src/stdlib/qsort_nr.c
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index b54a051fe..7af86e3bc 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -146,6 +146,7 @@ int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
- void *reallocarray (void *, size_t, size_t);
-+void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/include/stdlib.h b/src/include/stdlib.h
-index e9da20158..812b04de2 100644
---- a/src/include/stdlib.h
-+++ b/src/include/stdlib.h
-@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
- hidden int __mkostemps(char *, int, int);
- hidden int __ptsname_r(int, char *, size_t);
- hidden char *__randname(char *);
-+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- 
- hidden void *__libc_malloc(size_t);
- hidden void *__libc_malloc_impl(size_t);
-diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
-index da58fd317..314ddc29d 100644
---- a/src/stdlib/qsort.c
-+++ b/src/stdlib/qsort.c
-@@ -24,6 +24,7 @@
- /* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
-    Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
- 
-+#define _BSD_SOURCE
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -31,7 +32,7 @@
- #include "atomic.h"
- #define ntz(x) a_ctz_l((x))
- 
--typedef int (*cmpfun)(const void *, const void *);
-+typedef int (*cmpfun)(const void *, const void *, void *);
- 
- static inline int pntz(size_t p[2]) {
- 	int r = ntz(p[0] - 1);
-@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
- 	p[1] >>= n;
- }
- 
--static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
-+static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
- {
- 	unsigned char *rt, *lf;
- 	unsigned char *ar[14 * sizeof(size_t) + 1];
-@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 		rt = head - width;
- 		lf = head - width - lp[pshift - 2];
- 
--		if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
-+		if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
- 			break;
- 		}
--		if((*cmp)(lf, rt) >= 0) {
-+		if(cmp(lf, rt, arg) >= 0) {
- 			ar[i++] = lf;
- 			head = lf;
- 			pshift -= 1;
-@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 	cycle(width, ar, i);
- }
- 
--static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
-+static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
- {
- 	unsigned char *stepson,
- 	              *rt, *lf;
-@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	ar[0] = head;
- 	while(p[0] != 1 || p[1] != 0) {
- 		stepson = head - lp[pshift];
--		if((*cmp)(stepson, ar[0]) <= 0) {
-+		if(cmp(stepson, ar[0], arg) <= 0) {
- 			break;
- 		}
- 		if(!trusty && pshift > 1) {
- 			rt = head - width;
- 			lf = head - width - lp[pshift - 2];
--			if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
-+			if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
- 				break;
- 			}
- 		}
-@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	}
- 	if(!trusty) {
- 		cycle(width, ar, i);
--		sift(head, width, cmp, pshift, lp);
-+		sift(head, width, cmp, arg, pshift, lp);
- 	}
- }
- 
--void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
- {
- 	size_t lp[12*sizeof(size_t)];
- 	size_t i, size = width * nel;
-@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 
- 	while(head < high) {
- 		if((p[0] & 3) == 3) {
--			sift(head, width, cmp, pshift, lp);
-+			sift(head, width, cmp, arg, pshift, lp);
- 			shr(p, 2);
- 			pshift += 2;
- 		} else {
- 			if(lp[pshift - 1] >= high - head) {
--				trinkle(head, width, cmp, p, pshift, 0, lp);
-+				trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 			} else {
--				sift(head, width, cmp, pshift, lp);
-+				sift(head, width, cmp, arg, pshift, lp);
- 			}
--			
-+
- 			if(pshift == 1) {
- 				shl(p, 1);
- 				pshift = 0;
-@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 				pshift = 1;
- 			}
- 		}
--		
-+
- 		p[0] |= 1;
- 		head += width;
- 	}
- 
--	trinkle(head, width, cmp, p, pshift, 0, lp);
-+	trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 
- 	while(pshift != 1 || p[0] != 1 || p[1] != 0) {
- 		if(pshift <= 1) {
-@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 			pshift -= 2;
- 			p[0] ^= 7;
- 			shr(p, 1);
--			trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
-+			trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
- 			shl(p, 1);
- 			p[0] |= 1;
--			trinkle(head - width, width, cmp, p, pshift, 1, lp);
-+			trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
- 		}
- 		head -= width;
- 	}
- }
-+
-+weak_alias(__qsort_r, qsort_r);
-diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c
-new file mode 100644
-index 000000000..efe7ccecd
---- /dev/null
-+++ b/src/stdlib/qsort_nr.c
-@@ -0,0 +1,14 @@
-+#define _BSD_SOURCE
-+#include <stdlib.h>
-+
-+typedef int (*cmpfun)(const void *, const void *);
-+
-+static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
-+{
-+	return ((cmpfun)cmp)(v1, v2);
-+}
-+
-+void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+{
-+	__qsort_r(base, nel, width, wrapper_cmp, cmp);
-+}
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d4..000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8e..000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f9..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f8..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b88..000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd..000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188f..000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c70..000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f..000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d..000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f..000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea2..000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index c77cc2b6c405..7179b43b3f5a 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=15
+version=1.2.3
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"
@@ -24,6 +23,7 @@ post_build() {
 	$CC $CFLAGS $LDFLAGS -fpie -c ${FILESDIR}/__stack_chk_fail_local.c -o __stack_chk_fail_local.o
 	$AR r libssp_nonshared.a __stack_chk_fail_local.o
 }
+
 do_install() {
 	# Move everything to /usr.
 	vmkdir usr/lib

From f4b5aad451019f4d16a462605ec85854912297e5 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 02/19] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index e6f1684ed370..793eb533d2a7 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=2
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.3_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From 5ef3d4204cf41d61a3c27efc5217910dfb52ffd1 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 03/19] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca960..56101385c4f7 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.3_1";;
 	*) depends+=" glibc-devel";;
 esac

From 918202e12f858cc34bfe23b75c2aaaa9f8631b1a Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:24 -0400
Subject: [PATCH 04/19] cross-aarch64-linux-musl: bump musl version

---
 srcpkgs/cross-aarch64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index 8038b28d70ad..f19466ca77b6 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 0495b16dd68cafbf8867bc4412a8ef8f35cd65b8 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:24 -0400
Subject: [PATCH 05/19] cross-arm-linux-musleabi: bump musl version

---
 srcpkgs/cross-arm-linux-musleabi/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index ee59931d6d93..400212c31c45 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 3b98c3bfeea1962274216ccc3e45b462073c1925 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:24 -0400
Subject: [PATCH 06/19] cross-arm-linux-musleabihf: bump musl version

---
 srcpkgs/cross-arm-linux-musleabihf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 333db95425dd..8d5041ee4121 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 17faaa4e7e415a96a5e4ea88d0681f00dd9f3b2f Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:25 -0400
Subject: [PATCH 07/19] cross-armv7l-linux-musleabihf: bump musl version

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 3c4ea2357661..76025185edbd 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From dc4f50b0da1e16478884f5ecedfd4cb3df4c15e6 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:25 -0400
Subject: [PATCH 08/19] cross-i686-linux-musl: bump musl version

---
 srcpkgs/cross-i686-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 6dc3fdcba07a..f5d59d0dd76f 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-i686-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
@@ -24,7 +24,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 8607fe6e5090dc0c4c5c304cedf246508ff3a4c1 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:25 -0400
Subject: [PATCH 09/19] cross-mipsel-linux-musl: bump musl version

---
 srcpkgs/cross-mipsel-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 23247d5bc972..9f48bae81a9a 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 1476f6fb22ceb57f738c653fa7daad1b375a023a Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:26 -0400
Subject: [PATCH 10/19] cross-mipsel-linux-muslhf: bump musl version

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 8cc208c7e86d..c3c5fc329a6c 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From e4813fe140334eb28e67a756e8bf8f5ed748015b Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:26 -0400
Subject: [PATCH 11/19] cross-mips-linux-musl: bump musl version

---
 srcpkgs/cross-mips-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index f783961d70d2..0000c58e6dcf 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 47b91bad216c19e2afa2c0f179d228e46adf6121 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:27 -0400
Subject: [PATCH 12/19] cross-mips-linux-muslhf: bump musl version

---
 srcpkgs/cross-mips-linux-muslhf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index fe41bc80d808..8aa39c51409b 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 3063645a916fdaef62bc1607e6fa9030c1f1c537 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:27 -0400
Subject: [PATCH 13/19] cross-powerpc64le-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index a863233b5b32..08493a635626 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -26,7 +26,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From eb9659e2cbd08ef13b3757680e9dd624c576d4aa Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:28 -0400
Subject: [PATCH 14/19] cross-powerpc64-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index b081a136ef29..8016f16a36ca 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -26,7 +26,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 4bb0d52561c37dda7194b464d6b6411fd269b133 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:28 -0400
Subject: [PATCH 15/19] cross-powerpcle-linux-musl: bump musl version

---
 srcpkgs/cross-powerpcle-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 2f483e1f1ee5..3e5ad073cc43 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9c6a2b10101bb83dda04109c7e91eeaffa42f5a5 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:28 -0400
Subject: [PATCH 16/19] cross-powerpc-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index e06970d76b9e..96dace8ad7e2 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 9a3dfe81390bc26fdf2c67aa4974d1b12d340f16 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 16:03:29 -0400
Subject: [PATCH 17/19] cross-x86_64-linux-musl: bump musl version

---
 srcpkgs/cross-x86_64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 4984cd77f149..08fc39c37149 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.3
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
@@ -24,7 +24,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From fd5e3df4eeeb1fcea39face9b17c0ae23218645e Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 20 Apr 2023 17:45:36 -0400
Subject: [PATCH 18/19] musl: update to git

---
 srcpkgs/musl/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 7179b43b3f5a..09713b25c1a3 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,6 +1,6 @@
 # Template file for 'musl'
 pkgname=musl
-version=1.2.3
+version=1.2.3.20230411
 revision=1
 archs="*-musl"
 bootstrap=yes
@@ -10,8 +10,9 @@ short_desc="Musl C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
-distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4
+_commit="c1b42c4a3a0324ec25877980f59db233fa420925"
+distfiles="https://git.musl-libc.org/cgit/musl/snapshot/$_commit.tar.gz"
+checksum=f708407d74fe109a071beeb719bc921b8d556f550fce1e5ad8912c7fba0d68b9
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"

From 6fb7172a5202d3373719dfdb264403cad84f429d Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 11:53:37 -0400
Subject: [PATCH 19/19] musl: update to 1.2.4

---
 srcpkgs/musl/template | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 09713b25c1a3..9ebf8118ed6d 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,6 +1,6 @@
 # Template file for 'musl'
 pkgname=musl
-version=1.2.3.20230411
+version=1.2.4
 revision=1
 archs="*-musl"
 bootstrap=yes
@@ -10,9 +10,8 @@ short_desc="Musl C library"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
-_commit="c1b42c4a3a0324ec25877980f59db233fa420925"
-distfiles="https://git.musl-libc.org/cgit/musl/snapshot/$_commit.tar.gz"
-checksum=f708407d74fe109a071beeb719bc921b8d556f550fce1e5ad8912c7fba0d68b9
+distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
+checksum=7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] musl 1.2
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (4 preceding siblings ...)
  2023-05-02 16:05 ` dkwo
@ 2023-05-02 20:14 ` dkwo
  2023-05-02 20:16 ` dkwo
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-05-02 20:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl 1.2
[ci skip]

- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along the lines of https://github.com/void-linux/xbps/pull/331

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 82679 bytes --]

From 0dee3e12c51a8af7ddce9f14cc16aacbcb8aaa2d Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 01/17] musl: update to 1.2.4

---
 common/shlibs                                 |   2 +-
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 srcpkgs/musl/patches/add-qsort_r.patch        | 201 ----------------
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   8 +-
 25 files changed, 31 insertions(+), 1422 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-qsort_r.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index 8c47e79b8c43..337dbbe30099 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -16,7 +16,7 @@
 # PLEASE NOTE: when multiple packages provide the same SONAME, the first
 # one (order top->bottom) is preferred over the next ones.
 #
-libc.so musl-1.1.24_7
+libc.so musl-1.2.3_1
 libc.so.6 glibc-2.36_1
 libm.so.6 glibc-2.36_1
 libpthread.so.0 glibc-2.36_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89a..000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 000000000000..1ca36263691c
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e3..000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a6..000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d950195..000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c5..000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce..000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f..000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e5..000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-qsort_r.patch b/srcpkgs/musl/patches/add-qsort_r.patch
deleted file mode 100644
index 3d85496afb69..000000000000
--- a/srcpkgs/musl/patches/add-qsort_r.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From b76f37fd5625d038141b52184956fb4b7838e9a5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
-Date: Tue, 9 Mar 2021 18:02:13 -0300
-Subject: [PATCH] add qsort_r and make qsort a wrapper around it
-
-we make qsort a wrapper by providing a wrapper_cmp function that uses
-the extra argument as a function pointer. should be optimized to a tail
-call on most architectures, as long as it's built with
--fomit-frame-pointer, so the performance impact should be minimal.
-
-to keep the git history clean, for now qsort_r is implemented in qsort.c
-and qsort is implemented in qsort_nr.c.  qsort.c also received a few
-trivial cleanups, including replacing (*cmp)() calls with cmp().
-qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
-itself.
----
- include/stdlib.h      |  1 +
- src/include/stdlib.h  |  1 +
- src/stdlib/qsort.c    | 37 ++++++++++++++++++++-----------------
- src/stdlib/qsort_nr.c | 14 ++++++++++++++
- 4 files changed, 36 insertions(+), 17 deletions(-)
- create mode 100644 src/stdlib/qsort_nr.c
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index b54a051fe..7af86e3bc 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -146,6 +146,7 @@ int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
- void *reallocarray (void *, size_t, size_t);
-+void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/include/stdlib.h b/src/include/stdlib.h
-index e9da20158..812b04de2 100644
---- a/src/include/stdlib.h
-+++ b/src/include/stdlib.h
-@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
- hidden int __mkostemps(char *, int, int);
- hidden int __ptsname_r(int, char *, size_t);
- hidden char *__randname(char *);
-+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- 
- hidden void *__libc_malloc(size_t);
- hidden void *__libc_malloc_impl(size_t);
-diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
-index da58fd317..314ddc29d 100644
---- a/src/stdlib/qsort.c
-+++ b/src/stdlib/qsort.c
-@@ -24,6 +24,7 @@
- /* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
-    Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
- 
-+#define _BSD_SOURCE
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -31,7 +32,7 @@
- #include "atomic.h"
- #define ntz(x) a_ctz_l((x))
- 
--typedef int (*cmpfun)(const void *, const void *);
-+typedef int (*cmpfun)(const void *, const void *, void *);
- 
- static inline int pntz(size_t p[2]) {
- 	int r = ntz(p[0] - 1);
-@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
- 	p[1] >>= n;
- }
- 
--static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
-+static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
- {
- 	unsigned char *rt, *lf;
- 	unsigned char *ar[14 * sizeof(size_t) + 1];
-@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 		rt = head - width;
- 		lf = head - width - lp[pshift - 2];
- 
--		if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
-+		if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
- 			break;
- 		}
--		if((*cmp)(lf, rt) >= 0) {
-+		if(cmp(lf, rt, arg) >= 0) {
- 			ar[i++] = lf;
- 			head = lf;
- 			pshift -= 1;
-@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 	cycle(width, ar, i);
- }
- 
--static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
-+static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
- {
- 	unsigned char *stepson,
- 	              *rt, *lf;
-@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	ar[0] = head;
- 	while(p[0] != 1 || p[1] != 0) {
- 		stepson = head - lp[pshift];
--		if((*cmp)(stepson, ar[0]) <= 0) {
-+		if(cmp(stepson, ar[0], arg) <= 0) {
- 			break;
- 		}
- 		if(!trusty && pshift > 1) {
- 			rt = head - width;
- 			lf = head - width - lp[pshift - 2];
--			if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
-+			if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
- 				break;
- 			}
- 		}
-@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	}
- 	if(!trusty) {
- 		cycle(width, ar, i);
--		sift(head, width, cmp, pshift, lp);
-+		sift(head, width, cmp, arg, pshift, lp);
- 	}
- }
- 
--void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
- {
- 	size_t lp[12*sizeof(size_t)];
- 	size_t i, size = width * nel;
-@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 
- 	while(head < high) {
- 		if((p[0] & 3) == 3) {
--			sift(head, width, cmp, pshift, lp);
-+			sift(head, width, cmp, arg, pshift, lp);
- 			shr(p, 2);
- 			pshift += 2;
- 		} else {
- 			if(lp[pshift - 1] >= high - head) {
--				trinkle(head, width, cmp, p, pshift, 0, lp);
-+				trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 			} else {
--				sift(head, width, cmp, pshift, lp);
-+				sift(head, width, cmp, arg, pshift, lp);
- 			}
--			
-+
- 			if(pshift == 1) {
- 				shl(p, 1);
- 				pshift = 0;
-@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 				pshift = 1;
- 			}
- 		}
--		
-+
- 		p[0] |= 1;
- 		head += width;
- 	}
- 
--	trinkle(head, width, cmp, p, pshift, 0, lp);
-+	trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 
- 	while(pshift != 1 || p[0] != 1 || p[1] != 0) {
- 		if(pshift <= 1) {
-@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 			pshift -= 2;
- 			p[0] ^= 7;
- 			shr(p, 1);
--			trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
-+			trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
- 			shl(p, 1);
- 			p[0] |= 1;
--			trinkle(head - width, width, cmp, p, pshift, 1, lp);
-+			trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
- 		}
- 		head -= width;
- 	}
- }
-+
-+weak_alias(__qsort_r, qsort_r);
-diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c
-new file mode 100644
-index 000000000..efe7ccecd
---- /dev/null
-+++ b/src/stdlib/qsort_nr.c
-@@ -0,0 +1,14 @@
-+#define _BSD_SOURCE
-+#include <stdlib.h>
-+
-+typedef int (*cmpfun)(const void *, const void *);
-+
-+static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
-+{
-+	return ((cmpfun)cmp)(v1, v2);
-+}
-+
-+void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+{
-+	__qsort_r(base, nel, width, wrapper_cmp, cmp);
-+}
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d4..000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8e..000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f9..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f8..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a..000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b88..000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd..000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188f..000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c70..000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f..000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d..000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f..000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea2..000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index c77cc2b6c405..9ebf8118ed6d 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=15
+version=1.2.4
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"
@@ -24,6 +23,7 @@ post_build() {
 	$CC $CFLAGS $LDFLAGS -fpie -c ${FILESDIR}/__stack_chk_fail_local.c -o __stack_chk_fail_local.o
 	$AR r libssp_nonshared.a __stack_chk_fail_local.o
 }
+
 do_install() {
 	# Move everything to /usr.
 	vmkdir usr/lib

From 92caa5f9f1123fb7366f6a5487e9ae9f36b780a0 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 02/17] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index e6f1684ed370..3506e704f3f0 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=2
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.4_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From 38937897194f91a7ef8402cc342cb6b94d0c95a2 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 03/17] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca960..303a7f50e473 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.4_1";;
 	*) depends+=" glibc-devel";;
 esac

From e740710df0c9afc17cf61af675b84292bfa76430 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:19 -0400
Subject: [PATCH 04/17] cross-aarch64-linux-musl: bump musl version

---
 srcpkgs/cross-aarch64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index 8038b28d70ad..7a491a7e86c4 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-aarch64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-aarch64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv8-a"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From e70ec058c39a791ce0a79ed62d21875ebfbef779 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:20 -0400
Subject: [PATCH 05/17] cross-arm-linux-musleabi: bump musl version

---
 srcpkgs/cross-arm-linux-musleabi/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index ee59931d6d93..37d2b8875d1c 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabi'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabi
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv5te --with-float=soft"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 573eabb233efdc26f6063e6426336b35dbc03c75 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:20 -0400
Subject: [PATCH 06/17] cross-arm-linux-musleabihf: bump musl version

---
 srcpkgs/cross-arm-linux-musleabihf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 333db95425dd..74d96d8b1e01 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-arm-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-arm-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From c6b5d724fc04a23f1613b5eea3d504135ce0d309 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:20 -0400
Subject: [PATCH 07/17] cross-armv7l-linux-musleabihf: bump musl version

---
 srcpkgs/cross-armv7l-linux-musleabihf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 3c4ea2357661..f1802b7f3b6c 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-armv7l-linux-musleabihf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-armv7l-linux-musleabihf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
@@ -25,7 +25,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 2584ca2e881ba0f6c72cc0a2f2d1437201b54783 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:21 -0400
Subject: [PATCH 08/17] cross-i686-linux-musl: bump musl version

---
 srcpkgs/cross-i686-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 6dc3fdcba07a..74b0b9847684 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-i686-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-i686-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
@@ -24,7 +24,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 7be4edd32bb2d8332754b02902017ab4748214c4 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:21 -0400
Subject: [PATCH 09/17] cross-mipsel-linux-musl: bump musl version

---
 srcpkgs/cross-mipsel-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 23247d5bc972..fdb85612bc8c 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From a3f6503a7eede3fdd11db12160eb469a65df0a3a Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:21 -0400
Subject: [PATCH 10/17] cross-mipsel-linux-muslhf: bump musl version

---
 srcpkgs/cross-mipsel-linux-muslhf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 8cc208c7e86d..63f4d91c9104 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mipsel-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 pkgname=cross-mipsel-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2454a061fba75e6266b2c7f7c88639fa6d73f8a6 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:22 -0400
Subject: [PATCH 11/17] cross-mips-linux-musl: bump musl version

---
 srcpkgs/cross-mips-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index f783961d70d2..03cd5a6ebe7a 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 pkgname=cross-mips-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=soft
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From ba01536515105502fba83d75b2a9413ccb40f887 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:22 -0400
Subject: [PATCH 12/17] cross-mips-linux-muslhf: bump musl version

---
 srcpkgs/cross-mips-linux-muslhf/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index fe41bc80d808..e32bf3dad2bd 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-mips-linux-muslhf'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 pkgname=cross-mips-linux-muslhf
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--with-arch=mips32r2 --with-float=hard
  --with-linker-hash-style=sysv"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 7f94e6970fab7d8676e66b88d9d1aad9a9e4a967 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:22 -0400
Subject: [PATCH 13/17] cross-powerpc64le-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64le-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index a863233b5b32..da6f0eb201fd 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64le-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpcle-linux"
@@ -26,7 +26,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From bbf3de7ce272dd07e318cce57f5cdbbf49f530b4 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:23 -0400
Subject: [PATCH 14/17] cross-powerpc64-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index b081a136ef29..faa07b8b6cf0 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-powerpc64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float --with-abi=elfv2 --enable-targets=powerpc-linux"
@@ -26,7 +26,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

From 7131909ff332e3f30e7dda462ac452233be8e705 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:23 -0400
Subject: [PATCH 15/17] cross-powerpcle-linux-musl: bump musl version

---
 srcpkgs/cross-powerpcle-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpcle-linux-musl/template b/srcpkgs/cross-powerpcle-linux-musl/template
index 2f483e1f1ee5..868dae155c7d 100644
--- a/srcpkgs/cross-powerpcle-linux-musl/template
+++ b/srcpkgs/cross-powerpcle-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpcle-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 pkgname=cross-powerpcle-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 2724b9bb87470ac17dd8f24878291bce64e1db71 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:24 -0400
Subject: [PATCH 16/17] cross-powerpc-linux-musl: bump musl version

---
 srcpkgs/cross-powerpc-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index e06970d76b9e..d47ef0692fe5 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,11 +1,11 @@
 # Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 pkgname=cross-powerpc-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 configure_args="--enable-secureplt --disable-vtable-verify
  --disable-decimal-float"
@@ -24,7 +24,7 @@ distfiles="
  ${KERNEL_SITE}/kernel/v5.x/linux-${_linux_version}.tar.xz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec"
 nocross=yes
 

From 4b5c0c45969132b9381044626274e28224417526 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 2 May 2023 16:12:24 -0400
Subject: [PATCH 17/17] cross-x86_64-linux-musl: bump musl version

---
 srcpkgs/cross-x86_64-linux-musl/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 4984cd77f149..dd2fe367b93b 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,12 +1,12 @@
 # Template file for 'cross-x86_64-linux-musl'
 _binutils_version=2.39
 _gcc_version=12.2.0
-_musl_version=1.1.24
+_musl_version=1.2.4
 _linux_version=5.10.4
 _libucontext_version=1.0
 pkgname=cross-x86_64-linux-musl
 version=0.35
-revision=3
+revision=4
 build_style=void-cross
 hostmakedepends="texinfo tar gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel gmp-devel mpfr-devel
@@ -24,7 +24,7 @@ distfiles="
  https://github.com/kaniini/libucontext/archive/libucontext-${_libucontext_version}.tar.gz"
 checksum="645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff
- 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+ 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
  904e396c26e9992a16cd1cc989460171536bed7739bf36049f6eb020ee5d56ec
  23714e99a87f6dea82e8a073c526325161dd65462459820b16a6162be91955bb"
 nocross=yes

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl 1.2
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (5 preceding siblings ...)
  2023-05-02 20:14 ` [PR PATCH] [Updated] musl 1.2 dkwo
@ 2023-05-02 20:16 ` dkwo
  2023-08-01  1:57 ` github-actions
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-05-02 20:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43106#issuecomment-1489191432

Comment:
ref for self:
```
for a in cross-aarch64-linux-musl cross-arm-linux-musleabi cross-arm-linux-musleabihf cross-armv7l-linux-musleabihf cross-i686-linux-musl cross-mipsel-linux-musl cross-mipsel-linux-muslhf cross-mips-linux-musl cross-mips-linux-muslhf cross-powerpc64le-linux-musl cross-powerpc64-linux-musl cross-powerpcle-linux-musl cross-powerpc-linux-musl cross-x86_64-linux-musl; do
	sed -i s/1.1.24/1.2.4/ srcpkgs/$a/template
        sed -i s/1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3/7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039/ srcpkgs/$a/template
	xrevbump "bump musl version" $a
done
```

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl 1.2
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (6 preceding siblings ...)
  2023-05-02 20:16 ` dkwo
@ 2023-08-01  1:57 ` github-actions
  2023-08-01 10:04 ` [PR PATCH] [Updated] " dkwo
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: github-actions @ 2023-08-01  1:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/43106#issuecomment-1659447761

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] musl 1.2
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (7 preceding siblings ...)
  2023-08-01  1:57 ` github-actions
@ 2023-08-01 10:04 ` dkwo
  2023-10-31  1:45 ` github-actions
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-08-01 10:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl 1.2
[ci skip]

- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along the lines of https://github.com/void-linux/xbps/pull/331

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 68497 bytes --]

From 73b1a4014532cdea5f7fb7f9bec8e8d03d210318 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 1/3] musl: update to 1.2.4

---
 common/shlibs                                 |   2 +-
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...88a9da5e7b2925dda17a2d6820dddf1fb287.patch | 139 -----------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 srcpkgs/musl/patches/add-qsort_r.patch        | 201 ----------------
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 ...rlimit-misbehavior-and-hang-in-vfork.patch |  49 ----
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   7 +-
 27 files changed, 30 insertions(+), 1610 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-qsort_r.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index 2d528aa798ee5..ce8ce51b27677 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -16,7 +16,7 @@
 # PLEASE NOTE: when multiple packages provide the same SONAME, the first
 # one (order top->bottom) is preferred over the next ones.
 #
-libc.so musl-1.1.24_7
+libc.so musl-1.2.3_1
 libc.so.6 glibc-2.36_1
 libm.so.6 glibc-2.36_1
 libpthread.so.0 glibc-2.36_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89ad..0000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 0000000000000..1ca36263691c7
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e30..0000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a62..0000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d9501957..0000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c59..0000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch b/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
deleted file mode 100644
index a8bfa66d6c47d..0000000000000
--- a/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 98e688a9da5e7b2925dda17a2d6820dddf1fb287 Mon Sep 17 00:00:00 2001
-From: Ismael Luceno <ismael@iodev.co.uk>
-Date: Sun, 15 Aug 2021 17:51:57 +0200
-Subject: [PATCH] define NULL as nullptr when used in C++11 or later
-
-This should be safer for casting and more compatible with existing code
-bases that wrongly assume it must be defined as a pointer.
----
- include/locale.h | 4 +++-
- include/stddef.h | 4 +++-
- include/stdio.h  | 4 +++-
- include/stdlib.h | 4 +++-
- include/string.h | 4 +++-
- include/time.h   | 4 +++-
- include/unistd.h | 4 +++-
- include/wchar.h  | 4 +++-
- 8 files changed, 24 insertions(+), 8 deletions(-)
-
-diff --git a/include/locale.h b/include/locale.h
-index ce384381c..11106fea8 100644
---- a/include/locale.h
-+++ b/include/locale.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stddef.h b/include/stddef.h
-index bd7538535..f25b86396 100644
---- a/include/stddef.h
-+++ b/include/stddef.h
-@@ -1,7 +1,9 @@
- #ifndef _STDDEF_H
- #define _STDDEF_H
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stdio.h b/include/stdio.h
-index 3604198c3..d1ed01f03 100644
---- a/include/stdio.h
-+++ b/include/stdio.h
-@@ -25,7 +25,9 @@ extern "C" {
- 
- #include <bits/alltypes.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 7af86e3bc..b507ca33b 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/string.h b/include/string.h
-index 795a2abcd..43ad0942e 100644
---- a/include/string.h
-+++ b/include/string.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/time.h b/include/time.h
-index 5494df183..3d9483720 100644
---- a/include/time.h
-+++ b/include/time.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/unistd.h b/include/unistd.h
-index 130640260..ee2dbe8af 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -15,7 +15,9 @@ extern "C" {
- #define SEEK_CUR 1
- #define SEEK_END 2
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/wchar.h b/include/wchar.h
-index 88eb55b18..ed5d774df 100644
---- a/include/wchar.h
-+++ b/include/wchar.h
-@@ -38,7 +38,9 @@ extern "C" {
- #define WCHAR_MIN (-1-0x7fffffff+L'\0')
- #endif
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce9..0000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f0..0000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e53..0000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-qsort_r.patch b/srcpkgs/musl/patches/add-qsort_r.patch
deleted file mode 100644
index 3d85496afb69f..0000000000000
--- a/srcpkgs/musl/patches/add-qsort_r.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From b76f37fd5625d038141b52184956fb4b7838e9a5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
-Date: Tue, 9 Mar 2021 18:02:13 -0300
-Subject: [PATCH] add qsort_r and make qsort a wrapper around it
-
-we make qsort a wrapper by providing a wrapper_cmp function that uses
-the extra argument as a function pointer. should be optimized to a tail
-call on most architectures, as long as it's built with
--fomit-frame-pointer, so the performance impact should be minimal.
-
-to keep the git history clean, for now qsort_r is implemented in qsort.c
-and qsort is implemented in qsort_nr.c.  qsort.c also received a few
-trivial cleanups, including replacing (*cmp)() calls with cmp().
-qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
-itself.
----
- include/stdlib.h      |  1 +
- src/include/stdlib.h  |  1 +
- src/stdlib/qsort.c    | 37 ++++++++++++++++++++-----------------
- src/stdlib/qsort_nr.c | 14 ++++++++++++++
- 4 files changed, 36 insertions(+), 17 deletions(-)
- create mode 100644 src/stdlib/qsort_nr.c
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index b54a051fe..7af86e3bc 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -146,6 +146,7 @@ int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
- void *reallocarray (void *, size_t, size_t);
-+void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/include/stdlib.h b/src/include/stdlib.h
-index e9da20158..812b04de2 100644
---- a/src/include/stdlib.h
-+++ b/src/include/stdlib.h
-@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
- hidden int __mkostemps(char *, int, int);
- hidden int __ptsname_r(int, char *, size_t);
- hidden char *__randname(char *);
-+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- 
- hidden void *__libc_malloc(size_t);
- hidden void *__libc_malloc_impl(size_t);
-diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
-index da58fd317..314ddc29d 100644
---- a/src/stdlib/qsort.c
-+++ b/src/stdlib/qsort.c
-@@ -24,6 +24,7 @@
- /* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
-    Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
- 
-+#define _BSD_SOURCE
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -31,7 +32,7 @@
- #include "atomic.h"
- #define ntz(x) a_ctz_l((x))
- 
--typedef int (*cmpfun)(const void *, const void *);
-+typedef int (*cmpfun)(const void *, const void *, void *);
- 
- static inline int pntz(size_t p[2]) {
- 	int r = ntz(p[0] - 1);
-@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
- 	p[1] >>= n;
- }
- 
--static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
-+static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
- {
- 	unsigned char *rt, *lf;
- 	unsigned char *ar[14 * sizeof(size_t) + 1];
-@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 		rt = head - width;
- 		lf = head - width - lp[pshift - 2];
- 
--		if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
-+		if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
- 			break;
- 		}
--		if((*cmp)(lf, rt) >= 0) {
-+		if(cmp(lf, rt, arg) >= 0) {
- 			ar[i++] = lf;
- 			head = lf;
- 			pshift -= 1;
-@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 	cycle(width, ar, i);
- }
- 
--static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
-+static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
- {
- 	unsigned char *stepson,
- 	              *rt, *lf;
-@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	ar[0] = head;
- 	while(p[0] != 1 || p[1] != 0) {
- 		stepson = head - lp[pshift];
--		if((*cmp)(stepson, ar[0]) <= 0) {
-+		if(cmp(stepson, ar[0], arg) <= 0) {
- 			break;
- 		}
- 		if(!trusty && pshift > 1) {
- 			rt = head - width;
- 			lf = head - width - lp[pshift - 2];
--			if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
-+			if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
- 				break;
- 			}
- 		}
-@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	}
- 	if(!trusty) {
- 		cycle(width, ar, i);
--		sift(head, width, cmp, pshift, lp);
-+		sift(head, width, cmp, arg, pshift, lp);
- 	}
- }
- 
--void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
- {
- 	size_t lp[12*sizeof(size_t)];
- 	size_t i, size = width * nel;
-@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 
- 	while(head < high) {
- 		if((p[0] & 3) == 3) {
--			sift(head, width, cmp, pshift, lp);
-+			sift(head, width, cmp, arg, pshift, lp);
- 			shr(p, 2);
- 			pshift += 2;
- 		} else {
- 			if(lp[pshift - 1] >= high - head) {
--				trinkle(head, width, cmp, p, pshift, 0, lp);
-+				trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 			} else {
--				sift(head, width, cmp, pshift, lp);
-+				sift(head, width, cmp, arg, pshift, lp);
- 			}
--			
-+
- 			if(pshift == 1) {
- 				shl(p, 1);
- 				pshift = 0;
-@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 				pshift = 1;
- 			}
- 		}
--		
-+
- 		p[0] |= 1;
- 		head += width;
- 	}
- 
--	trinkle(head, width, cmp, p, pshift, 0, lp);
-+	trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 
- 	while(pshift != 1 || p[0] != 1 || p[1] != 0) {
- 		if(pshift <= 1) {
-@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 			pshift -= 2;
- 			p[0] ^= 7;
- 			shr(p, 1);
--			trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
-+			trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
- 			shl(p, 1);
- 			p[0] |= 1;
--			trinkle(head - width, width, cmp, p, pshift, 1, lp);
-+			trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
- 		}
- 		head -= width;
- 	}
- }
-+
-+weak_alias(__qsort_r, qsort_r);
-diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c
-new file mode 100644
-index 000000000..efe7ccecd
---- /dev/null
-+++ b/src/stdlib/qsort_nr.c
-@@ -0,0 +1,14 @@
-+#define _BSD_SOURCE
-+#include <stdlib.h>
-+
-+typedef int (*cmpfun)(const void *, const void *);
-+
-+static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
-+{
-+	return ((cmpfun)cmp)(v1, v2);
-+}
-+
-+void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+{
-+	__qsort_r(base, nel, width, wrapper_cmp, cmp);
-+}
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d45..0000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch b/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
deleted file mode 100644
index 21f236b3a6cd1..0000000000000
--- a/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a5aff1972c9e3981566414b09a28e331ccd2be5d Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 17 Sep 2020 15:09:46 -0400
-Subject: [PATCH 237/513] avoid set*id/setrlimit misbehavior and hang in
- vforked/cloned child
-
-taking the deprecated/dropped vfork spec strictly, doing pretty much
-anything but execve in the child is wrong and undefined. however,
-these are commonly needed operations to setup the child state before
-exec, and historical implementations tolerated them.
-
-for single-threaded parents, these operations already worked as
-expected in the vforked child. however, due to the need for __synccall
-to synchronize id/resource limit changes among all threads, calling
-these functions in the vforked child of a multithreaded parent caused
-a misdirected broadcast signaling of all threads in the parent. these
-signals could kill the parent entirely if the synccall signal handler
-had never been installed in the parent, or could be ignored if it had,
-or could signal/kill one or more utterly wrong processes if the parent
-already terminated (due to vfork semantics, only possible via fatal
-signal) and the parent tids were recycled. in any case, the expected
-number of semaphore posts would never happen, so the child would
-permanently hang (with all signals blocked) waiting for them.
-
-to mitigate this, and also make the normal usage case work as
-intended, treat the condition where the caller's actual tid does not
-match the tid in its thread structure as single-threaded, and bypass
-the entire synccall broadcast operation.
----
- src/thread/synccall.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/thread/synccall.c b/src/thread/synccall.c
-index 648a6ad4..d58c851f 100644
---- a/src/thread/synccall.c
-+++ b/src/thread/synccall.c
-@@ -63,7 +63,8 @@ void __synccall(void (*func)(void *), void *ctx)
- 	sem_init(&target_sem, 0, 0);
- 	sem_init(&caller_sem, 0, 0);
- 
--	if (!libc.threads_minus_1) goto single_threaded;
-+	if (!libc.threads_minus_1 || __syscall(SYS_gettid) != self->tid)
-+		goto single_threaded;
- 
- 	callback = func;
- 	context = ctx;
--- 
-2.41.0
-
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8eb..0000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f91..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f83..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a6..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b880..0000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd9..0000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188fa..0000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c700..0000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f1..0000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d5..0000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f1..0000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea23..0000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index e0e05c2df0995..9ebf8118ed6d8 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=17
+version=1.2.4
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"

From 398a83c75a9a4309813cac80bfd867fcfa654bcc Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 2/3] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index e6f1684ed370d..3506e704f3f07 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=2
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.4_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From ea968b8edccb5e9b791f871f1cad76dc15a77d98 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 3/3] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca9601..303a7f50e4738 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.4_1";;
 	*) depends+=" glibc-devel";;
 esac

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl 1.2
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (8 preceding siblings ...)
  2023-08-01 10:04 ` [PR PATCH] [Updated] " dkwo
@ 2023-10-31  1:45 ` github-actions
  2023-11-01 19:07 ` [PR PATCH] [Updated] " dkwo
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 34+ messages in thread
From: github-actions @ 2023-10-31  1:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/43106#issuecomment-1786305265

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] musl 1.2
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (9 preceding siblings ...)
  2023-10-31  1:45 ` github-actions
@ 2023-11-01 19:07 ` dkwo
  2024-01-31 20:36 ` dkwo
  2024-03-31 14:01 ` dkwo
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-11-01 19:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl 1.2
[ci skip]

- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along the lines of https://github.com/void-linux/xbps/pull/331

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 70524 bytes --]

From a5c1944f1105ddd07677364ce93325d47a2a2d54 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 1/3] musl: update to 1.2.4

---
 common/shlibs                                 |   2 +-
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...88a9da5e7b2925dda17a2d6820dddf1fb287.patch | 139 -----------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 srcpkgs/musl/patches/add-qsort_r.patch        | 201 ----------------
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 ...rlimit-misbehavior-and-hang-in-vfork.patch |  49 ----
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 ...son-of-digit-sequence-with-non.patch.patch |  38 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   7 +-
 28 files changed, 30 insertions(+), 1648 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-qsort_r.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index 9036a675c1ae5..15eda460150e4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -16,7 +16,7 @@
 # PLEASE NOTE: when multiple packages provide the same SONAME, the first
 # one (order top->bottom) is preferred over the next ones.
 #
-libc.so musl-1.1.24_7
+libc.so musl-1.2.3_1
 libc.so.6 glibc-2.36_1
 libm.so.6 glibc-2.36_1
 libpthread.so.0 glibc-2.36_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89ad..0000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 0000000000000..1ca36263691c7
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e30..0000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a62..0000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d9501957..0000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c59..0000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch b/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
deleted file mode 100644
index a8bfa66d6c47d..0000000000000
--- a/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 98e688a9da5e7b2925dda17a2d6820dddf1fb287 Mon Sep 17 00:00:00 2001
-From: Ismael Luceno <ismael@iodev.co.uk>
-Date: Sun, 15 Aug 2021 17:51:57 +0200
-Subject: [PATCH] define NULL as nullptr when used in C++11 or later
-
-This should be safer for casting and more compatible with existing code
-bases that wrongly assume it must be defined as a pointer.
----
- include/locale.h | 4 +++-
- include/stddef.h | 4 +++-
- include/stdio.h  | 4 +++-
- include/stdlib.h | 4 +++-
- include/string.h | 4 +++-
- include/time.h   | 4 +++-
- include/unistd.h | 4 +++-
- include/wchar.h  | 4 +++-
- 8 files changed, 24 insertions(+), 8 deletions(-)
-
-diff --git a/include/locale.h b/include/locale.h
-index ce384381c..11106fea8 100644
---- a/include/locale.h
-+++ b/include/locale.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stddef.h b/include/stddef.h
-index bd7538535..f25b86396 100644
---- a/include/stddef.h
-+++ b/include/stddef.h
-@@ -1,7 +1,9 @@
- #ifndef _STDDEF_H
- #define _STDDEF_H
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stdio.h b/include/stdio.h
-index 3604198c3..d1ed01f03 100644
---- a/include/stdio.h
-+++ b/include/stdio.h
-@@ -25,7 +25,9 @@ extern "C" {
- 
- #include <bits/alltypes.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 7af86e3bc..b507ca33b 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/string.h b/include/string.h
-index 795a2abcd..43ad0942e 100644
---- a/include/string.h
-+++ b/include/string.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/time.h b/include/time.h
-index 5494df183..3d9483720 100644
---- a/include/time.h
-+++ b/include/time.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/unistd.h b/include/unistd.h
-index 130640260..ee2dbe8af 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -15,7 +15,9 @@ extern "C" {
- #define SEEK_CUR 1
- #define SEEK_END 2
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/wchar.h b/include/wchar.h
-index 88eb55b18..ed5d774df 100644
---- a/include/wchar.h
-+++ b/include/wchar.h
-@@ -38,7 +38,9 @@ extern "C" {
- #define WCHAR_MIN (-1-0x7fffffff+L'\0')
- #endif
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce9..0000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f0..0000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e53..0000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-qsort_r.patch b/srcpkgs/musl/patches/add-qsort_r.patch
deleted file mode 100644
index 3d85496afb69f..0000000000000
--- a/srcpkgs/musl/patches/add-qsort_r.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From b76f37fd5625d038141b52184956fb4b7838e9a5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
-Date: Tue, 9 Mar 2021 18:02:13 -0300
-Subject: [PATCH] add qsort_r and make qsort a wrapper around it
-
-we make qsort a wrapper by providing a wrapper_cmp function that uses
-the extra argument as a function pointer. should be optimized to a tail
-call on most architectures, as long as it's built with
--fomit-frame-pointer, so the performance impact should be minimal.
-
-to keep the git history clean, for now qsort_r is implemented in qsort.c
-and qsort is implemented in qsort_nr.c.  qsort.c also received a few
-trivial cleanups, including replacing (*cmp)() calls with cmp().
-qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
-itself.
----
- include/stdlib.h      |  1 +
- src/include/stdlib.h  |  1 +
- src/stdlib/qsort.c    | 37 ++++++++++++++++++++-----------------
- src/stdlib/qsort_nr.c | 14 ++++++++++++++
- 4 files changed, 36 insertions(+), 17 deletions(-)
- create mode 100644 src/stdlib/qsort_nr.c
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index b54a051fe..7af86e3bc 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -146,6 +146,7 @@ int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
- void *reallocarray (void *, size_t, size_t);
-+void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/include/stdlib.h b/src/include/stdlib.h
-index e9da20158..812b04de2 100644
---- a/src/include/stdlib.h
-+++ b/src/include/stdlib.h
-@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
- hidden int __mkostemps(char *, int, int);
- hidden int __ptsname_r(int, char *, size_t);
- hidden char *__randname(char *);
-+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- 
- hidden void *__libc_malloc(size_t);
- hidden void *__libc_malloc_impl(size_t);
-diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
-index da58fd317..314ddc29d 100644
---- a/src/stdlib/qsort.c
-+++ b/src/stdlib/qsort.c
-@@ -24,6 +24,7 @@
- /* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
-    Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
- 
-+#define _BSD_SOURCE
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -31,7 +32,7 @@
- #include "atomic.h"
- #define ntz(x) a_ctz_l((x))
- 
--typedef int (*cmpfun)(const void *, const void *);
-+typedef int (*cmpfun)(const void *, const void *, void *);
- 
- static inline int pntz(size_t p[2]) {
- 	int r = ntz(p[0] - 1);
-@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
- 	p[1] >>= n;
- }
- 
--static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
-+static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
- {
- 	unsigned char *rt, *lf;
- 	unsigned char *ar[14 * sizeof(size_t) + 1];
-@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 		rt = head - width;
- 		lf = head - width - lp[pshift - 2];
- 
--		if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
-+		if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
- 			break;
- 		}
--		if((*cmp)(lf, rt) >= 0) {
-+		if(cmp(lf, rt, arg) >= 0) {
- 			ar[i++] = lf;
- 			head = lf;
- 			pshift -= 1;
-@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 	cycle(width, ar, i);
- }
- 
--static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
-+static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
- {
- 	unsigned char *stepson,
- 	              *rt, *lf;
-@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	ar[0] = head;
- 	while(p[0] != 1 || p[1] != 0) {
- 		stepson = head - lp[pshift];
--		if((*cmp)(stepson, ar[0]) <= 0) {
-+		if(cmp(stepson, ar[0], arg) <= 0) {
- 			break;
- 		}
- 		if(!trusty && pshift > 1) {
- 			rt = head - width;
- 			lf = head - width - lp[pshift - 2];
--			if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
-+			if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
- 				break;
- 			}
- 		}
-@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	}
- 	if(!trusty) {
- 		cycle(width, ar, i);
--		sift(head, width, cmp, pshift, lp);
-+		sift(head, width, cmp, arg, pshift, lp);
- 	}
- }
- 
--void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
- {
- 	size_t lp[12*sizeof(size_t)];
- 	size_t i, size = width * nel;
-@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 
- 	while(head < high) {
- 		if((p[0] & 3) == 3) {
--			sift(head, width, cmp, pshift, lp);
-+			sift(head, width, cmp, arg, pshift, lp);
- 			shr(p, 2);
- 			pshift += 2;
- 		} else {
- 			if(lp[pshift - 1] >= high - head) {
--				trinkle(head, width, cmp, p, pshift, 0, lp);
-+				trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 			} else {
--				sift(head, width, cmp, pshift, lp);
-+				sift(head, width, cmp, arg, pshift, lp);
- 			}
--			
-+
- 			if(pshift == 1) {
- 				shl(p, 1);
- 				pshift = 0;
-@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 				pshift = 1;
- 			}
- 		}
--		
-+
- 		p[0] |= 1;
- 		head += width;
- 	}
- 
--	trinkle(head, width, cmp, p, pshift, 0, lp);
-+	trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 
- 	while(pshift != 1 || p[0] != 1 || p[1] != 0) {
- 		if(pshift <= 1) {
-@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 			pshift -= 2;
- 			p[0] ^= 7;
- 			shr(p, 1);
--			trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
-+			trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
- 			shl(p, 1);
- 			p[0] |= 1;
--			trinkle(head - width, width, cmp, p, pshift, 1, lp);
-+			trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
- 		}
- 		head -= width;
- 	}
- }
-+
-+weak_alias(__qsort_r, qsort_r);
-diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c
-new file mode 100644
-index 000000000..efe7ccecd
---- /dev/null
-+++ b/src/stdlib/qsort_nr.c
-@@ -0,0 +1,14 @@
-+#define _BSD_SOURCE
-+#include <stdlib.h>
-+
-+typedef int (*cmpfun)(const void *, const void *);
-+
-+static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
-+{
-+	return ((cmpfun)cmp)(v1, v2);
-+}
-+
-+void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+{
-+	__qsort_r(base, nel, width, wrapper_cmp, cmp);
-+}
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d45..0000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch b/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
deleted file mode 100644
index 21f236b3a6cd1..0000000000000
--- a/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a5aff1972c9e3981566414b09a28e331ccd2be5d Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 17 Sep 2020 15:09:46 -0400
-Subject: [PATCH 237/513] avoid set*id/setrlimit misbehavior and hang in
- vforked/cloned child
-
-taking the deprecated/dropped vfork spec strictly, doing pretty much
-anything but execve in the child is wrong and undefined. however,
-these are commonly needed operations to setup the child state before
-exec, and historical implementations tolerated them.
-
-for single-threaded parents, these operations already worked as
-expected in the vforked child. however, due to the need for __synccall
-to synchronize id/resource limit changes among all threads, calling
-these functions in the vforked child of a multithreaded parent caused
-a misdirected broadcast signaling of all threads in the parent. these
-signals could kill the parent entirely if the synccall signal handler
-had never been installed in the parent, or could be ignored if it had,
-or could signal/kill one or more utterly wrong processes if the parent
-already terminated (due to vfork semantics, only possible via fatal
-signal) and the parent tids were recycled. in any case, the expected
-number of semaphore posts would never happen, so the child would
-permanently hang (with all signals blocked) waiting for them.
-
-to mitigate this, and also make the normal usage case work as
-intended, treat the condition where the caller's actual tid does not
-match the tid in its thread structure as single-threaded, and bypass
-the entire synccall broadcast operation.
----
- src/thread/synccall.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/thread/synccall.c b/src/thread/synccall.c
-index 648a6ad4..d58c851f 100644
---- a/src/thread/synccall.c
-+++ b/src/thread/synccall.c
-@@ -63,7 +63,8 @@ void __synccall(void (*func)(void *), void *ctx)
- 	sem_init(&target_sem, 0, 0);
- 	sem_init(&caller_sem, 0, 0);
- 
--	if (!libc.threads_minus_1) goto single_threaded;
-+	if (!libc.threads_minus_1 || __syscall(SYS_gettid) != self->tid)
-+		goto single_threaded;
- 
- 	callback = func;
- 	context = ctx;
--- 
-2.41.0
-
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8eb..0000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f91..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f83..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a6..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch b/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
deleted file mode 100644
index e0f0b8bffffc9..0000000000000
--- a/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From b50eb8c36c20f967bd0ed70c0b0db38a450886ba Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 7 Nov 2022 22:17:55 -0500
-Subject: [PATCH] fix strverscmp comparison of digit sequence with non-digits
-
-the rule that longest digit sequence not beginning with a zero is
-greater only applies when both sequences being compared are
-non-degenerate. this is spelled out explicitly in the man page, which
-may be deemed authoritative for this nonstandard function: "If one or
-both of these is empty, then return what strcmp(3) would have
-returned..."
-
-we were wrongly treating any sequence of digits not beginning with a
-zero as greater than a non-digit in the other string.
----
- src/string/strverscmp.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/string/strverscmp.c b/src/string/strverscmp.c
-index 4daf276d..16c1da22 100644
---- a/src/string/strverscmp.c
-+++ b/src/string/strverscmp.c
-@@ -18,9 +18,9 @@ int strverscmp(const char *l0, const char *r0)
- 		else if (c!='0') z=0;
- 	}
- 
--	if (l[dp]!='0' && r[dp]!='0') {
--		/* If we're not looking at a digit sequence that began
--		 * with a zero, longest digit string is greater. */
-+	if (l[dp]-'1'<9U && r[dp]-'1'<9U) {
-+		/* If we're looking at non-degenerate digit sequences starting
-+		 * with nonzero digits, longest digit string is greater. */
- 		for (j=i; isdigit(l[j]); j++)
- 			if (!isdigit(r[j])) return 1;
- 		if (isdigit(r[j])) return -1;
--- 
-2.41.0
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b880..0000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd9..0000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188fa..0000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c700..0000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f1..0000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d5..0000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f1..0000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea23..0000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 6c98fac0962e9..9ebf8118ed6d8 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=18
+version=1.2.4
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"

From 6d9930d943a9032d7815194a867531595877fa2d Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 2/3] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index e6f1684ed370d..3506e704f3f07 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=2
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.4_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From c108a921a85b5a7845b96cb856c184ea8fff00ad Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 3/3] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca9601..303a7f50e4738 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.4_1";;
 	*) depends+=" glibc-devel";;
 esac

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] musl 1.2
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (10 preceding siblings ...)
  2023-11-01 19:07 ` [PR PATCH] [Updated] " dkwo
@ 2024-01-31 20:36 ` dkwo
  2024-03-31 14:01 ` dkwo
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2024-01-31 20:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl 1.2
[ci skip]

- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along the lines of https://github.com/void-linux/xbps/pull/331 (or some other solution)
- remove configure arg for 2038 in coreutils for arm32

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 76659 bytes --]

From 29b097d776c258f0bfd6f2af2db2a725b02afd92 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 1/3] musl: update to 1.2.4

---
 common/shlibs                                 |   2 +-
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...88a9da5e7b2925dda17a2d6820dddf1fb287.patch | 139 -----------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 srcpkgs/musl/patches/add-qsort_r.patch        | 201 ----------------
 srcpkgs/musl/patches/add-rlimit-rttime.patch  |  24 --
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 ...rlimit-misbehavior-and-hang-in-vfork.patch |  49 ----
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 ...x-oob-read-processing-time-zone-data.patch |  80 -------
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 ...son-of-digit-sequence-with-non.patch.patch |  38 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 srcpkgs/musl/patches/riscv64-ucontext.patch   |  29 ---
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   7 +-
 31 files changed, 30 insertions(+), 1781 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-qsort_r.patch
 delete mode 100644 srcpkgs/musl/patches/add-rlimit-rttime.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-oob-read-processing-time-zone-data.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/riscv64-ucontext.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index 71f172740e5c6..44bb8e9fc7b15 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -16,7 +16,7 @@
 # PLEASE NOTE: when multiple packages provide the same SONAME, the first
 # one (order top->bottom) is preferred over the next ones.
 #
-libc.so musl-1.1.24_7
+libc.so musl-1.2.4_1
 libc.so.6 glibc-2.38_1
 libm.so.6 glibc-2.38_1
 libpthread.so.0 glibc-2.38_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89ad..0000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 0000000000000..1ca36263691c7
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e30..0000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a62..0000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d9501957..0000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c59..0000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch b/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
deleted file mode 100644
index a8bfa66d6c47d..0000000000000
--- a/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 98e688a9da5e7b2925dda17a2d6820dddf1fb287 Mon Sep 17 00:00:00 2001
-From: Ismael Luceno <ismael@iodev.co.uk>
-Date: Sun, 15 Aug 2021 17:51:57 +0200
-Subject: [PATCH] define NULL as nullptr when used in C++11 or later
-
-This should be safer for casting and more compatible with existing code
-bases that wrongly assume it must be defined as a pointer.
----
- include/locale.h | 4 +++-
- include/stddef.h | 4 +++-
- include/stdio.h  | 4 +++-
- include/stdlib.h | 4 +++-
- include/string.h | 4 +++-
- include/time.h   | 4 +++-
- include/unistd.h | 4 +++-
- include/wchar.h  | 4 +++-
- 8 files changed, 24 insertions(+), 8 deletions(-)
-
-diff --git a/include/locale.h b/include/locale.h
-index ce384381c..11106fea8 100644
---- a/include/locale.h
-+++ b/include/locale.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stddef.h b/include/stddef.h
-index bd7538535..f25b86396 100644
---- a/include/stddef.h
-+++ b/include/stddef.h
-@@ -1,7 +1,9 @@
- #ifndef _STDDEF_H
- #define _STDDEF_H
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stdio.h b/include/stdio.h
-index 3604198c3..d1ed01f03 100644
---- a/include/stdio.h
-+++ b/include/stdio.h
-@@ -25,7 +25,9 @@ extern "C" {
- 
- #include <bits/alltypes.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 7af86e3bc..b507ca33b 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/string.h b/include/string.h
-index 795a2abcd..43ad0942e 100644
---- a/include/string.h
-+++ b/include/string.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/time.h b/include/time.h
-index 5494df183..3d9483720 100644
---- a/include/time.h
-+++ b/include/time.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/unistd.h b/include/unistd.h
-index 130640260..ee2dbe8af 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -15,7 +15,9 @@ extern "C" {
- #define SEEK_CUR 1
- #define SEEK_END 2
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/wchar.h b/include/wchar.h
-index 88eb55b18..ed5d774df 100644
---- a/include/wchar.h
-+++ b/include/wchar.h
-@@ -38,7 +38,9 @@ extern "C" {
- #define WCHAR_MIN (-1-0x7fffffff+L'\0')
- #endif
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce9..0000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f0..0000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e53..0000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-qsort_r.patch b/srcpkgs/musl/patches/add-qsort_r.patch
deleted file mode 100644
index 3d85496afb69f..0000000000000
--- a/srcpkgs/musl/patches/add-qsort_r.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From b76f37fd5625d038141b52184956fb4b7838e9a5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
-Date: Tue, 9 Mar 2021 18:02:13 -0300
-Subject: [PATCH] add qsort_r and make qsort a wrapper around it
-
-we make qsort a wrapper by providing a wrapper_cmp function that uses
-the extra argument as a function pointer. should be optimized to a tail
-call on most architectures, as long as it's built with
--fomit-frame-pointer, so the performance impact should be minimal.
-
-to keep the git history clean, for now qsort_r is implemented in qsort.c
-and qsort is implemented in qsort_nr.c.  qsort.c also received a few
-trivial cleanups, including replacing (*cmp)() calls with cmp().
-qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
-itself.
----
- include/stdlib.h      |  1 +
- src/include/stdlib.h  |  1 +
- src/stdlib/qsort.c    | 37 ++++++++++++++++++++-----------------
- src/stdlib/qsort_nr.c | 14 ++++++++++++++
- 4 files changed, 36 insertions(+), 17 deletions(-)
- create mode 100644 src/stdlib/qsort_nr.c
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index b54a051fe..7af86e3bc 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -146,6 +146,7 @@ int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
- void *reallocarray (void *, size_t, size_t);
-+void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/include/stdlib.h b/src/include/stdlib.h
-index e9da20158..812b04de2 100644
---- a/src/include/stdlib.h
-+++ b/src/include/stdlib.h
-@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
- hidden int __mkostemps(char *, int, int);
- hidden int __ptsname_r(int, char *, size_t);
- hidden char *__randname(char *);
-+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- 
- hidden void *__libc_malloc(size_t);
- hidden void *__libc_malloc_impl(size_t);
-diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
-index da58fd317..314ddc29d 100644
---- a/src/stdlib/qsort.c
-+++ b/src/stdlib/qsort.c
-@@ -24,6 +24,7 @@
- /* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
-    Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
- 
-+#define _BSD_SOURCE
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -31,7 +32,7 @@
- #include "atomic.h"
- #define ntz(x) a_ctz_l((x))
- 
--typedef int (*cmpfun)(const void *, const void *);
-+typedef int (*cmpfun)(const void *, const void *, void *);
- 
- static inline int pntz(size_t p[2]) {
- 	int r = ntz(p[0] - 1);
-@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
- 	p[1] >>= n;
- }
- 
--static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
-+static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
- {
- 	unsigned char *rt, *lf;
- 	unsigned char *ar[14 * sizeof(size_t) + 1];
-@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 		rt = head - width;
- 		lf = head - width - lp[pshift - 2];
- 
--		if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
-+		if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
- 			break;
- 		}
--		if((*cmp)(lf, rt) >= 0) {
-+		if(cmp(lf, rt, arg) >= 0) {
- 			ar[i++] = lf;
- 			head = lf;
- 			pshift -= 1;
-@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 	cycle(width, ar, i);
- }
- 
--static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
-+static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
- {
- 	unsigned char *stepson,
- 	              *rt, *lf;
-@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	ar[0] = head;
- 	while(p[0] != 1 || p[1] != 0) {
- 		stepson = head - lp[pshift];
--		if((*cmp)(stepson, ar[0]) <= 0) {
-+		if(cmp(stepson, ar[0], arg) <= 0) {
- 			break;
- 		}
- 		if(!trusty && pshift > 1) {
- 			rt = head - width;
- 			lf = head - width - lp[pshift - 2];
--			if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
-+			if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
- 				break;
- 			}
- 		}
-@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	}
- 	if(!trusty) {
- 		cycle(width, ar, i);
--		sift(head, width, cmp, pshift, lp);
-+		sift(head, width, cmp, arg, pshift, lp);
- 	}
- }
- 
--void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
- {
- 	size_t lp[12*sizeof(size_t)];
- 	size_t i, size = width * nel;
-@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 
- 	while(head < high) {
- 		if((p[0] & 3) == 3) {
--			sift(head, width, cmp, pshift, lp);
-+			sift(head, width, cmp, arg, pshift, lp);
- 			shr(p, 2);
- 			pshift += 2;
- 		} else {
- 			if(lp[pshift - 1] >= high - head) {
--				trinkle(head, width, cmp, p, pshift, 0, lp);
-+				trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 			} else {
--				sift(head, width, cmp, pshift, lp);
-+				sift(head, width, cmp, arg, pshift, lp);
- 			}
--			
-+
- 			if(pshift == 1) {
- 				shl(p, 1);
- 				pshift = 0;
-@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 				pshift = 1;
- 			}
- 		}
--		
-+
- 		p[0] |= 1;
- 		head += width;
- 	}
- 
--	trinkle(head, width, cmp, p, pshift, 0, lp);
-+	trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 
- 	while(pshift != 1 || p[0] != 1 || p[1] != 0) {
- 		if(pshift <= 1) {
-@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 			pshift -= 2;
- 			p[0] ^= 7;
- 			shr(p, 1);
--			trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
-+			trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
- 			shl(p, 1);
- 			p[0] |= 1;
--			trinkle(head - width, width, cmp, p, pshift, 1, lp);
-+			trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
- 		}
- 		head -= width;
- 	}
- }
-+
-+weak_alias(__qsort_r, qsort_r);
-diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c
-new file mode 100644
-index 000000000..efe7ccecd
---- /dev/null
-+++ b/src/stdlib/qsort_nr.c
-@@ -0,0 +1,14 @@
-+#define _BSD_SOURCE
-+#include <stdlib.h>
-+
-+typedef int (*cmpfun)(const void *, const void *);
-+
-+static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
-+{
-+	return ((cmpfun)cmp)(v1, v2);
-+}
-+
-+void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+{
-+	__qsort_r(base, nel, width, wrapper_cmp, cmp);
-+}
diff --git a/srcpkgs/musl/patches/add-rlimit-rttime.patch b/srcpkgs/musl/patches/add-rlimit-rttime.patch
deleted file mode 100644
index 56afa6b66521a..0000000000000
--- a/srcpkgs/musl/patches/add-rlimit-rttime.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 2507e7f5312e79620f6337935d0a6c9045ccba09 Mon Sep 17 00:00:00 2001
-From: Leah Neukirchen <leah@vuxu.org>
-Date: Sat, 11 Jan 2020 20:16:59 +0100
-Subject: [PATCH] define RLIMIT_RTTIME, bump RLIMIT_NLIMITS
-
-This macro exists since Linux 2.6.25 and is defined in glibc since 2011.
----
- include/sys/resource.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/include/sys/resource.h b/include/sys/resource.h
-index e0c86ae33..3068328d0 100644
---- a/include/sys/resource.h
-+++ b/include/sys/resource.h
-@@ -90,7 +90,8 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
- #define RLIMIT_MSGQUEUE 12
- #define RLIMIT_NICE    13
- #define RLIMIT_RTPRIO  14
--#define RLIMIT_NLIMITS 15
-+#define RLIMIT_RTTIME  15
-+#define RLIMIT_NLIMITS 16
- 
- #define RLIM_NLIMITS RLIMIT_NLIMITS
- 
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d45..0000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch b/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
deleted file mode 100644
index 21f236b3a6cd1..0000000000000
--- a/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a5aff1972c9e3981566414b09a28e331ccd2be5d Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 17 Sep 2020 15:09:46 -0400
-Subject: [PATCH 237/513] avoid set*id/setrlimit misbehavior and hang in
- vforked/cloned child
-
-taking the deprecated/dropped vfork spec strictly, doing pretty much
-anything but execve in the child is wrong and undefined. however,
-these are commonly needed operations to setup the child state before
-exec, and historical implementations tolerated them.
-
-for single-threaded parents, these operations already worked as
-expected in the vforked child. however, due to the need for __synccall
-to synchronize id/resource limit changes among all threads, calling
-these functions in the vforked child of a multithreaded parent caused
-a misdirected broadcast signaling of all threads in the parent. these
-signals could kill the parent entirely if the synccall signal handler
-had never been installed in the parent, or could be ignored if it had,
-or could signal/kill one or more utterly wrong processes if the parent
-already terminated (due to vfork semantics, only possible via fatal
-signal) and the parent tids were recycled. in any case, the expected
-number of semaphore posts would never happen, so the child would
-permanently hang (with all signals blocked) waiting for them.
-
-to mitigate this, and also make the normal usage case work as
-intended, treat the condition where the caller's actual tid does not
-match the tid in its thread structure as single-threaded, and bypass
-the entire synccall broadcast operation.
----
- src/thread/synccall.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/thread/synccall.c b/src/thread/synccall.c
-index 648a6ad4..d58c851f 100644
---- a/src/thread/synccall.c
-+++ b/src/thread/synccall.c
-@@ -63,7 +63,8 @@ void __synccall(void (*func)(void *), void *ctx)
- 	sem_init(&target_sem, 0, 0);
- 	sem_init(&caller_sem, 0, 0);
- 
--	if (!libc.threads_minus_1) goto single_threaded;
-+	if (!libc.threads_minus_1 || __syscall(SYS_gettid) != self->tid)
-+		goto single_threaded;
- 
- 	callback = func;
- 	context = ctx;
--- 
-2.41.0
-
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8eb..0000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-oob-read-processing-time-zone-data.patch b/srcpkgs/musl/patches/fix-oob-read-processing-time-zone-data.patch
deleted file mode 100644
index 557cbd7446d9b..0000000000000
--- a/srcpkgs/musl/patches/fix-oob-read-processing-time-zone-data.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 3b7b4155570b4b9054465785be2992c92cb7d7b1 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Wed, 9 Feb 2022 17:48:43 -0500
-Subject: fix out-of-bound read processing time zone data with distant-past
- dates
-
-this bug goes back to commit 1cc81f5cb0df2b66a795ff0c26d7bbc4d16e13c6
-where zoneinfo file support was first added. in scan_trans, which
-searches for the appropriate local time/dst rule in effect at a given
-time, times prior to the second transition time caused the -1 slot of
-the index to be read to determine the previous rule in effect. this
-memory was always valid (part of another zoneinfo table in the mapped
-file) but the byte value read was then used to index another table,
-possibly going outside the bounds of the mmap. most of the time, the
-result was limited to misinterpretation of the rule in effect at that
-time (pre-1900s), but it could produce a crash if adjacent memory was
-not readable.
-
-the root cause of the problem, however, was that the logic for this
-code path was all wrong. as documented in the comment, times before
-the first transition should be treated as using the lowest-numbered
-non-dst rule, or rule 0 if no non-dst rules exist. if the argument is
-in units of local time, however, the rule prior to the first
-transition is needed to determine if it falls before or after it, and
-that's where the -1 index was wrongly used.
-
-instead, use the documented logic to find out what rule would be in
-effect before the first transition, and apply it as the offset if the
-argument was given in local time.
-
-the new code has not been heavily tested, but no longer performs
-potentially out-of-bounds accesses, and successfully handles the 1883
-transition from local mean time to central standard time in the test
-case the error was reported for.
----
- src/time/__tz.c | 26 ++++++++++++--------------
- 1 file changed, 12 insertions(+), 14 deletions(-)
-
-diff --git a/src/time/__tz.c b/src/time/__tz.c
-index 3e2fcdcb..c34b3eb7 100644
---- a/src/time/__tz.c
-+++ b/src/time/__tz.c
-@@ -293,22 +293,20 @@ static size_t scan_trans(long long t, int local, size_t *alt)
- 	n = (index-trans)>>scale;
- 	if (a == n-1) return -1;
- 	if (a == 0) {
--		x = zi_read32(trans + (a<<scale));
--		if (scale == 3) x = x<<32 | zi_read32(trans + (a<<scale) + 4);
-+		x = zi_read32(trans);
-+		if (scale == 3) x = x<<32 | zi_read32(trans + 4);
- 		else x = (int32_t)x;
--		if (local) off = (int32_t)zi_read32(types + 6 * index[a-1]);
-+		/* Find the lowest non-DST type, or 0 if none. */
-+		size_t j = 0;
-+		for (size_t i=abbrevs-types; i; i-=6) {
-+			if (!types[i-6+4]) j = i-6;
-+		}
-+		if (local) off = (int32_t)zi_read32(types + j);
-+		/* If t is before first transition, use the above-found type
-+		 * and the index-zero (after transition) type as the alt. */
- 		if (t - off < (int64_t)x) {
--			for (a=0; a<(abbrevs-types)/6; a++) {
--				if (types[6*a+4] != types[4]) break;
--			}
--			if (a == (abbrevs-types)/6) a = 0;
--			if (types[6*a+4]) {
--				*alt = a;
--				return 0;
--			} else {
--				*alt = 0;
--				return a;
--			}
-+			if (alt) *alt = index[0];
-+			return j/6;
- 		}
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f91..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f83..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a6..0000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch b/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
deleted file mode 100644
index e0f0b8bffffc9..0000000000000
--- a/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From b50eb8c36c20f967bd0ed70c0b0db38a450886ba Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 7 Nov 2022 22:17:55 -0500
-Subject: [PATCH] fix strverscmp comparison of digit sequence with non-digits
-
-the rule that longest digit sequence not beginning with a zero is
-greater only applies when both sequences being compared are
-non-degenerate. this is spelled out explicitly in the man page, which
-may be deemed authoritative for this nonstandard function: "If one or
-both of these is empty, then return what strcmp(3) would have
-returned..."
-
-we were wrongly treating any sequence of digits not beginning with a
-zero as greater than a non-digit in the other string.
----
- src/string/strverscmp.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/string/strverscmp.c b/src/string/strverscmp.c
-index 4daf276d..16c1da22 100644
---- a/src/string/strverscmp.c
-+++ b/src/string/strverscmp.c
-@@ -18,9 +18,9 @@ int strverscmp(const char *l0, const char *r0)
- 		else if (c!='0') z=0;
- 	}
- 
--	if (l[dp]!='0' && r[dp]!='0') {
--		/* If we're not looking at a digit sequence that began
--		 * with a zero, longest digit string is greater. */
-+	if (l[dp]-'1'<9U && r[dp]-'1'<9U) {
-+		/* If we're looking at non-degenerate digit sequences starting
-+		 * with nonzero digits, longest digit string is greater. */
- 		for (j=i; isdigit(l[j]); j++)
- 			if (!isdigit(r[j])) return 1;
- 		if (isdigit(r[j])) return -1;
--- 
-2.41.0
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b880..0000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd9..0000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188fa..0000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c700..0000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f1..0000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d5..0000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f1..0000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/riscv64-ucontext.patch b/srcpkgs/musl/patches/riscv64-ucontext.patch
deleted file mode 100644
index 5afac82b6d21d..0000000000000
--- a/srcpkgs/musl/patches/riscv64-ucontext.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 56f0631d9553dc06530ff661527cf1fcd595a0d1 Mon Sep 17 00:00:00 2001
-From: Drew DeVault <sir@cmpwn.com>
-Date: Sat, 5 Dec 2020 18:10:06 +0000
-Subject: [PATCH] riscv64: fix inconsistent ucontext_t struct tag
-
-ucontext.h depends on the internal struct tag name for namespacing
-reasons, and the intent was always for it to be consistent across
-archs anyway.
----
- arch/riscv64/bits/signal.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/riscv64/bits/signal.h b/arch/riscv64/bits/signal.h
-index b006334f7..287367db7 100644
---- a/arch/riscv64/bits/signal.h
-+++ b/arch/riscv64/bits/signal.h
-@@ -60,10 +60,10 @@ struct sigaltstack {
- 	size_t ss_size;
- };
- 
--typedef struct ucontext_t
-+typedef struct __ucontext
- {
- 	unsigned long uc_flags;
--	struct ucontext_t *uc_link;
-+	struct __ucontext *uc_link;
- 	stack_t uc_stack;
- 	sigset_t uc_sigmask;
- 	mcontext_t uc_mcontext;
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea23..0000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 8c3be7d76e8a1..9ebf8118ed6d8 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=20
+version=1.2.4
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"

From 674533398d38c6a13b3d27de228a7fef5ede8453 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 2/3] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index e6f1684ed370d..3506e704f3f07 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=2
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.4_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From 7bc5cfb486ecea28c05b50f41c8611cf1415b9dd Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 3/3] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca9601..303a7f50e4738 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.4_1";;
 	*) depends+=" glibc-devel";;
 esac

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] musl 1.2
  2023-03-29 19:35 [PR PATCH] musl dkwo
                   ` (11 preceding siblings ...)
  2024-01-31 20:36 ` dkwo
@ 2024-03-31 14:01 ` dkwo
  12 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2024-03-31 14:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

There is an updated pull request by dkwo against master on the void-packages repository

https://github.com/dkwo/void-packages musl
https://github.com/void-linux/void-packages/pull/43106

musl 1.2
[ci skip]

- I tested the changes in this PR: yes
- I built this PR locally for my native architecture, (x86_64-musl)
- keeping the large-file patch, for now
- requires changes to xbps, along the lines of https://github.com/void-linux/xbps/pull/331 (or some other solution)
- remove configure arg for 2038 in coreutils for arm32

A patch file from https://github.com/void-linux/void-packages/pull/43106.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-musl-43106.patch --]
[-- Type: text/x-diff, Size: 79761 bytes --]

From 8e62c963eac04fa96bd9b77e2f17f0b93517ddb6 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:08:16 -0400
Subject: [PATCH 1/3] base-chroot: bump musl-devel version

---
 srcpkgs/base-chroot/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/base-chroot/template b/srcpkgs/base-chroot/template
index dce82291617a42..3506e704f3f07e 100644
--- a/srcpkgs/base-chroot/template
+++ b/srcpkgs/base-chroot/template
@@ -1,7 +1,7 @@
 # Template file for 'base-chroot'
 pkgname=base-chroot
-version=0.67
-revision=3
+version=0.68
+revision=1
 bootstrap=yes
 build_style=meta
 short_desc="Minimal set of packages required for chroot with xbps-src"
@@ -11,7 +11,7 @@ homepage="http://www.voidlinux.org"
 repository=bootstrap
 
 case "$XBPS_TARGET_LIBC" in
-	musl) depends="musl-devel";;
+	musl) depends="musl-devel>=1.2.4_1";;
 	*) depends="glibc-devel glibc-locales";;
 esac
 

From d7d2f93a85cd0023119d741c22b4fef0479008be Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Wed, 29 Mar 2023 15:09:01 -0400
Subject: [PATCH 2/3] base-devel: bump musl-devel version

---
 srcpkgs/base-devel/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/base-devel/template b/srcpkgs/base-devel/template
index 570f699ca96018..303a7f50e47384 100644
--- a/srcpkgs/base-devel/template
+++ b/srcpkgs/base-devel/template
@@ -1,7 +1,7 @@
 # Template file for 'base-devel'
 pkgname=base-devel
 version=20181003
-revision=2
+revision=3
 build_style=meta
 depends="autoconf automake bc binutils bison ed flex gcc gettext
  groff libtool m4 make patch pkg-config texinfo unzip xz"
@@ -12,6 +12,6 @@ homepage="http://www.voidlinux.org/"
 lib32disabled=yes
 
 case "$XBPS_TARGET_MACHINE" in
-	*-musl) depends+=" musl-devel";;
+	*-musl) depends+=" musl-devel>=1.2.4_1";;
 	*) depends+=" glibc-devel";;
 esac

From 87223706733f1fd546f8274567b0979ee301f0fb Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Thu, 13 May 2021 13:51:08 +0200
Subject: [PATCH 3/3] musl: update to 1.2.5

---
 common/shlibs                                 |  26 +++
 srcpkgs/musl/patches/00-reallocarray.patch    |  42 ----
 .../patches/0001-remove-O_LARGEFILE.patch     |  26 +++
 ...ist_unlink_in_pthread_exit_after_all.patch |  56 -----
 ...hreads_minus_1_as_relaxed_atomic_for.patch |  78 -------
 ...own_size_of_some_libc_struct_members.patch |  30 ---
 ...pping_for_processes_that_return_to_s.patch | 102 --------
 ...88a9da5e7b2925dda17a2d6820dddf1fb287.patch | 139 -----------
 ...098a885feae3ae8c32b407350d8ca85dd178.patch | 113 ---------
 srcpkgs/musl/patches/CVE-2020-28928.patch     |  64 -----
 srcpkgs/musl/patches/aarch64-fregs.patch      |  37 ---
 srcpkgs/musl/patches/add-qsort_r.patch        | 201 ----------------
 srcpkgs/musl/patches/add-rlimit-rttime.patch  |  24 --
 ...d-support-for-SIGEV_THREAD_ID-timers.patch |  74 ------
 ...rlimit-misbehavior-and-hang-in-vfork.patch |  49 ----
 srcpkgs/musl/patches/c23-basename.patch       |  44 ----
 srcpkgs/musl/patches/epoll_cp.patch           |  28 ---
 ...x-oob-read-processing-time-zone-data.patch |  80 -------
 .../musl/patches/fix-pi-mutex-cond-1.patch    |  56 -----
 .../musl/patches/fix-pi-mutex-cond-2.patch    |  48 ----
 .../musl/patches/fix-pi-mutex-cond-3.patch    |  28 ---
 ...son-of-digit-sequence-with-non.patch.patch |  38 ---
 srcpkgs/musl/patches/gettid.patch             |  49 ----
 ...tly_instead_of_using_procfs_readlink.patch | 219 ------------------
 srcpkgs/musl/patches/isascii.patch            |  21 --
 srcpkgs/musl/patches/mo_lookup.patch          |  19 --
 srcpkgs/musl/patches/ppc-pt_regs.patch        |  38 ---
 srcpkgs/musl/patches/ppc64-fpregset_t.patch   |  31 ---
 srcpkgs/musl/patches/ppcle.patch              |  24 --
 srcpkgs/musl/patches/riscv64-ucontext.patch   |  29 ---
 ...in_readlink_syscall_with_zero_buffer.patch |  59 -----
 srcpkgs/musl/template                         |   7 +-
 32 files changed, 55 insertions(+), 1824 deletions(-)
 delete mode 100644 srcpkgs/musl/patches/00-reallocarray.patch
 create mode 100644 srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
 delete mode 100644 srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
 delete mode 100644 srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
 delete mode 100644 srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
 delete mode 100644 srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
 delete mode 100644 srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
 delete mode 100644 srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
 delete mode 100644 srcpkgs/musl/patches/CVE-2020-28928.patch
 delete mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch
 delete mode 100644 srcpkgs/musl/patches/add-qsort_r.patch
 delete mode 100644 srcpkgs/musl/patches/add-rlimit-rttime.patch
 delete mode 100644 srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
 delete mode 100644 srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
 delete mode 100644 srcpkgs/musl/patches/c23-basename.patch
 delete mode 100644 srcpkgs/musl/patches/epoll_cp.patch
 delete mode 100644 srcpkgs/musl/patches/fix-oob-read-processing-time-zone-data.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
 delete mode 100644 srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
 delete mode 100644 srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
 delete mode 100644 srcpkgs/musl/patches/gettid.patch
 delete mode 100644 srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
 delete mode 100644 srcpkgs/musl/patches/isascii.patch
 delete mode 100644 srcpkgs/musl/patches/mo_lookup.patch
 delete mode 100644 srcpkgs/musl/patches/ppc-pt_regs.patch
 delete mode 100644 srcpkgs/musl/patches/ppc64-fpregset_t.patch
 delete mode 100644 srcpkgs/musl/patches/ppcle.patch
 delete mode 100644 srcpkgs/musl/patches/riscv64-ucontext.patch
 delete mode 100644 srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch

diff --git a/common/shlibs b/common/shlibs
index 1ee5b1f0544b5c..3ec72ad60ab196 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -47,6 +47,32 @@ libSegFault.so glibc-2.39_1
 libpcprofile.so glibc-2.39_1
 libcidn.so.1 glibc-2.39_1
 libmvec.so.1 glibc-2.39_1
+libc.so musl-1.2.4_1
+libc.so.6 glibc-2.38_1
+libm.so.6 glibc-2.38_1
+libpthread.so.0 glibc-2.38_1
+librt.so.1 glibc-2.38_1
+libdl.so.2 glibc-2.38_1
+ld-linux-x86-64.so.2 glibc-2.38_1 x86_64
+ld-linux.so.2 glibc-2.38_1 i686
+ld-linux.so.3 glibc-2.38_1 armv5tel
+ld-linux-aarch64.so.1 glibc-2.38_1 aarch64
+ld-linux-riscv64-lp64d.so.1 glibc-2.38_1 riscv64
+ld64.so.2 glibc-2.38_1 ppc64
+ld.so.1 glibc-2.38_1 mips
+ld.so.1 glibc-2.38_1 ppc
+ld-linux-armhf.so.3 glibc-2.38_1
+libresolv.so.2 glibc-2.38_1
+libanl.so.1 glibc-2.38_1
+libthread_db.so.1 glibc-2.38_1
+libutil.so.1 glibc-2.38_1
+libnsl.so.1 glibc-2.38_1
+libnss_db.so.2 glibc-2.38_1
+libnss_files.so.2 glibc-2.38_1
+libnss_compat.so.2 glibc-2.38_1
+libnss_dns.so.2 glibc-2.38_1
+libnss_hesiod.so.2 glibc-2.38_1
+libBrokenLocale.so.1 glibc-2.38_1
 libcrypt.so.2 libxcrypt-4.4.36_1
 libcrypt.so.1 libxcrypt-compat-4.4.36_1
 libSimGearCore.so.2020.3.17 simgear-2020.3.17_1
diff --git a/srcpkgs/musl/patches/00-reallocarray.patch b/srcpkgs/musl/patches/00-reallocarray.patch
deleted file mode 100644
index cfaab330e89adc..00000000000000
--- a/srcpkgs/musl/patches/00-reallocarray.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 821083ac7b54eaa040d5a8ddc67c6206a175e0ca Mon Sep 17 00:00:00 2001
-From: Ariadne Conill <ariadne@dereferenced.org>
-Date: Sat, 1 Aug 2020 08:26:35 -0600
-Subject: [PATCH] implement reallocarray
-
-reallocarray is an extension introduced by OpenBSD, which introduces
-calloc overflow checking to realloc.
-
-glibc 2.28 introduced support for this function behind _GNU_SOURCE,
-while glibc 2.29 allows its usage in _DEFAULT_SOURCE.
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 194c2033..b54a051f 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -145,6 +145,7 @@ int getloadavg(double *, int);
- int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
-+void *reallocarray (void *, size_t, size_t);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
-new file mode 100644
-index 00000000..4a6ebe46
---- /dev/null
-+++ b/src/malloc/reallocarray.c
-@@ -0,0 +1,13 @@
-+#define _BSD_SOURCE
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+void *reallocarray(void *ptr, size_t m, size_t n)
-+{
-+	if (n && m > -1 / n) {
-+		errno = ENOMEM;
-+		return 0;
-+	}
-+
-+	return realloc(ptr, m * n);
-+}
diff --git a/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
new file mode 100644
index 00000000000000..1ca36263691c7a
--- /dev/null
+++ b/srcpkgs/musl/patches/0001-remove-O_LARGEFILE.patch
@@ -0,0 +1,26 @@
+From 7d554d0c786f5431ad3035a328815890a95a2979 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
+Date: Wed, 12 May 2021 17:39:20 -0300
+Subject: [PATCH] remove O_LARGEFILE
+
+useful hack to build 1.2.2 musl for x86_64 and not have to rebuild
+firefox.
+---
+ arch/generic/bits/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/generic/bits/fcntl.h b/arch/generic/bits/fcntl.h
+index 730a98cf..c2fd1760 100644
+--- a/arch/generic/bits/fcntl.h
++++ b/arch/generic/bits/fcntl.h
+@@ -13,7 +13,7 @@
+ 
+ #define O_ASYNC      020000
+ #define O_DIRECT     040000
+-#define O_LARGEFILE 0100000
++#define O_LARGEFILE 0
+ #define O_NOATIME  01000000
+ #define O_PATH    010000000
+ #define O_TMPFILE 020200000
+-- 
+2.31.1
diff --git a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch b/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
deleted file mode 100644
index 7c1a55bc85e307..00000000000000
--- a/srcpkgs/musl/patches/0001_reorder_thread_list_unlink_in_pthread_exit_after_all.patch
+++ /dev/null
@@ -1,56 +0,0 @@
->From 4d5aa20a94a2d3fae3e69289dc23ecafbd0c16c4 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:35:14 -0400
-Subject: [PATCH 1/4] reorder thread list unlink in pthread_exit after all
- locks
-
-since the backend for LOCK() skips locking if single-threaded, it's
-unsafe to make the process appear single-threaded before the last use
-of lock.
-
-this fixes potential unsynchronized access to a linked list via
-__dl_thread_cleanup.
----
- src/thread/pthread_create.c | 19 +++++++++++--------
- 1 file changed, 11 insertions(+), 8 deletions(-)
-
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 5f491092..6a3b0c21 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -90,14 +90,7 @@ _Noreturn void __pthread_exit(void *result)
- 		exit(0);
- 	}
- 
--	/* At this point we are committed to thread termination. Unlink
--	 * the thread from the list. This change will not be visible
--	 * until the lock is released, which only happens after SYS_exit
--	 * has been called, via the exit futex address pointing at the lock. */
--	libc.threads_minus_1--;
--	self->next->prev = self->prev;
--	self->prev->next = self->next;
--	self->prev = self->next = self;
-+	/* At this point we are committed to thread termination. */
- 
- 	/* Process robust list in userspace to handle non-pshared mutexes
- 	 * and the detached thread case where the robust list head will
-@@ -121,6 +114,16 @@ _Noreturn void __pthread_exit(void *result)
- 	__do_orphaned_stdio_locks();
- 	__dl_thread_cleanup();
- 
-+	/* Last, unlink thread from the list. This change will not be visible
-+	 * until the lock is released, which only happens after SYS_exit
-+	 * has been called, via the exit futex address pointing at the lock.
-+	 * This needs to happen after any possible calls to LOCK() that might
-+	 * skip locking if libc.threads_minus_1 is zero. */
-+	libc.threads_minus_1--;
-+	self->next->prev = self->prev;
-+	self->prev->next = self->next;
-+	self->prev = self->next = self;
-+
- 	/* This atomic potentially competes with a concurrent pthread_detach
- 	 * call; the loser is responsible for freeing thread resources. */
- 	int state = a_cas(&self->detach_state, DT_JOINABLE, DT_EXITING);
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch b/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
deleted file mode 100644
index e060762e99a620..00000000000000
--- a/srcpkgs/musl/patches/0002_don_t_use_libc_threads_minus_1_as_relaxed_atomic_for.patch
+++ /dev/null
@@ -1,78 +0,0 @@
->From e01b5939b38aea5ecbe41670643199825874b26c Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 21 May 2020 23:32:45 -0400
-Subject: [PATCH 2/4] don't use libc.threads_minus_1 as relaxed atomic for
- skipping locks
-
-after all but the last thread exits, the next thread to observe
-libc.threads_minus_1==0 and conclude that it can skip locking fails to
-synchronize with any changes to memory that were made by the
-last-exiting thread. this can produce data races.
-
-on some archs, at least x86, memory synchronization is unlikely to be
-a problem; however, with the inline locks in malloc, skipping the lock
-also eliminated the compiler barrier, and caused code that needed to
-re-check chunk in-use bits after obtaining the lock to reuse a stale
-value, possibly from before the process became single-threaded. this
-in turn produced corruption of the heap state.
-
-some uses of libc.threads_minus_1 remain, especially for allocation of
-new TLS in the dynamic linker; otherwise, it could be removed
-entirely. it's made non-volatile to reflect that the remaining
-accesses are only made under lock on the thread list.
-
-instead of libc.threads_minus_1, libc.threaded is now used for
-skipping locks. the difference is that libc.threaded is permanently
-true once an additional thread has been created. this will produce
-some performance regression in processes that are mostly
-single-threaded but occasionally creating threads. in the future it
-may be possible to bring back the full lock-skipping, but more care
-needs to be taken to produce a safe design.
----
- src/internal/libc.h | 2 +-
- src/malloc/malloc.c | 2 +-
- src/thread/__lock.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index ac97dc7e..c0614852 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,7 +21,7 @@ struct __libc {
- 	int can_do_threads;
- 	int threaded;
- 	int secure;
--	volatile int threads_minus_1;
-+	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
- 	size_t tls_size, tls_align, tls_cnt;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 96982596..2553a62e 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,7 +26,7 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threads_minus_1)
-+	if (libc.threaded)
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
- }
- 
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 45557c88..5b9b144e 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,7 +18,7 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threads_minus_1) return;
-+	if (!libc.threaded) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
- 	if (!current) return;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch b/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
deleted file mode 100644
index 540c5d95019572..00000000000000
--- a/srcpkgs/musl/patches/0003_cut_down_size_of_some_libc_struct_members.patch
+++ /dev/null
@@ -1,30 +0,0 @@
->From f12888e9eb9eed60cc266b899dcafecb4752964a Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:25:38 -0400
-Subject: [PATCH 3/4] cut down size of some libc struct members
-
-these are all flags that can be single-byte values.
----
- src/internal/libc.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index c0614852..d47f58e0 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -18,9 +18,9 @@ struct tls_module {
- };
- 
- struct __libc {
--	int can_do_threads;
--	int threaded;
--	int secure;
-+	char can_do_threads;
-+	char threaded;
-+	char secure;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
--- 
-2.21.0
-
diff --git a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch b/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
deleted file mode 100644
index e703c1f403c59d..00000000000000
--- a/srcpkgs/musl/patches/0004_restore_lock_skipping_for_processes_that_return_to_s.patch
+++ /dev/null
@@ -1,102 +0,0 @@
->From 8d81ba8c0bc6fe31136cb15c9c82ef4c24965040 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 22 May 2020 17:45:47 -0400
-Subject: [PATCH 4/4] restore lock-skipping for processes that return to
- single-threaded state
-
-the design used here relies on the barrier provided by the first lock
-operation after the process returns to single-threaded state to
-synchronize with actions by the last thread that exited. by storing
-the intent to change modes in the same object used to detect whether
-locking is needed, it's possible to avoid an extra (possibly costly)
-memory load after the lock is taken.
----
- src/internal/libc.h         | 1 +
- src/malloc/malloc.c         | 5 ++++-
- src/thread/__lock.c         | 4 +++-
- src/thread/pthread_create.c | 8 ++++----
- 4 files changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/internal/libc.h b/src/internal/libc.h
-index d47f58e0..619bba86 100644
---- a/src/internal/libc.h
-+++ b/src/internal/libc.h
-@@ -21,6 +21,7 @@ struct __libc {
- 	char can_do_threads;
- 	char threaded;
- 	char secure;
-+	volatile signed char need_locks;
- 	int threads_minus_1;
- 	size_t *auxv;
- 	struct tls_module *tls_head;
-diff --git a/src/malloc/malloc.c b/src/malloc/malloc.c
-index 2553a62e..a803d4c9 100644
---- a/src/malloc/malloc.c
-+++ b/src/malloc/malloc.c
-@@ -26,8 +26,11 @@ int __malloc_replaced;
- 
- static inline void lock(volatile int *lk)
- {
--	if (libc.threaded)
-+	int need_locks = libc.need_locks;
-+	if (need_locks) {
- 		while(a_swap(lk, 1)) __wait(lk, lk+1, 1, 1);
-+		if (need_locks < 0) libc.need_locks = 0;
-+	}
- }
- 
- static inline void unlock(volatile int *lk)
-diff --git a/src/thread/__lock.c b/src/thread/__lock.c
-index 5b9b144e..60eece49 100644
---- a/src/thread/__lock.c
-+++ b/src/thread/__lock.c
-@@ -18,9 +18,11 @@
- 
- void __lock(volatile int *l)
- {
--	if (!libc.threaded) return;
-+	int need_locks = libc.need_locks;
-+	if (!need_locks) return;
- 	/* fast path: INT_MIN for the lock, +1 for the congestion */
- 	int current = a_cas(l, 0, INT_MIN + 1);
-+	if (need_locks < 0) libc.need_locks = 0;
- 	if (!current) return;
- 	/* A first spin loop, for medium congestion. */
- 	for (unsigned i = 0; i < 10; ++i) {
-diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
-index 6a3b0c21..6bdfb44f 100644
---- a/src/thread/pthread_create.c
-+++ b/src/thread/pthread_create.c
-@@ -118,8 +118,8 @@ _Noreturn void __pthread_exit(void *result)
- 	 * until the lock is released, which only happens after SYS_exit
- 	 * has been called, via the exit futex address pointing at the lock.
- 	 * This needs to happen after any possible calls to LOCK() that might
--	 * skip locking if libc.threads_minus_1 is zero. */
--	libc.threads_minus_1--;
-+	 * skip locking if process appears single-threaded. */
-+	if (!--libc.threads_minus_1) libc.need_locks = -1;
- 	self->next->prev = self->prev;
- 	self->prev->next = self->next;
- 	self->prev = self->next = self;
-@@ -339,7 +339,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		~(1UL<<((SIGCANCEL-1)%(8*sizeof(long))));
- 
- 	__tl_lock();
--	libc.threads_minus_1++;
-+	if (!libc.threads_minus_1++) libc.need_locks = 1;
- 	ret = __clone((c11 ? start_c11 : start), stack, flags, args, &new->tid, TP_ADJ(new), &__thread_list_lock);
- 
- 	/* All clone failures translate to EAGAIN. If explicit scheduling
-@@ -363,7 +363,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
- 		new->next->prev = new;
- 		new->prev->next = new;
- 	} else {
--		libc.threads_minus_1--;
-+		if (!--libc.threads_minus_1) libc.need_locks = 0;
- 	}
- 	__tl_unlock();
- 	__restore_sigs(&set);
--- 
-2.21.0
-
-
diff --git a/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch b/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
deleted file mode 100644
index a8bfa66d6c47d0..00000000000000
--- a/srcpkgs/musl/patches/98e688a9da5e7b2925dda17a2d6820dddf1fb287.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-From 98e688a9da5e7b2925dda17a2d6820dddf1fb287 Mon Sep 17 00:00:00 2001
-From: Ismael Luceno <ismael@iodev.co.uk>
-Date: Sun, 15 Aug 2021 17:51:57 +0200
-Subject: [PATCH] define NULL as nullptr when used in C++11 or later
-
-This should be safer for casting and more compatible with existing code
-bases that wrongly assume it must be defined as a pointer.
----
- include/locale.h | 4 +++-
- include/stddef.h | 4 +++-
- include/stdio.h  | 4 +++-
- include/stdlib.h | 4 +++-
- include/string.h | 4 +++-
- include/time.h   | 4 +++-
- include/unistd.h | 4 +++-
- include/wchar.h  | 4 +++-
- 8 files changed, 24 insertions(+), 8 deletions(-)
-
-diff --git a/include/locale.h b/include/locale.h
-index ce384381c..11106fea8 100644
---- a/include/locale.h
-+++ b/include/locale.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stddef.h b/include/stddef.h
-index bd7538535..f25b86396 100644
---- a/include/stddef.h
-+++ b/include/stddef.h
-@@ -1,7 +1,9 @@
- #ifndef _STDDEF_H
- #define _STDDEF_H
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stdio.h b/include/stdio.h
-index 3604198c3..d1ed01f03 100644
---- a/include/stdio.h
-+++ b/include/stdio.h
-@@ -25,7 +25,9 @@ extern "C" {
- 
- #include <bits/alltypes.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/stdlib.h b/include/stdlib.h
-index 7af86e3bc..b507ca33b 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/string.h b/include/string.h
-index 795a2abcd..43ad0942e 100644
---- a/include/string.h
-+++ b/include/string.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/time.h b/include/time.h
-index 5494df183..3d9483720 100644
---- a/include/time.h
-+++ b/include/time.h
-@@ -7,7 +7,9 @@ extern "C" {
- 
- #include <features.h>
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/unistd.h b/include/unistd.h
-index 130640260..ee2dbe8af 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -15,7 +15,9 @@ extern "C" {
- #define SEEK_CUR 1
- #define SEEK_END 2
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-diff --git a/include/wchar.h b/include/wchar.h
-index 88eb55b18..ed5d774df 100644
---- a/include/wchar.h
-+++ b/include/wchar.h
-@@ -38,7 +38,9 @@ extern "C" {
- #define WCHAR_MIN (-1-0x7fffffff+L'\0')
- #endif
- 
--#ifdef __cplusplus
-+#if __cplusplus >= 201103L
-+#define NULL nullptr
-+#elif defined(__cplusplus)
- #define NULL 0L
- #else
- #define NULL ((void*)0)
-
diff --git a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch b/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
deleted file mode 100644
index 4e03ad1607ce98..00000000000000
--- a/srcpkgs/musl/patches/99d5098a885feae3ae8c32b407350d8ca85dd178.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From 99d5098a885feae3ae8c32b407350d8ca85dd178 Mon Sep 17 00:00:00 2001
-From: Julien Ramseier <j.ramseier@gmail.com>
-Date: Sun, 18 Oct 2020 12:15:06 -0400
-Subject: update crypt_blowfish to support $2b$ prefix
-
-Merge changes from Solar Designer's crypt_blowfish v1.3. This makes
-crypt_blowfish fully compatible with OpenBSD's bcrypt by adding
-support for the $2b$ prefix (which behaves the same as
-crypt_blowfish's $2y$).
----
- src/crypt/crypt_blowfish.c | 38 +++++++++++++++++++++++---------------
- 1 file changed, 23 insertions(+), 15 deletions(-)
-
-(limited to 'src/crypt/crypt_blowfish.c')
-
-diff --git a/src/crypt/crypt_blowfish.c b/src/crypt/crypt_blowfish.c
-index d3f79851..d722607b 100644
---- a/src/crypt/crypt_blowfish.c
-+++ b/src/crypt/crypt_blowfish.c
-@@ -15,7 +15,7 @@
-  * No copyright is claimed, and the software is hereby placed in the public
-  * domain.  In case this attempt to disclaim copyright and place the software
-  * in the public domain is deemed null and void, then the software is
-- * Copyright (c) 1998-2012 Solar Designer and it is hereby released to the
-+ * Copyright (c) 1998-2014 Solar Designer and it is hereby released to the
-  * general public under the following terms:
-  *
-  * Redistribution and use in source and binary forms, with or without
-@@ -31,12 +31,12 @@
-  * you place this code and any modifications you make under a license
-  * of your choice.
-  *
-- * This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
-- * "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
-- * ideas.  The password hashing algorithm was designed by David Mazieres
-- * <dm at lcs.mit.edu>.  For more information on the level of compatibility,
-- * please refer to the comments in BF_set_key() below and to the included
-- * crypt(3) man page.
-+ * This implementation is fully compatible with OpenBSD's bcrypt.c for prefix
-+ * "$2b$", originally by Niels Provos <provos at citi.umich.edu>, and it uses
-+ * some of his ideas.  The password hashing algorithm was designed by David
-+ * Mazieres <dm at lcs.mit.edu>.  For information on the level of
-+ * compatibility for bcrypt hash prefixes other than "$2b$", please refer to
-+ * the comments in BF_set_key() below and to the included crypt(3) man page.
-  *
-  * There's a paper on the algorithm that explains its design decisions:
-  *
-@@ -533,6 +533,7 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
-  * Valid combinations of settings are:
-  *
-  * Prefix "$2a$": bug = 0, safety = 0x10000
-+ * Prefix "$2b$": bug = 0, safety = 0
-  * Prefix "$2x$": bug = 1, safety = 0
-  * Prefix "$2y$": bug = 0, safety = 0
-  */
-@@ -596,12 +597,14 @@ static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
- 	initial[0] ^= sign;
- }
- 
-+static const unsigned char flags_by_subtype[26] = {
-+	2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0
-+};
-+
- static char *BF_crypt(const char *key, const char *setting,
- 	char *output, BF_word min)
- {
--	static const unsigned char flags_by_subtype[26] =
--		{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
--		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
- 	struct {
- 		BF_ctx ctx;
- 		BF_key expanded_key;
-@@ -746,9 +749,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- {
- 	const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
- 	const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
--	static const char test_hash[2][34] =
--		{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
--		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
-+	static const char test_hashes[2][34] = {
-+		"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55", /* 'a', 'b', 'y' */
-+		"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* 'x' */
-+	};
-+	const char *test_hash = test_hashes[0];
- 	char *retval;
- 	const char *p;
- 	int ok;
-@@ -768,8 +773,11 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
-  * detected by the self-test.
-  */
- 	memcpy(buf.s, test_setting, sizeof(buf.s));
--	if (retval)
-+	if (retval) {
-+		unsigned int flags = flags_by_subtype[setting[2] - 'a'];
-+		test_hash = test_hashes[flags & 1];
- 		buf.s[2] = setting[2];
-+	}
- 	memset(buf.o, 0x55, sizeof(buf.o));
- 	buf.o[sizeof(buf.o) - 1] = 0;
- 	p = BF_crypt(test_key, buf.s, buf.o, 1);
-@@ -777,7 +785,7 @@ char *__crypt_blowfish(const char *key, const char *setting, char *output)
- 	ok = (p == buf.o &&
- 	    !memcmp(p, buf.s, 7 + 22) &&
- 	    !memcmp(p + (7 + 22),
--	    test_hash[buf.s[2] & 1],
-+	    test_hash,
- 	    31 + 1 + 1 + 1));
- 
- 	{
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/CVE-2020-28928.patch b/srcpkgs/musl/patches/CVE-2020-28928.patch
deleted file mode 100644
index b3ff3b4ee08f04..00000000000000
--- a/srcpkgs/musl/patches/CVE-2020-28928.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/src/multibyte/wcsnrtombs.c
-+++ b/src/multibyte/wcsnrtombs.c
-@@ -1,41 +1,33 @@
- #include <wchar.h>
-+#include <limits.h>
-+#include <string.h>
- 
- size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
- {
--	size_t l, cnt=0, n2;
--	char *s, buf[256];
- 	const wchar_t *ws = *wcs;
--	const wchar_t *tmp_ws;
--
--	if (!dst) s = buf, n = sizeof buf;
--	else s = dst;
--
--	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
--		if (n2>=n) n2=n;
--		tmp_ws = ws;
--		l = wcsrtombs(s, &ws, n2, 0);
--		if (!(l+1)) {
--			cnt = l;
--			n = 0;
-+	size_t cnt = 0;
-+	if (!dst) n=0;
-+	while (ws && wn) {
-+		char tmp[MB_LEN_MAX];
-+		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
-+		if (l==-1) {
-+			cnt = -1;
- 			break;
- 		}
--		if (s != buf) {
--			s += l;
-+		if (dst) {
-+			if (n<MB_LEN_MAX) {
-+				if (l>n) break;
-+				memcpy(dst, tmp, l);
-+			}
-+			dst += l;
- 			n -= l;
- 		}
--		wn = ws ? wn - (ws - tmp_ws) : 0;
--		cnt += l;
--	}
--	if (ws) while (n && wn) {
--		l = wcrtomb(s, *ws, 0);
--		if ((l+1)<=1) {
--			if (!l) ws = 0;
--			else cnt = l;
-+		if (!*ws) {
-+			ws = 0;
- 			break;
- 		}
--		ws++; wn--;
--		/* safe - this loop runs fewer than sizeof(buf) times */
--		s+=l; n-=l;
-+		ws++;
-+		wn--;
- 		cnt += l;
- 	}
- 	if (dst) *wcs = ws;
-
diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
deleted file mode 100644
index 024eed11a8e537..00000000000000
--- a/srcpkgs/musl/patches/aarch64-fregs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Use types compatible with glibc/kernel headers.
-
-diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
-index b71261f5..5098c734 100644
---- a/arch/aarch64/bits/signal.h
-+++ b/arch/aarch64/bits/signal.h
-@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
- typedef unsigned long gregset_t[34];
- 
- typedef struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- } fpregset_t;
-@@ -34,7 +34,7 @@ struct fpsimd_context {
- 	struct _aarch64_ctx head;
- 	unsigned int fpsr;
- 	unsigned int fpcr;
--	long double vregs[32];
-+	__uint128_t vregs[32];
- };
- struct esr_context {
- 	struct _aarch64_ctx head;
-diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
-index d12cdf7f..8a1002aa 100644
---- a/arch/aarch64/bits/user.h
-+++ b/arch/aarch64/bits/user.h
-@@ -6,7 +6,7 @@ struct user_regs_struct {
- };
- 
- struct user_fpsimd_struct {
--	long double vregs[32];
-+	__uint128_t vregs[32];
- 	unsigned int fpsr;
- 	unsigned int fpcr;
- };
diff --git a/srcpkgs/musl/patches/add-qsort_r.patch b/srcpkgs/musl/patches/add-qsort_r.patch
deleted file mode 100644
index 3d85496afb69fb..00000000000000
--- a/srcpkgs/musl/patches/add-qsort_r.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From b76f37fd5625d038141b52184956fb4b7838e9a5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Nogueira?= <ericonr@disroot.org>
-Date: Tue, 9 Mar 2021 18:02:13 -0300
-Subject: [PATCH] add qsort_r and make qsort a wrapper around it
-
-we make qsort a wrapper by providing a wrapper_cmp function that uses
-the extra argument as a function pointer. should be optimized to a tail
-call on most architectures, as long as it's built with
--fomit-frame-pointer, so the performance impact should be minimal.
-
-to keep the git history clean, for now qsort_r is implemented in qsort.c
-and qsort is implemented in qsort_nr.c.  qsort.c also received a few
-trivial cleanups, including replacing (*cmp)() calls with cmp().
-qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
-itself.
----
- include/stdlib.h      |  1 +
- src/include/stdlib.h  |  1 +
- src/stdlib/qsort.c    | 37 ++++++++++++++++++++-----------------
- src/stdlib/qsort_nr.c | 14 ++++++++++++++
- 4 files changed, 36 insertions(+), 17 deletions(-)
- create mode 100644 src/stdlib/qsort_nr.c
-
-diff --git a/include/stdlib.h b/include/stdlib.h
-index b54a051fe..7af86e3bc 100644
---- a/include/stdlib.h
-+++ b/include/stdlib.h
-@@ -146,6 +146,7 @@ int clearenv(void);
- #define WCOREDUMP(s) ((s) & 0x80)
- #define WIFCONTINUED(s) ((s) == 0xffff)
- void *reallocarray (void *, size_t, size_t);
-+void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- #endif
- 
- #ifdef _GNU_SOURCE
-diff --git a/src/include/stdlib.h b/src/include/stdlib.h
-index e9da20158..812b04de2 100644
---- a/src/include/stdlib.h
-+++ b/src/include/stdlib.h
-@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *);
- hidden int __mkostemps(char *, int, int);
- hidden int __ptsname_r(int, char *, size_t);
- hidden char *__randname(char *);
-+hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *);
- 
- hidden void *__libc_malloc(size_t);
- hidden void *__libc_malloc_impl(size_t);
-diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c
-index da58fd317..314ddc29d 100644
---- a/src/stdlib/qsort.c
-+++ b/src/stdlib/qsort.c
-@@ -24,6 +24,7 @@
- /* Smoothsort, an adaptive variant of Heapsort.  Memory usage: O(1).
-    Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */
- 
-+#define _BSD_SOURCE
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -31,7 +32,7 @@
- #include "atomic.h"
- #define ntz(x) a_ctz_l((x))
- 
--typedef int (*cmpfun)(const void *, const void *);
-+typedef int (*cmpfun)(const void *, const void *, void *);
- 
- static inline int pntz(size_t p[2]) {
- 	int r = ntz(p[0] - 1);
-@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n)
- 	p[1] >>= n;
- }
- 
--static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[])
-+static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[])
- {
- 	unsigned char *rt, *lf;
- 	unsigned char *ar[14 * sizeof(size_t) + 1];
-@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 		rt = head - width;
- 		lf = head - width - lp[pshift - 2];
- 
--		if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) {
-+		if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) {
- 			break;
- 		}
--		if((*cmp)(lf, rt) >= 0) {
-+		if(cmp(lf, rt, arg) >= 0) {
- 			ar[i++] = lf;
- 			head = lf;
- 			pshift -= 1;
-@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size
- 	cycle(width, ar, i);
- }
- 
--static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[])
-+static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[])
- {
- 	unsigned char *stepson,
- 	              *rt, *lf;
-@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	ar[0] = head;
- 	while(p[0] != 1 || p[1] != 0) {
- 		stepson = head - lp[pshift];
--		if((*cmp)(stepson, ar[0]) <= 0) {
-+		if(cmp(stepson, ar[0], arg) <= 0) {
- 			break;
- 		}
- 		if(!trusty && pshift > 1) {
- 			rt = head - width;
- 			lf = head - width - lp[pshift - 2];
--			if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) {
-+			if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) {
- 				break;
- 			}
- 		}
-@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2],
- 	}
- 	if(!trusty) {
- 		cycle(width, ar, i);
--		sift(head, width, cmp, pshift, lp);
-+		sift(head, width, cmp, arg, pshift, lp);
- 	}
- }
- 
--void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg)
- {
- 	size_t lp[12*sizeof(size_t)];
- 	size_t i, size = width * nel;
-@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 
- 	while(head < high) {
- 		if((p[0] & 3) == 3) {
--			sift(head, width, cmp, pshift, lp);
-+			sift(head, width, cmp, arg, pshift, lp);
- 			shr(p, 2);
- 			pshift += 2;
- 		} else {
- 			if(lp[pshift - 1] >= high - head) {
--				trinkle(head, width, cmp, p, pshift, 0, lp);
-+				trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 			} else {
--				sift(head, width, cmp, pshift, lp);
-+				sift(head, width, cmp, arg, pshift, lp);
- 			}
--			
-+
- 			if(pshift == 1) {
- 				shl(p, 1);
- 				pshift = 0;
-@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 				pshift = 1;
- 			}
- 		}
--		
-+
- 		p[0] |= 1;
- 		head += width;
- 	}
- 
--	trinkle(head, width, cmp, p, pshift, 0, lp);
-+	trinkle(head, width, cmp, arg, p, pshift, 0, lp);
- 
- 	while(pshift != 1 || p[0] != 1 || p[1] != 0) {
- 		if(pshift <= 1) {
-@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
- 			pshift -= 2;
- 			p[0] ^= 7;
- 			shr(p, 1);
--			trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp);
-+			trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp);
- 			shl(p, 1);
- 			p[0] |= 1;
--			trinkle(head - width, width, cmp, p, pshift, 1, lp);
-+			trinkle(head - width, width, cmp, arg, p, pshift, 1, lp);
- 		}
- 		head -= width;
- 	}
- }
-+
-+weak_alias(__qsort_r, qsort_r);
-diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c
-new file mode 100644
-index 000000000..efe7ccecd
---- /dev/null
-+++ b/src/stdlib/qsort_nr.c
-@@ -0,0 +1,14 @@
-+#define _BSD_SOURCE
-+#include <stdlib.h>
-+
-+typedef int (*cmpfun)(const void *, const void *);
-+
-+static int wrapper_cmp(const void *v1, const void *v2, void *cmp)
-+{
-+	return ((cmpfun)cmp)(v1, v2);
-+}
-+
-+void qsort(void *base, size_t nel, size_t width, cmpfun cmp)
-+{
-+	__qsort_r(base, nel, width, wrapper_cmp, cmp);
-+}
diff --git a/srcpkgs/musl/patches/add-rlimit-rttime.patch b/srcpkgs/musl/patches/add-rlimit-rttime.patch
deleted file mode 100644
index 56afa6b66521a0..00000000000000
--- a/srcpkgs/musl/patches/add-rlimit-rttime.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 2507e7f5312e79620f6337935d0a6c9045ccba09 Mon Sep 17 00:00:00 2001
-From: Leah Neukirchen <leah@vuxu.org>
-Date: Sat, 11 Jan 2020 20:16:59 +0100
-Subject: [PATCH] define RLIMIT_RTTIME, bump RLIMIT_NLIMITS
-
-This macro exists since Linux 2.6.25 and is defined in glibc since 2011.
----
- include/sys/resource.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/include/sys/resource.h b/include/sys/resource.h
-index e0c86ae33..3068328d0 100644
---- a/include/sys/resource.h
-+++ b/include/sys/resource.h
-@@ -90,7 +90,8 @@ int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
- #define RLIMIT_MSGQUEUE 12
- #define RLIMIT_NICE    13
- #define RLIMIT_RTPRIO  14
--#define RLIMIT_NLIMITS 15
-+#define RLIMIT_RTTIME  15
-+#define RLIMIT_NLIMITS 16
- 
- #define RLIM_NLIMITS RLIMIT_NLIMITS
- 
diff --git a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch b/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
deleted file mode 100644
index e20dff5ba0d456..00000000000000
--- a/srcpkgs/musl/patches/add-support-for-SIGEV_THREAD_ID-timers.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7c71792e87691451f2a6b76348e83ad1889f1dcb Mon Sep 17 00:00:00 2001
-From: James Y Knight <jyknight@google.com>
-Date: Sun, 30 Jun 2019 21:55:20 -0400
-Subject: [PATCH] add support for SIGEV_THREAD_ID timers
-
-This is like SIGEV_SIGNAL, but targeted to a particular thread's
-tid, rather than the process.
----
- include/signal.h        | 16 +++++++++++++---
- src/time/timer_create.c |  8 ++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/signal.h b/include/signal.h
-index fbdf667b2..9ed929e4f 100644
---- a/include/signal.h
-+++ b/include/signal.h
-@@ -180,14 +180,24 @@ struct sigevent {
- 	union sigval sigev_value;
- 	int sigev_signo;
- 	int sigev_notify;
--	void (*sigev_notify_function)(union sigval);
--	pthread_attr_t *sigev_notify_attributes;
--	char __pad[56-3*sizeof(long)];
-+	union {
-+		char __pad[64 - 2*sizeof(int) - sizeof(union sigval)];
-+		pid_t sigev_notify_thread_id;
-+		struct {
-+			void (*sigev_notify_function)(union sigval);
-+			pthread_attr_t *sigev_notify_attributes;
-+		} __sev_thread;
-+	} __sev_fields;
- };
- 
-+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id
-+#define sigev_notify_function __sev_fields.__sev_thread.sigev_notify_function
-+#define sigev_notify_attributes __sev_fields.__sev_thread.sigev_notify_attributes
-+
- #define SIGEV_SIGNAL 0
- #define SIGEV_NONE 1
- #define SIGEV_THREAD 2
-+#define SIGEV_THREAD_ID 4
- 
- int __libc_current_sigrtmin(void);
- int __libc_current_sigrtmax(void);
-diff --git a/src/time/timer_create.c b/src/time/timer_create.c
-index 5ddfda278..4bef23905 100644
---- a/src/time/timer_create.c
-+++ b/src/time/timer_create.c
-@@ -71,11 +71,15 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 	switch (evp ? evp->sigev_notify : SIGEV_SIGNAL) {
- 	case SIGEV_NONE:
- 	case SIGEV_SIGNAL:
-+	case SIGEV_THREAD_ID:
- 		if (evp) {
- 			ksev.sigev_value = evp->sigev_value;
- 			ksev.sigev_signo = evp->sigev_signo;
- 			ksev.sigev_notify = evp->sigev_notify;
--			ksev.sigev_tid = 0;
-+			if (evp->sigev_notify == SIGEV_THREAD_ID)
-+				ksev.sigev_tid = evp->sigev_notify_thread_id;
-+			else
-+				ksev.sigev_tid = 0;
- 			ksevp = &ksev;
- 		}
- 		if (syscall(SYS_timer_create, clk, ksevp, &timerid) < 0)
-@@ -107,7 +111,7 @@ int timer_create(clockid_t clk, struct sigevent *restrict evp, timer_t *restrict
- 
- 		ksev.sigev_value.sival_ptr = 0;
- 		ksev.sigev_signo = SIGTIMER;
--		ksev.sigev_notify = 4; /* SIGEV_THREAD_ID */
-+		ksev.sigev_notify = SIGEV_THREAD_ID;
- 		ksev.sigev_tid = td->tid;
- 		if (syscall(SYS_timer_create, clk, &ksev, &timerid) < 0)
- 			timerid = -1;
diff --git a/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch b/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
deleted file mode 100644
index 21f236b3a6cd19..00000000000000
--- a/srcpkgs/musl/patches/avoid-set-id-setrlimit-misbehavior-and-hang-in-vfork.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a5aff1972c9e3981566414b09a28e331ccd2be5d Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Thu, 17 Sep 2020 15:09:46 -0400
-Subject: [PATCH 237/513] avoid set*id/setrlimit misbehavior and hang in
- vforked/cloned child
-
-taking the deprecated/dropped vfork spec strictly, doing pretty much
-anything but execve in the child is wrong and undefined. however,
-these are commonly needed operations to setup the child state before
-exec, and historical implementations tolerated them.
-
-for single-threaded parents, these operations already worked as
-expected in the vforked child. however, due to the need for __synccall
-to synchronize id/resource limit changes among all threads, calling
-these functions in the vforked child of a multithreaded parent caused
-a misdirected broadcast signaling of all threads in the parent. these
-signals could kill the parent entirely if the synccall signal handler
-had never been installed in the parent, or could be ignored if it had,
-or could signal/kill one or more utterly wrong processes if the parent
-already terminated (due to vfork semantics, only possible via fatal
-signal) and the parent tids were recycled. in any case, the expected
-number of semaphore posts would never happen, so the child would
-permanently hang (with all signals blocked) waiting for them.
-
-to mitigate this, and also make the normal usage case work as
-intended, treat the condition where the caller's actual tid does not
-match the tid in its thread structure as single-threaded, and bypass
-the entire synccall broadcast operation.
----
- src/thread/synccall.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/thread/synccall.c b/src/thread/synccall.c
-index 648a6ad4..d58c851f 100644
---- a/src/thread/synccall.c
-+++ b/src/thread/synccall.c
-@@ -63,7 +63,8 @@ void __synccall(void (*func)(void *), void *ctx)
- 	sem_init(&target_sem, 0, 0);
- 	sem_init(&caller_sem, 0, 0);
- 
--	if (!libc.threads_minus_1) goto single_threaded;
-+	if (!libc.threads_minus_1 || __syscall(SYS_gettid) != self->tid)
-+		goto single_threaded;
- 
- 	callback = func;
- 	context = ctx;
--- 
-2.41.0
-
diff --git a/srcpkgs/musl/patches/c23-basename.patch b/srcpkgs/musl/patches/c23-basename.patch
deleted file mode 100644
index 8f95a27d0ef562..00000000000000
--- a/srcpkgs/musl/patches/c23-basename.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 725e17ed6dff4d0cd22487bb64470881e86a92e7 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 6 Nov 2023 08:26:19 -0500
-Subject: [PATCH] remove non-prototype declaration of basename from string.h
-
-commit 37bb3cce4598c19288628e675eaf1cda6e96958f suppressed the
-declaration for C++, where it is wrongly interpreted as declaring the
-function as taking no arguments. with C23 removing non-prototype
-declarations, that problem is now also relevant to C.
-
-the non-prototype declaration for basename originates with commit
-06aec8d7152dfb8360cb7ed9b3d7215ca0b0b500, where it was designed to
-avoid conflicts with programs which declare basename with the GNU
-signature taking const char *. that change was probably misguided, as
-it represents not only misaligned expectations with the caller, but
-also undefined behavior (calling a function that's been declared with
-the wrong type).
-
-we could opt to fix the declaration, but since glibc, with the
-gratuitously incompatible GNU-basename function, seems to be the only
-implementation that declares it in string.h, it seems better to just
-remove the declaration. this provides some warning if applications are
-being built expecting the GNU behavior but not getting it. if we
-declared it here, it would only produce a warning if the caller also
-declares it themselves (rare) or if the caller attempts to pass a
-const-qualified pointer.
----
- include/string.h | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/include/string.h b/include/string.h
-index db73d2a9..83e2b946 100644
---- a/include/string.h
-+++ b/include/string.h
-@@ -95,9 +95,6 @@ char *strchrnul(const char *, int);
- char *strcasestr(const char *, const char *);
- void *memrchr(const void *, int, size_t);
- void *mempcpy(void *, const void *, size_t);
--#ifndef __cplusplus
--char *basename();
--#endif
- #endif
- 
- #ifdef __cplusplus
diff --git a/srcpkgs/musl/patches/epoll_cp.patch b/srcpkgs/musl/patches/epoll_cp.patch
deleted file mode 100644
index 92f47551ad8eb6..00000000000000
--- a/srcpkgs/musl/patches/epoll_cp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2c00f95c1ac7dd50f53d9e361847ebd2513c8da0 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Sat, 3 Apr 2021 21:16:41 -0400
-Subject: [PATCH] make epoll_[p]wait a cancellation point
-
-this is a Linux-specific function and not covered by POSIX's
-requirements for which interfaces are cancellation points, but glibc
-makes it one and existing software relies on it being one.
-
-at some point a review for similar functions that should be made
-cancellation points should be done.
-
-diff --git src/linux/epoll.c src/linux/epoll.c
-index deff5b10..93baa814 100644
---- a/src/linux/epoll.c
-+++ b/src/linux/epoll.c
-@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
- 
- int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
- {
--	int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
-+	int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8);
- #ifdef SYS_epoll_wait
--	if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to);
-+	if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to);
- #endif
- 	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/patches/fix-oob-read-processing-time-zone-data.patch b/srcpkgs/musl/patches/fix-oob-read-processing-time-zone-data.patch
deleted file mode 100644
index 557cbd7446d9bb..00000000000000
--- a/srcpkgs/musl/patches/fix-oob-read-processing-time-zone-data.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 3b7b4155570b4b9054465785be2992c92cb7d7b1 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Wed, 9 Feb 2022 17:48:43 -0500
-Subject: fix out-of-bound read processing time zone data with distant-past
- dates
-
-this bug goes back to commit 1cc81f5cb0df2b66a795ff0c26d7bbc4d16e13c6
-where zoneinfo file support was first added. in scan_trans, which
-searches for the appropriate local time/dst rule in effect at a given
-time, times prior to the second transition time caused the -1 slot of
-the index to be read to determine the previous rule in effect. this
-memory was always valid (part of another zoneinfo table in the mapped
-file) but the byte value read was then used to index another table,
-possibly going outside the bounds of the mmap. most of the time, the
-result was limited to misinterpretation of the rule in effect at that
-time (pre-1900s), but it could produce a crash if adjacent memory was
-not readable.
-
-the root cause of the problem, however, was that the logic for this
-code path was all wrong. as documented in the comment, times before
-the first transition should be treated as using the lowest-numbered
-non-dst rule, or rule 0 if no non-dst rules exist. if the argument is
-in units of local time, however, the rule prior to the first
-transition is needed to determine if it falls before or after it, and
-that's where the -1 index was wrongly used.
-
-instead, use the documented logic to find out what rule would be in
-effect before the first transition, and apply it as the offset if the
-argument was given in local time.
-
-the new code has not been heavily tested, but no longer performs
-potentially out-of-bounds accesses, and successfully handles the 1883
-transition from local mean time to central standard time in the test
-case the error was reported for.
----
- src/time/__tz.c | 26 ++++++++++++--------------
- 1 file changed, 12 insertions(+), 14 deletions(-)
-
-diff --git a/src/time/__tz.c b/src/time/__tz.c
-index 3e2fcdcb..c34b3eb7 100644
---- a/src/time/__tz.c
-+++ b/src/time/__tz.c
-@@ -293,22 +293,20 @@ static size_t scan_trans(long long t, int local, size_t *alt)
- 	n = (index-trans)>>scale;
- 	if (a == n-1) return -1;
- 	if (a == 0) {
--		x = zi_read32(trans + (a<<scale));
--		if (scale == 3) x = x<<32 | zi_read32(trans + (a<<scale) + 4);
-+		x = zi_read32(trans);
-+		if (scale == 3) x = x<<32 | zi_read32(trans + 4);
- 		else x = (int32_t)x;
--		if (local) off = (int32_t)zi_read32(types + 6 * index[a-1]);
-+		/* Find the lowest non-DST type, or 0 if none. */
-+		size_t j = 0;
-+		for (size_t i=abbrevs-types; i; i-=6) {
-+			if (!types[i-6+4]) j = i-6;
-+		}
-+		if (local) off = (int32_t)zi_read32(types + j);
-+		/* If t is before first transition, use the above-found type
-+		 * and the index-zero (after transition) type as the alt. */
- 		if (t - off < (int64_t)x) {
--			for (a=0; a<(abbrevs-types)/6; a++) {
--				if (types[6*a+4] != types[4]) break;
--			}
--			if (a == (abbrevs-types)/6) a = 0;
--			if (types[6*a+4]) {
--				*alt = a;
--				return 0;
--			} else {
--				*alt = 0;
--				return a;
--			}
-+			if (alt) *alt = index[0];
-+			return j/6;
- 		}
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
deleted file mode 100644
index 39af72b0c5f91f..00000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-1.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 2d0bbe6c788938d1332609c014eeebc1dff966ac Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 26 Oct 2020 15:56:25 -0400
-Subject: fix pthread_cond_wait paired with with priority-inheritance mutex
-
-pthread_cond_wait arranged for requeued waiters to wake when the mutex
-is unlocked by temporarily adjusting the mutex's waiter count. commit
-54ca677983d47529bab8752315ac1a2b49888870 broke this when introducing
-PI mutexes by repurposing the waiter count field of the mutex
-structure. since then, for PI mutexes, the waiter count adjustment was
-misinterpreted by the mutex locking code as indicating that the mutex
-is non a non-recoverable state.
-
-it would be possible to special-case PI mutexes here, but instead just
-drop all adjustment of the waiters count, and instead use the lock
-word waiters bit for all mutex types. since the mutex is either held
-by the caller or in unrecoverable state at the time the bit is set, it
-will necessarily still be set at the time of any subsequent valid
-unlock operation, and this will produce the desired effect of waking
-the next waiter.
-
-if waiter counts are entirely dropped at some point in the future this
-code should still work without modification.
----
- src/thread/pthread_cond_timedwait.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index d1501240..f5f37af1 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,14 +146,13 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
--	if (!node.next) a_inc(&m->_m_waiters);
--
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
--	if (node.prev)
--		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & 128);
--	else
--		a_dec(&m->_m_waiters);
-+	if (node.prev) {
-+		int val = m->_m_lock;
-+		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
-+		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
- 	if (e == ECANCELED) e = 0;
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
deleted file mode 100644
index b356e38b61f83d..00000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-2.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 27b2fc9d6db956359727a66c262f1e69995660aa Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 11:21:06 -0400
-Subject: fix missing-wake regression in pthread_cond_wait
-
-the reasoning in commit 2d0bbe6c788938d1332609c014eeebc1dff966ac was
-not entirely correct. while it's true that setting the waiters flag
-ensures that the next unlock will perform a wake, it's possible that
-the wake is consumed by a mutex waiter that has no relationship with
-the condvar wait queue being processed, which then takes the mutex.
-when that thread subsequently unlocks, it sees no waiters, and leaves
-the rest of the condvar queue stuck.
-
-bring back the waiter count adjustment, but skip it for PI mutexes,
-for which a successful lock-after-waiting always sets the waiters bit.
-if future changes are made to bring this same waiters-bit contract to
-all lock types, this can be reverted.
----
- src/thread/pthread_cond_timedwait.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index f5f37af1..a0cd4904 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -146,12 +146,17 @@ relock:
- 
- 	if (oldstate == WAITING) goto done;
- 
-+	if (!node.next && !(m->_m_type & 8))
-+		a_inc(&m->_m_waiters);
-+
- 	/* Unlock the barrier that's holding back the next waiter, and
- 	 * either wake it or requeue it to the mutex. */
- 	if (node.prev) {
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
-+	} else if (!!(m->_m_type & 8)) {
-+		a_dec(&m->_m_waiters);		
- 	}
- 
- 	/* Since a signal was consumed, cancellation is not permitted. */
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch b/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
deleted file mode 100644
index 2cc943f26f6a62..00000000000000
--- a/srcpkgs/musl/patches/fix-pi-mutex-cond-3.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d91a6cf6e369a79587c5665fce9635e5634ca201 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Fri, 30 Oct 2020 16:50:08 -0400
-Subject: fix erroneous pthread_cond_wait mutex waiter count logic due to typo
-
-introduced in commit 27b2fc9d6db956359727a66c262f1e69995660aa.
----
- src/thread/pthread_cond_timedwait.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-(limited to 'src/thread/pthread_cond_timedwait.c')
-
-diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c
-index a0cd4904..6b761455 100644
---- a/src/thread/pthread_cond_timedwait.c
-+++ b/src/thread/pthread_cond_timedwait.c
-@@ -155,7 +155,7 @@ relock:
- 		int val = m->_m_lock;
- 		if (val>0) a_cas(&m->_m_lock, val, val|0x80000000);
- 		unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128));
--	} else if (!!(m->_m_type & 8)) {
-+	} else if (!(m->_m_type & 8)) {
- 		a_dec(&m->_m_waiters);		
- 	}
- 
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch b/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
deleted file mode 100644
index e0f0b8bffffc9a..00000000000000
--- a/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From b50eb8c36c20f967bd0ed70c0b0db38a450886ba Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 7 Nov 2022 22:17:55 -0500
-Subject: [PATCH] fix strverscmp comparison of digit sequence with non-digits
-
-the rule that longest digit sequence not beginning with a zero is
-greater only applies when both sequences being compared are
-non-degenerate. this is spelled out explicitly in the man page, which
-may be deemed authoritative for this nonstandard function: "If one or
-both of these is empty, then return what strcmp(3) would have
-returned..."
-
-we were wrongly treating any sequence of digits not beginning with a
-zero as greater than a non-digit in the other string.
----
- src/string/strverscmp.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/string/strverscmp.c b/src/string/strverscmp.c
-index 4daf276d..16c1da22 100644
---- a/src/string/strverscmp.c
-+++ b/src/string/strverscmp.c
-@@ -18,9 +18,9 @@ int strverscmp(const char *l0, const char *r0)
- 		else if (c!='0') z=0;
- 	}
- 
--	if (l[dp]!='0' && r[dp]!='0') {
--		/* If we're not looking at a digit sequence that began
--		 * with a zero, longest digit string is greater. */
-+	if (l[dp]-'1'<9U && r[dp]-'1'<9U) {
-+		/* If we're looking at non-degenerate digit sequences starting
-+		 * with nonzero digits, longest digit string is greater. */
- 		for (j=i; isdigit(l[j]); j++)
- 			if (!isdigit(r[j])) return 1;
- 		if (isdigit(r[j])) return -1;
--- 
-2.41.0
-
diff --git a/srcpkgs/musl/patches/gettid.patch b/srcpkgs/musl/patches/gettid.patch
deleted file mode 100644
index bb8bf5905b8801..00000000000000
--- a/srcpkgs/musl/patches/gettid.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d49cf07541bb54a5ac7aec1feec8514db33db8ea Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 17 Aug 2020 20:12:53 -0400
-Subject: [PATCH] add gettid function
-
-this is a prerequisite for addition of other interfaces that use
-kernel tids, including futex and SIGEV_THREAD_ID.
-
-there is some ambiguity as to whether the semantic return type should
-be int or pid_t. either way, futex API imposes a contract that the
-values fit in int (excluding some upper reserved bits). glibc used
-pid_t, so in the interest of not having gratuitous mismatch (the
-underlying types are the same anyway), pid_t is used here as well.
-
-while conceptually this is a syscall, the copy stored in the thread
-structure is always valid in all contexts where it's valid to call
-libc functions, so it's used to avoid the syscall.
----
- include/unistd.h   | 1 +
- src/linux/gettid.c | 8 ++++++++
- 2 files changed, 9 insertions(+)
- create mode 100644 src/linux/gettid.c
-
-diff --git a/include/unistd.h b/include/unistd.h
-index 7bcbff943..07584a23e 100644
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -190,6 +190,7 @@ int syncfs(int);
- int euidaccess(const char *, int);
- int eaccess(const char *, int);
- ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
-+pid_t gettid(void);
- #endif
- 
- #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
-diff --git a/src/linux/gettid.c b/src/linux/gettid.c
-new file mode 100644
-index 000000000..70767137e
---- /dev/null
-+++ b/src/linux/gettid.c
-@@ -0,0 +1,8 @@
-+#define _GNU_SOURCE
-+#include <unistd.h>
-+#include "pthread_impl.h"
-+
-+pid_t gettid(void)
-+{
-+	return __pthread_self()->tid;
-+}
diff --git a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch b/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
deleted file mode 100644
index 569a1f52c7cd98..00000000000000
--- a/srcpkgs/musl/patches/implement_realpath_directly_instead_of_using_procfs_readlink.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 29ff7599a448232f2527841c2362643d246cee36 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 30 Nov 2020 12:14:47 -0500
-Subject: [PATCH] implement realpath directly instead of using procfs readlink
-
-inability to use realpath in chroot/container without procfs access
-and at early boot prior to mount of /proc has been an ongoing issue,
-and it turns out realpath was one of the last remaining interfaces
-that needed procfs for its core functionality. during investigation
-while reimplementing, it was determined that there were also serious
-problems with the procfs-based implementation. most seriously it was
-unsafe on pre-O_PATH kernels, and unlike other places where O_PATH was
-used, the unsafety was hard or impossible to fix because O_NOFOLLOW
-can't be used (since the whole purpose was to follow symlinks).
-
-the new implementation is a direct one, performing readlink on each
-path component to resolve it. an explicit stack, as opposed to
-recursion, is used to represent the remaining components to be
-processed. the stack starts out holding just the input string, and
-reading a link pushes the link contents onto the stack.
-
-unlike many other implementations, this one does not call getcwd
-initially for relative pathnames. instead it accumulates initial ..
-components to be applied to the working directory if the result is
-still a relative path. this avoids calling getcwd (which may fail) at
-all when symlink traversal will eventually yield an absolute path. it
-also doesn't use any form of stat operation; instead it arranges for
-readlink to tell it when a non-directory is used in a context where a
-directory is needed. this minimizes the number of syscalls needed,
-avoids accessing inodes when the directory table suffices, and reduces
-the amount of code pulled in for static linking.
----
- src/misc/realpath.c | 159 +++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 136 insertions(+), 23 deletions(-)
-
-diff --git a/src/misc/realpath.c b/src/misc/realpath.c
-index d2708e59d..db8b74dc8 100644
---- a/src/misc/realpath.c
-+++ b/src/misc/realpath.c
-@@ -1,43 +1,156 @@
- #include <stdlib.h>
- #include <limits.h>
--#include <sys/stat.h>
--#include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
--#include "syscall.h"
-+
-+static size_t slash_len(const char *s)
-+{
-+	const char *s0 = s;
-+	while (*s == '/') s++;
-+	return s-s0;
-+}
- 
- char *realpath(const char *restrict filename, char *restrict resolved)
- {
--	int fd;
--	ssize_t r;
--	struct stat st1, st2;
--	char buf[15+3*sizeof(int)];
--	char tmp[PATH_MAX];
-+	char stack[PATH_MAX+1];
-+	char output[PATH_MAX];
-+	size_t p, q, l, l0, cnt=0, nup=0;
-+	int check_dir=0;
- 
- 	if (!filename) {
- 		errno = EINVAL;
- 		return 0;
- 	}
-+	l = strnlen(filename, sizeof stack);
-+	if (!l) {
-+		errno = ENOENT;
-+		return 0;
-+	}
-+	if (l >= PATH_MAX) goto toolong;
-+	p = sizeof stack - l - 1;
-+	q = 0;
-+	memcpy(stack+p, filename, l+1);
-+
-+	/* Main loop. Each iteration pops the next part from stack of
-+	 * remaining path components and consumes any slashes that follow.
-+	 * If not a link, it's moved to output; if a link, contents are
-+	 * pushed to the stack. */
-+restart:
-+	for (; ; p+=slash_len(stack+p)) {
-+		/* If stack starts with /, the whole component is / or //
-+		 * and the output state must be reset. */
-+		if (stack[p] == '/') {
-+			check_dir=0;
-+			nup=0;
-+			q=0;
-+			output[q++] = '/';
-+			p++;
-+			/* Initial // is special. */
-+			if (stack[p] == '/' && stack[p+1] != '/')
-+				output[q++] = '/';
-+			continue;
-+		}
-+
-+		char *z = __strchrnul(stack+p, '/');
-+		l0 = l = z-(stack+p);
- 
--	fd = sys_open(filename, O_PATH|O_NONBLOCK|O_CLOEXEC);
--	if (fd < 0) return 0;
--	__procfdname(buf, fd);
-+		if (!l && !check_dir) break;
- 
--	r = readlink(buf, tmp, sizeof tmp - 1);
--	if (r < 0) goto err;
--	tmp[r] = 0;
-+		/* Skip any . component but preserve check_dir status. */
-+		if (l==1 && stack[p]=='.') {
-+			p += l;
-+			continue;
-+		}
- 
--	fstat(fd, &st1);
--	r = stat(tmp, &st2);
--	if (r<0 || st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
--		if (!r) errno = ELOOP;
--		goto err;
-+		/* Copy next component onto output at least temporarily, to
-+		 * call readlink, but wait to advance output position until
-+		 * determining it's not a link. */
-+		if (q && output[q-1] != '/') {
-+			if (!p) goto toolong;
-+			stack[--p] = '/';
-+			l++;
-+		}
-+		if (q+l >= PATH_MAX) goto toolong;
-+		memcpy(output+q, stack+p, l);
-+		output[q+l] = 0;
-+		p += l;
-+
-+		int up = 0;
-+		if (l0==2 && stack[p-2]=='.' && stack[p-1]=='.') {
-+			up = 1;
-+			/* Any non-.. path components we could cancel start
-+			 * after nup repetitions of the 3-byte string "../";
-+			 * if there are none, accumulate .. components to
-+			 * later apply to cwd, if needed. */
-+			if (q <= 3*nup) {
-+				nup++;
-+				q += l;
-+				continue;
-+			}
-+			/* When previous components are already known to be
-+			 * directories, processing .. can skip readlink. */
-+			if (!check_dir) goto skip_readlink;
-+		}
-+		ssize_t k = readlink(output, stack, p);
-+		if (k==p) goto toolong;
-+		if (!k) {
-+			errno = ENOENT;
-+			return 0;
-+		}
-+		if (k<0) {
-+			if (errno != EINVAL) return 0;
-+skip_readlink:
-+			check_dir = 0;
-+			if (up) {
-+				while(q && output[q-1]!='/') q--;
-+				if (q>1 && (q>2 || output[0]!='/')) q--;
-+				continue;
-+			}
-+			if (l0) q += l;
-+			check_dir = stack[p];
-+			continue;
-+		}
-+		if (++cnt == SYMLOOP_MAX) {
-+			errno = ELOOP;
-+			return 0;
-+		}
-+
-+		/* If link contents end in /, strip any slashes already on
-+		 * stack to avoid /->// or //->/// or spurious toolong. */
-+		if (stack[k-1]=='/') while (stack[p]=='/') p++;
-+		p -= k;
-+		memmove(stack+p, stack, k);
-+
-+		/* Skip the stack advancement in case we have a new
-+		 * absolute base path. */
-+		goto restart;
- 	}
- 
--	__syscall(SYS_close, fd);
--	return resolved ? strcpy(resolved, tmp) : strdup(tmp);
--err:
--	__syscall(SYS_close, fd);
-+ 	output[q] = 0;
-+
-+	if (output[0] != '/') {
-+		if (!getcwd(stack, sizeof stack)) return 0;
-+		l = strlen(stack);
-+		/* Cancel any initial .. components. */
-+		p = 0;
-+		while (nup--) {
-+			while(l>1 && stack[l-1]!='/') l--;
-+			if (l>1) l--;
-+			p += 2;
-+			if (p<q) p++;
-+		}
-+		if (q-p && stack[l-1]!='/') stack[l++] = '/';
-+		if (l + (q-p) + 1 >= PATH_MAX) goto toolong;
-+		memmove(output + l, output + p, q - p + 1);
-+		memcpy(output, stack, l);
-+		q = l + q-p;
-+	}
-+
-+	if (resolved) return memcpy(resolved, output, q+1);
-+	else return strdup(output);
-+
-+toolong:
-+	errno = ENAMETOOLONG;
- 	return 0;
- }
diff --git a/srcpkgs/musl/patches/isascii.patch b/srcpkgs/musl/patches/isascii.patch
deleted file mode 100644
index 6719d2ee188fa4..00000000000000
--- a/srcpkgs/musl/patches/isascii.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From e48e99c112246fb580596404074445cb25d7858d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=89rico=20Rolim?= <ericonr@disroot.org>
-Date: Mon, 4 Jan 2021 22:48:34 -0300
-Subject: [PATCH] suppress isascii() macro for C++
-
-analogous to commit a60457c84a4b59ab564d7f4abb660a70283ba98d.
-
-diff --git include/ctype.h include/ctype.h
-index 7936536f..32bcef4d 100644
---- a/include/ctype.h
-+++ b/include/ctype.h
-@@ -64,7 +64,9 @@ int   isascii(int);
- int   toascii(int);
- #define _tolower(a) ((a)|0x20)
- #define _toupper(a) ((a)&0x5f)
-+#ifndef __cplusplus
- #define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
-+#endif
- 
- #endif
- 
diff --git a/srcpkgs/musl/patches/mo_lookup.patch b/srcpkgs/musl/patches/mo_lookup.patch
deleted file mode 100644
index ae86e33c9c700e..00000000000000
--- a/srcpkgs/musl/patches/mo_lookup.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not crash with a NULL pointer dereference when dcngettext()
-is called with NULL msgid[12] arguments.
-
-Fix for https://github.com/void-linux/void-packages/issues/12042
-and probably others.
-
-	--xtraeme
-
---- a/src/locale/__mo_lookup.c.orig	2019-06-26 09:55:36.843012674 +0200
-+++ b/src/locale/__mo_lookup.c	2019-06-26 09:56:11.529443955 +0200
-@@ -13,7 +13,7 @@ const char *__mo_lookup(const void *p, s
- 	uint32_t b = 0, n = swapc(mo[2], sw);
- 	uint32_t o = swapc(mo[3], sw);
- 	uint32_t t = swapc(mo[4], sw);
--	if (n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
-+	if (!s || n>=size/4 || o>=size-4*n || t>=size-4*n || ((o|t)%4))
- 		return 0;
- 	o/=4;
- 	t/=4;
diff --git a/srcpkgs/musl/patches/ppc-pt_regs.patch b/srcpkgs/musl/patches/ppc-pt_regs.patch
deleted file mode 100644
index 45815321bf0f1f..00000000000000
--- a/srcpkgs/musl/patches/ppc-pt_regs.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:53:43 2019 -0400
-
-    use struct pt_regs * rather than void * for powerpc[64] sigcontext regs
-    
-    this is to match the kernel and glibc interfaces. here, struct pt_regs
-    is an incomplete type, but that's harmless, and if it's completed by
-    inclusion of another header then members of the struct pointed to by
-    the regs member can be accessed directly without going through a cast
-    or intermediate pointer object.
-
-diff --git a/arch/powerpc/bits/signal.h b/arch/powerpc/bits/signal.h
-index 06efb11c..c1bf3caf 100644
---- a/arch/powerpc/bits/signal.h
-+++ b/arch/powerpc/bits/signal.h
-@@ -28,7 +28,7 @@ struct sigcontext {
- 	int signal;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- };
- 
- typedef struct {
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 4dec22a5..d5493b18 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -32,7 +32,7 @@ typedef struct sigcontext {
- 	int _pad0;
- 	unsigned long handler;
- 	unsigned long oldmask;
--	void *regs;
-+	struct pt_regs *regs;
- 	gregset_t gp_regs;
- 	fpregset_t fp_regs;
- 	vrregset_t *v_regs;
diff --git a/srcpkgs/musl/patches/ppc64-fpregset_t.patch b/srcpkgs/musl/patches/ppc64-fpregset_t.patch
deleted file mode 100644
index 12617ba0ef7d59..00000000000000
--- a/srcpkgs/musl/patches/ppc64-fpregset_t.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c9f48cde0a22641ce3daf54596a9ecebdab91435
-Author: Rich Felker <dalias@aerifal.cx>
-Date:   Sat Oct 19 15:39:45 2019 -0400
-
-    fix fpregset_t type on powerpc64
-    
-    the userspace ucontext API has this as an array rather than a
-    structure.
-    
-    commit 3c59a868956636bc8adafb1b168d090897692532 fixed the
-    corresponding mistake for vrregset_t, namely that the original
-    powerpc64 port used a mix of types from 32-bit powerpc and powerpc64
-    rather than matching the 64-bit types.
-
-diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
-index 2cc0604c..4dec22a5 100644
---- a/arch/powerpc64/bits/signal.h
-+++ b/arch/powerpc64/bits/signal.h
-@@ -9,11 +9,7 @@
- #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
- 
- typedef unsigned long greg_t, gregset_t[48];
--
--typedef struct {
--	double fpregs[32];
--	double fpscr;
--} fpregset_t;
-+typedef double fpregset_t[33];
- 
- typedef struct {
- #ifdef __GNUC__
diff --git a/srcpkgs/musl/patches/ppcle.patch b/srcpkgs/musl/patches/ppcle.patch
deleted file mode 100644
index 7d49338a5a0f19..00000000000000
--- a/srcpkgs/musl/patches/ppcle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 20dfc2002482a21b955b710af119a01aecee784b Mon Sep 17 00:00:00 2001
-From: Daniel Kolesa <daniel@octaforge.org>
-Date: Tue, 15 Dec 2020 20:42:17 +0100
-Subject: [PATCH] add ppc32 le subarch
-
----
- configure | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git configure configure
-index 8680128..f1ca58e 100755
---- a/configure
-+++ b/configure
-@@ -645,6 +645,7 @@ fi
- if test "$ARCH" = "powerpc" ; then
- trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
-   "$0: error: compiler's floating point configuration is unsupported"
-+trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
- trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
- fi
- 
--- 
-2.29.2
-
diff --git a/srcpkgs/musl/patches/riscv64-ucontext.patch b/srcpkgs/musl/patches/riscv64-ucontext.patch
deleted file mode 100644
index 5afac82b6d21d1..00000000000000
--- a/srcpkgs/musl/patches/riscv64-ucontext.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 56f0631d9553dc06530ff661527cf1fcd595a0d1 Mon Sep 17 00:00:00 2001
-From: Drew DeVault <sir@cmpwn.com>
-Date: Sat, 5 Dec 2020 18:10:06 +0000
-Subject: [PATCH] riscv64: fix inconsistent ucontext_t struct tag
-
-ucontext.h depends on the internal struct tag name for namespacing
-reasons, and the intent was always for it to be consistent across
-archs anyway.
----
- arch/riscv64/bits/signal.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/riscv64/bits/signal.h b/arch/riscv64/bits/signal.h
-index b006334f7..287367db7 100644
---- a/arch/riscv64/bits/signal.h
-+++ b/arch/riscv64/bits/signal.h
-@@ -60,10 +60,10 @@ struct sigaltstack {
- 	size_t ss_size;
- };
- 
--typedef struct ucontext_t
-+typedef struct __ucontext
- {
- 	unsigned long uc_flags;
--	struct ucontext_t *uc_link;
-+	struct __ucontext *uc_link;
- 	stack_t uc_stack;
- 	sigset_t uc_sigmask;
- 	mcontext_t uc_mcontext;
diff --git a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch b/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
deleted file mode 100644
index 3286432ebea23e..00000000000000
--- a/srcpkgs/musl/patches/work_around_linux_bug_in_readlink_syscall_with_zero_buffer.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From e2fa720be7024cce4fc489f3877476d35da48ee2 Mon Sep 17 00:00:00 2001
-From: Rich Felker <dalias@aerifal.cx>
-Date: Mon, 23 Nov 2020 19:44:19 -0500
-Subject: [PATCH] work around linux bug in readlink syscall with zero buffer
- size
-
-linux fails with EINVAL when a zero buffer size is passed to the
-syscall. this is non-conforming because POSIX already defines EINVAL
-with a significantly different meaning: the target is not a symlink.
-
-since the request is semantically valid, patch it up by using a dummy
-buffer of length one, and truncating the return value to zero if it
-succeeds.
----
- src/unistd/readlink.c   | 11 +++++++++--
- src/unistd/readlinkat.c |  9 ++++++++-
- 2 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/src/unistd/readlink.c b/src/unistd/readlink.c
-index a152d5249..32f4537f9 100644
---- a/src/unistd/readlink.c
-+++ b/src/unistd/readlink.c
-@@ -4,9 +4,16 @@
- 
- ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize)
- {
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
- #ifdef SYS_readlink
--	return syscall(SYS_readlink, path, buf, bufsize);
-+	int r = __syscall(SYS_readlink, path, buf, bufsize);
- #else
--	return syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
-+	int r = __syscall(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
- #endif
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
-diff --git a/src/unistd/readlinkat.c b/src/unistd/readlinkat.c
-index 9af45cd5a..f79d3d142 100644
---- a/src/unistd/readlinkat.c
-+++ b/src/unistd/readlinkat.c
-@@ -3,5 +3,12 @@
- 
- ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize)
- {
--	return syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	char dummy[1];
-+	if (!bufsize) {
-+		buf = dummy;
-+		bufsize = 1;
-+	}
-+	int r = __syscall(SYS_readlinkat, fd, path, buf, bufsize);
-+	if (buf == dummy && r > 0) r = 0;
-+	return __syscall_ret(r);
- }
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 8c3be7d76e8a1e..4cbd948ed31dcf 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -1,8 +1,7 @@
 # Template file for 'musl'
 pkgname=musl
-reverts="1.2.0_1"
-version=1.1.24
-revision=20
+version=1.2.5
+revision=1
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure
@@ -12,7 +11,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MIT"
 homepage="https://musl.libc.org/"
 distfiles="https://musl.libc.org/releases/musl-${version}.tar.gz"
-checksum=1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3
+checksum=a9a118bbe84d8764da0ea0d28b3ab3fae8477fc7e4085d90102b8596fc7c75e4
 
 nostrip_files="libc.so"
 shlib_provides="libc.so"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (18 preceding siblings ...)
  2023-03-15 17:50 ` musl dkwo
@ 2023-03-20 16:10 ` CameronNemo
  19 siblings, 0 replies; 34+ messages in thread
From: CameronNemo @ 2023-03-20 16:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

New comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1476528080

Comment:
This is too much work and I have too much to do.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (17 preceding siblings ...)
  2023-01-28 15:56 ` musl dkwo
@ 2023-03-15 17:50 ` dkwo
  2023-03-20 16:10 ` musl CameronNemo
  19 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-03-15 17:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1470490550

Comment:
Maybe you also want to update the `_musl_version` in the various `cross-*-linux-musl` packages?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (16 preceding siblings ...)
  2023-01-27 20:12 ` musl CameronNemo
@ 2023-01-28 15:56 ` dkwo
  2023-03-15 17:50 ` musl dkwo
  2023-03-20 16:10 ` musl CameronNemo
  19 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-01-28 15:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1407427360

Comment:
@CameronNemo Thanks, I wasn't aware of that. Does any other package manager, like Alpine's apk, solve this issue?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (15 preceding siblings ...)
  2023-01-27 18:29 ` musl dkwo
@ 2023-01-27 20:12 ` CameronNemo
  2023-01-28 15:56 ` musl dkwo
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: CameronNemo @ 2023-01-27 20:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

New comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1407027144

Comment:
@dkwo the hard part is not so much rebuilding, as it is re-installing every package in an atomic way.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (14 preceding siblings ...)
  2023-01-27 18:29 ` musl dkwo
@ 2023-01-27 18:29 ` dkwo
  2023-01-27 20:12 ` musl CameronNemo
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-01-27 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1406921964

Comment:
@CameronNemo I've built this natively on aarhc64. I'm not going to rebuild the whole world for now, but if there's a few packages that you want to test, let me know.
@nekopsykose Those packages I mentioned need rebuild also on 64 (e.g. O_LARGEFILE, sandbox issues).
@paper42  Instead of waiting forever for abi support, wouldn't it be more practical to rebuild everything for all archs? you may have a week or two of freezing, but at least from my user perspective that's much better than the current situation.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (13 preceding siblings ...)
  2022-12-27 17:58 ` musl dkwo
@ 2023-01-27 18:29 ` dkwo
  2023-01-27 18:29 ` musl dkwo
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2023-01-27 18:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1406921964

Comment:
@CameronNemo I've built this natively on aarhc64. I'm not going to rebuild the whole world for now, but if there's a few packages that you want to test, let me know.
@nekopsykose Those packages I mentioned need rebuild also on 64 (e.g. O_LARGEFILE, sandbox issues).
@paper Instead of waiting forever for abi support, wouldn't it be more practical to rebuild everything for all archs? you may have a week or two of freezing, but at least from my user perspective that's much better than the current situation.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (12 preceding siblings ...)
  2022-12-27 17:57 ` musl dkwo
@ 2022-12-27 17:58 ` dkwo
  2023-01-27 18:29 ` musl dkwo
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2022-12-27 17:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1366078662

Comment:
@CameronNemo That was on `x86_64`. I have an `aarch64` laptop where I can test this natively, but I'm away from it until mid Jan.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (11 preceding siblings ...)
  2022-12-27 17:39 ` musl paper42
@ 2022-12-27 17:57 ` dkwo
  2022-12-27 17:58 ` musl dkwo
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2022-12-27 17:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1366078662

Comment:
@CameronNemo That was on `x86_64`. I have an `aarhc64` laptop where I can test this natively, but I'm away from it until mid Jan.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (10 preceding siblings ...)
  2022-12-27 17:36 ` musl nekopsykose
@ 2022-12-27 17:39 ` paper42
  2022-12-27 17:57 ` musl dkwo
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: paper42 @ 2022-12-27 17:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1366069093

Comment:
> it's technically abi breaking for 32-bit, so everything has to be rebuilt, not just those. but on 64 you wouldnt notice anything indeed

We are aware of that and that's why this PR is marked as a draft and waiting for https://github.com/void-linux/xbps/pull/331 or something similar.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (9 preceding siblings ...)
  2022-12-27 17:33 ` musl CameronNemo
@ 2022-12-27 17:36 ` nekopsykose
  2022-12-27 17:39 ` musl paper42
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: nekopsykose @ 2022-12-27 17:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

New comment by nekopsykose on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1366067711

Comment:
it's technically abi breaking for 32-bit, so everything has to be rebuilt, not just those. but on 64 you wouldnt notice anything indeed

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (8 preceding siblings ...)
  2022-12-27 17:22 ` musl dkwo
@ 2022-12-27 17:33 ` CameronNemo
  2022-12-27 17:36 ` musl nekopsykose
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: CameronNemo @ 2022-12-27 17:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

New comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1366065932

Comment:
@dkwo are you using aarch64? I specifically was going to set up an armv7l-musl chroot on my rock64 or PBP, install (and test running) various packages, and rebuild all of them with musl 1.2.3. Then I was going to try a full system (potentially offline) upgrade of a full armv7l system running on my rock64.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (7 preceding siblings ...)
  2022-12-26 21:56 ` musl oreo639
@ 2022-12-27 17:22 ` dkwo
  2022-12-27 17:33 ` musl CameronNemo
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: dkwo @ 2022-12-27 17:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1366060108

Comment:
I've been using musl-1.2.3, with no issues. You may want to rebuild firefox, thunderbird, zathura, maybe others (due to sandbox).

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (6 preceding siblings ...)
  2022-12-26 21:54 ` musl oreo639
@ 2022-12-26 21:56 ` oreo639
  2022-12-27 17:22 ` musl dkwo
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: oreo639 @ 2022-12-26 21:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1365478315

Comment:
> Build failures on cross musl seem at least tangentially libssp related

Those aren't build failures they are broken packages that depend on musl. (Sometimes false positives can show up though)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (5 preceding siblings ...)
  2022-12-26 21:53 ` musl oreo639
@ 2022-12-26 21:54 ` oreo639
  2022-12-26 21:56 ` musl oreo639
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: oreo639 @ 2022-12-26 21:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1365478315

Comment:
> Build failures on cross musl seem at least tangentially libssp related

Those aren't build failures they are broken packages that depend on musl.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (4 preceding siblings ...)
  2022-12-26 21:53 ` musl oreo639
@ 2022-12-26 21:53 ` oreo639
  2022-12-26 21:54 ` musl oreo639
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: oreo639 @ 2022-12-26 21:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1365478315

Comment:
> Build failures on cross musl seem at least tangentially libssp related

Those aren't build failures they are broken packages.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (3 preceding siblings ...)
  2022-12-26 21:53 ` musl oreo639
@ 2022-12-26 21:53 ` oreo639
  2022-12-26 21:53 ` musl oreo639
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: oreo639 @ 2022-12-26 21:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1365478315

Comment:
> Build failures on cross musl seem at least tangentially libssp related

Those aren't build failures they are broken packages. (although idk if those are false positives)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
                   ` (2 preceding siblings ...)
  2022-12-26 21:51 ` musl oreo639
@ 2022-12-26 21:53 ` oreo639
  2022-12-26 21:53 ` musl oreo639
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: oreo639 @ 2022-12-26 21:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1365478315

Comment:
> Build failures on cross musl seem at least tangentially libssp related

Those aren't build failures those are broken packages. (although idk if those are false positives)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
  2022-12-26 15:45 ` musl JamiKettunen
  2022-12-26 19:33 ` musl CameronNemo
@ 2022-12-26 21:51 ` oreo639
  2022-12-26 21:53 ` musl oreo639
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: oreo639 @ 2022-12-26 21:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1365478315

Comment:
> Build failures on cross musl seem at least tangentially libssp related

Those aren't build failures those are supposedly broken packages. (although idk if those are false positives)

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
  2022-12-26 15:45 ` musl JamiKettunen
@ 2022-12-26 19:33 ` CameronNemo
  2022-12-26 21:51 ` musl oreo639
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: CameronNemo @ 2022-12-26 19:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

New comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1365400724

Comment:
Build failures on cross musl seem at least tangentially libssp related:

```
Trying to install dependants of base-chroot:
Trying to install dependants of base-devel:
Trying to install dependants of musl-devel:
ccache-4.6.3_1: broken, unresolvable shlib `libgcc_s.so.1'
nghttp2-1.51.0_1: broken, unresolvable shlib `libgcc_s.so.1'
libxbps-0.59.1_7: broken, unresolvable shlib `libssp.so.0'
xbps-0.59.1_7: broken, unresolvable shlib `libssp.so.0'
ccache-4.6.3_1: broken, unresolvable shlib `libstdc++.so.6'
nghttp2-1.51.0_1: broken, unresolvable shlib `libstdc++.so.6'
Transaction aborted due to unresolved shlibs.
Failed to install 'musl-devel' and 'base-chroot-0.68_1'
Error: Process completed with exit code 1.
```

Curiously, both of those builds worked locally.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: musl
  2022-12-26  6:05 [PR PATCH] musl CameronNemo
@ 2022-12-26 15:45 ` JamiKettunen
  2022-12-26 19:33 ` musl CameronNemo
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 34+ messages in thread
From: JamiKettunen @ 2022-12-26 15:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

New comment by JamiKettunen on void-packages repository

https://github.com/void-linux/void-packages/pull/41295#issuecomment-1365255907

Comment:
Related: https://github.com/void-linux/xbps/pull/331 (and other things linking to that PR)

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2024-03-31 14:01 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 19:35 [PR PATCH] musl dkwo
2023-03-29 19:36 ` musl dkwo
2023-03-29 19:57 ` [PR PATCH] [Updated] musl dkwo
2023-03-29 20:04 ` musl dkwo
2023-03-29 20:04 ` [PR PATCH] [Updated] musl dkwo
2023-05-02 16:05 ` dkwo
2023-05-02 20:14 ` [PR PATCH] [Updated] musl 1.2 dkwo
2023-05-02 20:16 ` dkwo
2023-08-01  1:57 ` github-actions
2023-08-01 10:04 ` [PR PATCH] [Updated] " dkwo
2023-10-31  1:45 ` github-actions
2023-11-01 19:07 ` [PR PATCH] [Updated] " dkwo
2024-01-31 20:36 ` dkwo
2024-03-31 14:01 ` dkwo
  -- strict thread matches above, loose matches on Subject: below --
2022-12-26  6:05 [PR PATCH] musl CameronNemo
2022-12-26 15:45 ` musl JamiKettunen
2022-12-26 19:33 ` musl CameronNemo
2022-12-26 21:51 ` musl oreo639
2022-12-26 21:53 ` musl oreo639
2022-12-26 21:53 ` musl oreo639
2022-12-26 21:53 ` musl oreo639
2022-12-26 21:54 ` musl oreo639
2022-12-26 21:56 ` musl oreo639
2022-12-27 17:22 ` musl dkwo
2022-12-27 17:33 ` musl CameronNemo
2022-12-27 17:36 ` musl nekopsykose
2022-12-27 17:39 ` musl paper42
2022-12-27 17:57 ` musl dkwo
2022-12-27 17:58 ` musl dkwo
2023-01-27 18:29 ` musl dkwo
2023-01-27 18:29 ` musl dkwo
2023-01-27 20:12 ` musl CameronNemo
2023-01-28 15:56 ` musl dkwo
2023-03-15 17:50 ` musl dkwo
2023-03-20 16:10 ` musl CameronNemo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).