diff --git a/sysa/musl-1.1.24/patches-pass3/avoid_set_thread_area.patch b/sysa/musl-1.1.24/patches-pass3/avoid_set_thread_area.patch deleted file mode 100644 index bc933c89..00000000 --- a/sysa/musl-1.1.24/patches-pass3/avoid_set_thread_area.patch +++ /dev/null @@ -1,59 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Richard Masters -# SPDX-License-Identifier: MIT -diff -r -u musl-1.1.24.orig/arch/i386/pthread_arch.h musl-1.1.24/arch/i386/pthread_arch.h ---- arch/i386/pthread_arch.h 2019-10-13 21:58:27.000000000 +0000 -+++ arch/i386/pthread_arch.h 2023-02-28 14:06:10.700603762 +0000 -@@ -1,8 +1,18 @@ -+#define BOOTSTRAP -+ -+#ifdef BOOTSTRAP -+extern pthread_t g_pthread; -+#endif -+ - static inline struct pthread *__pthread_self() - { -+#ifndef BOOTSTRAP - struct pthread *self; - __asm__ ("movl %%gs:0,%0" : "=r" (self) ); - return self; -+#else -+ return g_pthread; -+#endif - } - - #define TP_ADJ(p) (p) -diff -r -u musl-1.1.24.orig/src/env/__init_tls.c musl-1.1.24/src/env/__init_tls.c ---- src/env/__init_tls.c 2019-10-13 21:58:27.000000000 +0000 -+++ src/env/__init_tls.c 2023-02-28 14:07:04.956604831 +0000 -@@ -8,22 +8,31 @@ - #include "libc.h" - #include "atomic.h" - #include "syscall.h" -+#define BOOTSTRAP - - volatile int __thread_list_lock; -+#ifdef BOOTSTRAP -+pthread_t g_pthread; -+#endif - - int __init_tp(void *p) - { - pthread_t td = p; - td->self = td; -+#ifndef BOOTSTRAP - int r = __set_thread_area(TP_ADJ(p)); - if (r < 0) return -1; - if (!r) libc.can_do_threads = 1; -+#endif - td->detach_state = DT_JOINABLE; - td->tid = __syscall(SYS_set_tid_address, &__thread_list_lock); - td->locale = &libc.global_locale; - td->robust_list.head = &td->robust_list.head; - td->sysinfo = __sysinfo; - td->next = td->prev = td; -+#ifdef BOOTSTRAP -+ g_pthread = td; -+#endif - return 0; - } - diff --git a/sysa/musl-1.1.24/patches-pass3/avoid_set_thread_area.patch b/sysa/musl-1.1.24/patches-pass3/avoid_set_thread_area.patch new file mode 120000 index 00000000..3f87a3bb --- /dev/null +++ b/sysa/musl-1.1.24/patches-pass3/avoid_set_thread_area.patch @@ -0,0 +1 @@ +../patches/avoid_set_thread_area.patch \ No newline at end of file diff --git a/sysa/musl-1.1.24/patches-pass3/avoid_sys_clone.patch b/sysa/musl-1.1.24/patches-pass3/avoid_sys_clone.patch deleted file mode 100644 index 117be0a5..00000000 --- a/sysa/musl-1.1.24/patches-pass3/avoid_sys_clone.patch +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Richard Masters -# SPDX-License-Identifier: MIT -diff -r -u musl-1.1.24.orig/src/process/posix_spawn.c musl-1.1.24/src/process/posix_spawn.c ---- src/process/posix_spawn.c 2019-10-13 21:58:27.000000000 +0000 -+++ src/process/posix_spawn.c 2023-02-28 14:08:18.636606282 +0000 -@@ -8,6 +8,7 @@ - #include "syscall.h" - #include "pthread_impl.h" - #include "fdop.h" -+#define BOOTSTRAP - - struct args { - int p[2]; -@@ -182,8 +183,16 @@ - args.envp = envp; - pthread_sigmask(SIG_BLOCK, SIGALL_SET, &args.oldmask); - -+#ifndef BOOTSTRAP - pid = __clone(child, stack+sizeof stack, - CLONE_VM|CLONE_VFORK|SIGCHLD, &args); -+#else -+ pid = fork(); -+ if (pid == 0) { -+ _exit(child(&args)); -+ } -+#endif -+ - close(args.p[1]); - - if (pid > 0) { diff --git a/sysa/musl-1.1.24/patches-pass3/avoid_sys_clone.patch b/sysa/musl-1.1.24/patches-pass3/avoid_sys_clone.patch new file mode 120000 index 00000000..ea4b2b8e --- /dev/null +++ b/sysa/musl-1.1.24/patches-pass3/avoid_sys_clone.patch @@ -0,0 +1 @@ +../patches/avoid_sys_clone.patch \ No newline at end of file