mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-22 11:06:32 +01:00
Update musl to 1.2.5
This commit is contained in:
parent
68d396ef8f
commit
19b205a382
15 changed files with 82 additions and 90 deletions
1
steps/musl-1.2.5/files/ld-musl-i386.path
Normal file
1
steps/musl-1.2.5/files/ld-musl-i386.path
Normal file
|
|
@ -0,0 +1 @@
|
|||
/usr/lib/i386-unknown-linux-musl
|
||||
3
steps/musl-1.2.5/files/ld-musl-i386.path.license
Normal file
3
steps/musl-1.2.5/files/ld-musl-i386.path.license
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
33
steps/musl-1.2.5/pass1.sh
Executable file
33
steps/musl-1.2.5/pass1.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
src_get() {
|
||||
# Before the last pass the tar file is moved before
|
||||
# the linux build removes all distfiles to save space.
|
||||
if [ -e "../${pkg}.tar.gz" ]; then
|
||||
mkdir "${DISTFILES}"
|
||||
mv "../${pkg}.tar.gz" "${DISTFILES}"
|
||||
else
|
||||
default
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
CC=gcc ./configure \
|
||||
--host=i386-unknown-linux-musl \
|
||||
--disable-shared \
|
||||
--prefix="${PREFIX}" \
|
||||
--libdir="${LIBDIR}" \
|
||||
--includedir="${PREFIX}/include/"
|
||||
|
||||
# configure script creates this file
|
||||
if test -f /dev/null; then
|
||||
rm /dev/null
|
||||
mknod -m 666 /dev/null c 1 3
|
||||
fi
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
make "${MAKEJOBS}" CROSS_COMPILE=
|
||||
}
|
||||
1
steps/musl-1.2.5/pass2.sh
Symbolic link
1
steps/musl-1.2.5/pass2.sh
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
pass1.sh
|
||||
46
steps/musl-1.2.5/pass3.sh
Executable file
46
steps/musl-1.2.5/pass3.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
# SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
|
||||
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
src_configure() {
|
||||
./configure \
|
||||
--host=i386-unknown-linux-musl \
|
||||
--prefix="${PREFIX}" \
|
||||
--libdir="${LIBDIR}" \
|
||||
--includedir="${PREFIX}/include/"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
make "${MAKEJOBS}" CROSS_COMPILE=
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
|
||||
# Make dynamic linker symlink relative in ${PREFIX}/lib
|
||||
rm "${DESTDIR}/lib/ld-musl-i386.so.1"
|
||||
rmdir "${DESTDIR}/lib"
|
||||
mkdir -p "${DESTDIR}${PREFIX}/lib"
|
||||
ln -sr "${DESTDIR}${LIBDIR}/libc.so" "${DESTDIR}${PREFIX}/lib/ld-musl-i386.so.1"
|
||||
|
||||
# Make startup objects available in /usr/lib
|
||||
# Expected by GCC 10+
|
||||
for i in crt1.o crti.o crtn.o Scrt1.o rcrt1.o; do
|
||||
ln -sr "${DESTDIR}${LIBDIR}/${i}" "${DESTDIR}${PREFIX}/lib/${i}"
|
||||
done
|
||||
|
||||
# Add symlink for ldd
|
||||
mkdir -p "${DESTDIR}${PREFIX}/bin"
|
||||
ln -s ../lib/ld-musl-i386.so.1 "${DESTDIR}${PREFIX}/bin/ldd"
|
||||
|
||||
# Add library search path configurtion
|
||||
mkdir -p "${DESTDIR}/etc"
|
||||
cp ld-musl-i386.path "${DESTDIR}/etc"
|
||||
}
|
||||
|
||||
src_postprocess() {
|
||||
# Stripping libc can cause some strange brokenness
|
||||
:
|
||||
}
|
||||
0
steps/musl-1.2.5/patches-pass2/.keep
Normal file
0
steps/musl-1.2.5/patches-pass2/.keep
Normal file
1
steps/musl-1.2.5/patches-pass3
Symbolic link
1
steps/musl-1.2.5/patches-pass3
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
patches-pass2
|
||||
50
steps/musl-1.2.5/patches/avoid_set_thread_area.patch
Normal file
50
steps/musl-1.2.5/patches/avoid_set_thread_area.patch
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
diff -r -u musl-1.2.3.orig/arch/i386/pthread_arch.h musl-1.2.3/arch/i386/pthread_arch.h
|
||||
--- musl-1.2.5/arch/i386/pthread_arch.h 2022-04-07 17:12:40.000000000 +0000
|
||||
+++ musl-1.2.5/arch/i386/pthread_arch.h 2023-04-07 12:07:07.929132587 +0000
|
||||
@@ -1,8 +1,7 @@
|
||||
+extern uintptr_t g_pthread;
|
||||
static inline uintptr_t __get_tp()
|
||||
{
|
||||
- uintptr_t tp;
|
||||
- __asm__ ("movl %%gs:0,%0" : "=r" (tp) );
|
||||
- return tp;
|
||||
+ return g_pthread;
|
||||
}
|
||||
|
||||
#define MC_PC gregs[REG_EIP]
|
||||
diff -r -u musl-1.2.3.orig/arch/i386/syscall_arch.h musl-1.2.3/arch/i386/syscall_arch.h
|
||||
--- musl-1.2.5/arch/i386/syscall_arch.h 2022-04-07 17:12:40.000000000 +0000
|
||||
+++ musl-1.2.5/arch/i386/syscall_arch.h 2022-12-20 17:28:21.734839560 +0000
|
||||
@@ -1,3 +1,4 @@
|
||||
+#define SYSCALL_NO_TLS 1
|
||||
#define __SYSCALL_LL_E(x) \
|
||||
((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
|
||||
((union { long long ll; long l[2]; }){ .ll = x }).l[1]
|
||||
diff -r -u musl-1.2.3.orig/src/env/__init_tls.c musl-1.2.3/src/env/__init_tls.c
|
||||
--- musl-1.2.5/src/env/__init_tls.c 2022-04-07 17:12:40.000000000 +0000
|
||||
+++ musl-1.2.5/src/env/__init_tls.c 2023-04-07 12:07:38.677133193 +0000
|
||||
@@ -10,20 +10,19 @@
|
||||
#include "syscall.h"
|
||||
|
||||
volatile int __thread_list_lock;
|
||||
+uintptr_t g_pthread;
|
||||
|
||||
int __init_tp(void *p)
|
||||
{
|
||||
pthread_t td = p;
|
||||
td->self = td;
|
||||
- int r = __set_thread_area(TP_ADJ(p));
|
||||
- if (r < 0) return -1;
|
||||
- if (!r) libc.can_do_threads = 1;
|
||||
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;
|
||||
+ g_pthread = (uintptr_t) td;
|
||||
return 0;
|
||||
}
|
||||
|
||||
18
steps/musl-1.2.5/patches/avoid_sys_clone.patch
Normal file
18
steps/musl-1.2.5/patches/avoid_sys_clone.patch
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
--- musl-1.2.5/src/process/posix_spawn.c 2022-04-07 17:12:40.000000000 +0000
|
||||
+++ musl-1.2.5/src/process/posix_spawn.c 2023-04-07 12:01:57.217126467 +0000
|
||||
@@ -190,8 +190,11 @@
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- pid = __clone(child, stack+sizeof stack,
|
||||
- CLONE_VM|CLONE_VFORK|SIGCHLD, &args);
|
||||
+ pid = fork();
|
||||
+ if (pid == 0) {
|
||||
+ _exit(child(&args));
|
||||
+ }
|
||||
+
|
||||
close(args.p[1]);
|
||||
UNLOCK(__abort_lock);
|
||||
|
||||
1
steps/musl-1.2.5/sources
Normal file
1
steps/musl-1.2.5/sources
Normal file
|
|
@ -0,0 +1 @@
|
|||
https://musl.libc.org/releases/musl-1.2.5.tar.gz a9a118bbe84d8764da0ea0d28b3ab3fae8477fc7e4085d90102b8596fc7c75e4
|
||||
Loading…
Add table
Add a link
Reference in a new issue