diff --git a/parts.rst b/parts.rst index 82d2cc0f..310ee466 100644 --- a/parts.rst +++ b/parts.rst @@ -286,7 +286,7 @@ patch 2.5.9 ``patch`` is a very useful tool at this stage, allowing us to make significantly more complex edits, including just changes to lines. -gzip 1.2.4 +gzip 1.2.5 ========== ``gzip`` is the most common compression format used for software source @@ -399,6 +399,9 @@ from building many newer or more complex programs. ``tcc`` has slight problems when building and linking ``musl``, so we apply a few patches. +We also get rid of a few functions from ``musl``, as they rely on pregenerated +files we are unable to generate at this stage. + We do not use any of ``/usr/lib/mes`` or ``/usr/include/mes`` any longer, rather using ``/usr/lib`` and ``/usr/include`` like normal. @@ -422,6 +425,19 @@ tcc 0.9.27 (musl v2) Now that we have a ‘fixed’ ``musl``, we now recompile ``tcc`` as ``tcc`` uses floats extensively. +grep 2.4 +======== + +GNU ``grep`` is a pattern matching utility. ``grep`` is needed to rebuild some +generated header files in ``musl``. + +musl 1.1.24 (v3) +================ + +We are now able to regenerate those header files that we couldn't regenerate +earlier. We unlock the full range of ``musl`` support, required for a +number of applications (e.g. ``flex``) before the next ``musl`` rebuild. + sed 4.0.9 ========= @@ -485,12 +501,6 @@ a 3 stage process: Finally we have a fully functional ``bison`` executable. -grep 2.4 -======== - -GNU ``grep`` is a pattern matching utility. Is is not immediately needed -but will be useful later for autotools. - diffutils 2.7 ============= @@ -692,10 +702,10 @@ In particular we can now use full featured ``ar`` instead of ``tcc -ar``, the GNU linker ``ld``, which allows us building shared libraries, and the GNU assembler ``as``. -musl 1.1.24 (v3) +musl 1.1.24 (v4) ================ -We rebuild musl for the third time. This time we can use GNU as to build assembly source files, +We rebuild musl for the fourth time. This time we can use GNU as to build assembly source files, so those assembly files that tcc failed to compile no longer have to be patched. tcc 0.9.27 (musl v3) @@ -722,7 +732,7 @@ findutils 4.2.33 GNU Find Utilities can be used to search for files. We are mainly interested in ``find`` and ``xargs`` that are often used in scripts. -musl 1.2.4 +musl 1.2.5 ========== GCC can build the latest as of the time of writing musl version. @@ -879,7 +889,7 @@ swap If enabled in ``bootstrap.cfg``, creates and activates a swap file under the name ``/swapfile``. -musl 1.2.4 +musl 1.2.5 ========== At this point, it is guaranteed that we are running on Linux with thread support, @@ -1173,7 +1183,7 @@ We use the `gnu-autogen-bootstrapping + +SPDX-License-Identifier: MIT + +diff --color -ru include/wchar.h include/wchar.h +--- musl-chartable-tools-44d780e03e78efcb3168ceab068170206dc92e85/include/wchar.h 2024-12-21 11:29:46.207537390 +1100 ++++ musl-chartable-tools-44d780e03e78efcb3168ceab068170206dc92e85/include/wchar.h 2024-12-21 12:03:00.494377416 +1100 +@@ -175,10 +175,7 @@ + #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + int wcwidth (wchar_t); + int wcswidth (const wchar_t *, size_t); +-int iswalnum(wint_t); +-int iswalpha(wint_t); + int iswblank(wint_t); +-int iswcntrl(wint_t); + int iswdigit(wint_t); + int iswgraph(wint_t); + int iswlower(wint_t); +@@ -187,9 +184,6 @@ + int iswspace(wint_t); + int iswupper(wint_t); + int iswxdigit(wint_t); +-int iswctype(wint_t, wctype_t); +-wint_t towlower(wint_t); +-wint_t towupper(wint_t); + wctype_t wctype(const char *); + + #ifndef __cplusplus +diff --color -ru include/wctype.h include/wctype.h +--- musl-chartable-tools-44d780e03e78efcb3168ceab068170206dc92e85/include/wctype.h 2024-12-21 11:29:46.207537390 +1100 ++++ musl-chartable-tools-44d780e03e78efcb3168ceab068170206dc92e85/include/wctype.h 2024-12-21 12:07:48.030354351 +1100 +@@ -24,10 +24,7 @@ + + #undef iswdigit + +-int iswalnum(wint_t); +-int iswalpha(wint_t); + int iswblank(wint_t); +-int iswcntrl(wint_t); + int iswdigit(wint_t); + int iswgraph(wint_t); + int iswlower(wint_t); +@@ -36,10 +33,6 @@ + int iswspace(wint_t); + int iswupper(wint_t); + int iswxdigit(wint_t); +-int iswctype(wint_t, wctype_t); +-wint_t towctrans(wint_t, wctrans_t); +-wint_t towlower(wint_t); +-wint_t towupper(wint_t); + wctrans_t wctrans(const char *); + wctype_t wctype(const char *); + diff --git a/steps/musl-1.1.24/pass1.sh b/steps/musl-1.1.24/pass1.sh index 25639cfa..f9e9f8eb 100755 --- a/steps/musl-1.1.24/pass1.sh +++ b/steps/musl-1.1.24/pass1.sh @@ -5,6 +5,13 @@ src_prepare() { default + # meslibc is insufficient to regenerate src/ctype or src/iconv + # disable everything using a generated header + patch -Np1 -i ../../files/disable_ctype_headers.patch + rm src/ctype/iswalpha.c src/ctype/iswalnum.c src/ctype/iswctype.c \ + src/ctype/towctrans.c + rm include/iconv.h src/locale/iconv.c src/locale/iconv_close.c + # tcc does not support complex types rm -rf src/complex diff --git a/steps/musl-1.1.24/pass3.sh b/steps/musl-1.1.24/pass3.sh index 6f7c1ae2..25639cfa 100755 --- a/steps/musl-1.1.24/pass3.sh +++ b/steps/musl-1.1.24/pass3.sh @@ -7,6 +7,9 @@ src_prepare() { # tcc does not support complex types rm -rf src/complex + + # Configure fails without this + mkdir -p /dev } src_configure() { @@ -15,7 +18,7 @@ src_configure() { --disable-shared \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ - --includedir="${PREFIX}/include" + --includedir="${PREFIX}/include/" # configure script creates this file if test -f /dev/null; then @@ -24,9 +27,5 @@ src_configure() { } src_compile() { - make "${MAKEJOBS}" PREFIX="${PREFIX}" CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<' -} - -src_install() { - make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install + make "${MAKEJOBS}" CROSS_COMPILE= AR="tcc -ar" RANLIB=true CFLAGS="-DSYSCALL_NO_TLS" } diff --git a/steps/musl-1.1.24/pass4.sh b/steps/musl-1.1.24/pass4.sh new file mode 100755 index 00000000..6f7c1ae2 --- /dev/null +++ b/steps/musl-1.1.24/pass4.sh @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2021 Andrius Štikonas +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + default + + # tcc does not support complex types + rm -rf src/complex +} + +src_configure() { + CC=tcc ./configure \ + --host=i386 \ + --disable-shared \ + --prefix="${PREFIX}" \ + --libdir="${LIBDIR}" \ + --includedir="${PREFIX}/include" + + # configure script creates this file + if test -f /dev/null; then + rm /dev/null + fi +} + +src_compile() { + make "${MAKEJOBS}" PREFIX="${PREFIX}" CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<' +} + +src_install() { + make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install +} diff --git a/steps/musl-1.1.24/patches-pass3/avoid_set_thread_area.patch b/steps/musl-1.1.24/patches-pass4/avoid_set_thread_area.patch similarity index 100% rename from steps/musl-1.1.24/patches-pass3/avoid_set_thread_area.patch rename to steps/musl-1.1.24/patches-pass4/avoid_set_thread_area.patch diff --git a/steps/musl-1.1.24/patches-pass3/avoid_sys_clone.patch b/steps/musl-1.1.24/patches-pass4/avoid_sys_clone.patch similarity index 100% rename from steps/musl-1.1.24/patches-pass3/avoid_sys_clone.patch rename to steps/musl-1.1.24/patches-pass4/avoid_sys_clone.patch diff --git a/steps/musl-1.1.24/patches-pass3/madvise_preserve_errno.patch b/steps/musl-1.1.24/patches-pass4/madvise_preserve_errno.patch similarity index 100% rename from steps/musl-1.1.24/patches-pass3/madvise_preserve_errno.patch rename to steps/musl-1.1.24/patches-pass4/madvise_preserve_errno.patch diff --git a/steps/musl-1.1.24/patches-pass3/set_thread_area.patch b/steps/musl-1.1.24/patches-pass4/set_thread_area.patch similarity index 100% rename from steps/musl-1.1.24/patches-pass3/set_thread_area.patch rename to steps/musl-1.1.24/patches-pass4/set_thread_area.patch diff --git a/steps/musl-1.1.24/patches-pass3/va_list.patch b/steps/musl-1.1.24/patches-pass4/va_list.patch similarity index 100% rename from steps/musl-1.1.24/patches-pass3/va_list.patch rename to steps/musl-1.1.24/patches-pass4/va_list.patch diff --git a/steps/musl-1.2.4/files/__stack_chk_fail_local.c b/steps/musl-1.2.4/files/__stack_chk_fail_local.c deleted file mode 100644 index 144d97b8..00000000 --- a/steps/musl-1.2.4/files/__stack_chk_fail_local.c +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020 Timo Teräs - * - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -extern void __stack_chk_fail(void); -void __attribute__((visibility ("hidden"))) __stack_chk_fail_local(void) { __stack_chk_fail(); } diff --git a/steps/musl-1.2.4/sources b/steps/musl-1.2.4/sources deleted file mode 100644 index 3c0a41b9..00000000 --- a/steps/musl-1.2.4/sources +++ /dev/null @@ -1 +0,0 @@ -https://musl.libc.org/releases/musl-1.2.4.tar.gz 7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039 diff --git a/steps/musl-1.2.4/files/ld-musl-i386.path b/steps/musl-1.2.5/files/ld-musl-i386.path similarity index 100% rename from steps/musl-1.2.4/files/ld-musl-i386.path rename to steps/musl-1.2.5/files/ld-musl-i386.path diff --git a/steps/musl-1.2.4/files/ld-musl-i386.path.license b/steps/musl-1.2.5/files/ld-musl-i386.path.license similarity index 100% rename from steps/musl-1.2.4/files/ld-musl-i386.path.license rename to steps/musl-1.2.5/files/ld-musl-i386.path.license diff --git a/steps/musl-1.2.4/pass1.sh b/steps/musl-1.2.5/pass1.sh similarity index 100% rename from steps/musl-1.2.4/pass1.sh rename to steps/musl-1.2.5/pass1.sh diff --git a/steps/musl-1.2.4/pass2.sh b/steps/musl-1.2.5/pass2.sh similarity index 100% rename from steps/musl-1.2.4/pass2.sh rename to steps/musl-1.2.5/pass2.sh diff --git a/steps/musl-1.2.4/pass3.sh b/steps/musl-1.2.5/pass3.sh similarity index 100% rename from steps/musl-1.2.4/pass3.sh rename to steps/musl-1.2.5/pass3.sh diff --git a/steps/musl-1.2.4/patches-pass2/.keep b/steps/musl-1.2.5/patches-pass2/.keep similarity index 100% rename from steps/musl-1.2.4/patches-pass2/.keep rename to steps/musl-1.2.5/patches-pass2/.keep diff --git a/steps/musl-1.2.4/patches-pass3 b/steps/musl-1.2.5/patches-pass3 similarity index 100% rename from steps/musl-1.2.4/patches-pass3 rename to steps/musl-1.2.5/patches-pass3 diff --git a/steps/musl-1.2.4/patches/avoid_set_thread_area.patch b/steps/musl-1.2.5/patches/avoid_set_thread_area.patch similarity index 78% rename from steps/musl-1.2.4/patches/avoid_set_thread_area.patch rename to steps/musl-1.2.5/patches/avoid_set_thread_area.patch index c5a51874..b79c301d 100644 --- a/steps/musl-1.2.4/patches/avoid_set_thread_area.patch +++ b/steps/musl-1.2.5/patches/avoid_set_thread_area.patch @@ -1,8 +1,8 @@ # SPDX-FileCopyrightText: 2023 Richard Masters # 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.4/arch/i386/pthread_arch.h 2022-04-07 17:12:40.000000000 +0000 -+++ musl-1.2.4/arch/i386/pthread_arch.h 2023-04-07 12:07:07.929132587 +0000 +--- 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() @@ -15,16 +15,16 @@ diff -r -u musl-1.2.3.orig/arch/i386/pthread_arch.h musl-1.2.3/arch/i386/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.4/arch/i386/syscall_arch.h 2022-04-07 17:12:40.000000000 +0000 -+++ musl-1.2.4/arch/i386/syscall_arch.h 2022-12-20 17:28:21.734839560 +0000 +--- 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.4/src/env/__init_tls.c 2022-04-07 17:12:40.000000000 +0000 -+++ musl-1.2.4/src/env/__init_tls.c 2023-04-07 12:07:38.677133193 +0000 +--- 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" diff --git a/steps/musl-1.2.4/patches/avoid_sys_clone.patch b/steps/musl-1.2.5/patches/avoid_sys_clone.patch similarity index 73% rename from steps/musl-1.2.4/patches/avoid_sys_clone.patch rename to steps/musl-1.2.5/patches/avoid_sys_clone.patch index b3631254..246d2462 100644 --- a/steps/musl-1.2.4/patches/avoid_sys_clone.patch +++ b/steps/musl-1.2.5/patches/avoid_sys_clone.patch @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2023 Richard Masters # SPDX-License-Identifier: MIT ---- musl-1.2.4/src/process/posix_spawn.c 2022-04-07 17:12:40.000000000 +0000 -+++ musl-1.2.4/src/process/posix_spawn.c 2023-04-07 12:01:57.217126467 +0000 +--- 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; } diff --git a/steps/musl-1.2.5/sources b/steps/musl-1.2.5/sources new file mode 100644 index 00000000..b42bb196 --- /dev/null +++ b/steps/musl-1.2.5/sources @@ -0,0 +1 @@ +https://musl.libc.org/releases/musl-1.2.5.tar.gz a9a118bbe84d8764da0ea0d28b3ab3fae8477fc7e4085d90102b8596fc7c75e4