From f3cea25b87c917c72680a1f9d433f238015019f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Wed, 3 Mar 2021 00:05:33 +0000 Subject: [PATCH] Rebuild musl with fewer patches. --- parts.rst | 7 +++++ sysa/helpers.sh | 2 +- sysa/musl-1.1.24/binutils-rebuild.sh | 26 +++++++++++++++++++ sysa/musl-1.1.24/checksums/pass3 | 14 ++++++++++ .../patches-pass3/set_thread_area.patch | 1 + .../patches-pass3/tcc_static.patch | 1 + sysa/musl-1.1.24/patches-pass3/va_list.patch | 1 + sysa/run.sh | 4 +++ 8 files changed, 55 insertions(+), 1 deletion(-) create mode 100755 sysa/musl-1.1.24/binutils-rebuild.sh create mode 100644 sysa/musl-1.1.24/checksums/pass3 create mode 120000 sysa/musl-1.1.24/patches-pass3/set_thread_area.patch create mode 120000 sysa/musl-1.1.24/patches-pass3/tcc_static.patch create mode 120000 sysa/musl-1.1.24/patches-pass3/va_list.patch diff --git a/parts.rst b/parts.rst index 0f492f5..e229ebf 100644 --- a/parts.rst +++ b/parts.rst @@ -407,3 +407,10 @@ managing binary programs, object files, libraries, profile data, and assembly so 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 +=========== + +We rebuild musl for the third time. This time we use GNU ar rather than ``tcc -ar``, +so we can drop weak symbols patch. Also, 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. diff --git a/sysa/helpers.sh b/sysa/helpers.sh index d1f3526..e652358 100755 --- a/sysa/helpers.sh +++ b/sysa/helpers.sh @@ -22,7 +22,7 @@ build () { cd "$pkg" || (echo "Cannot cd into ${pkg}!"; kill $$) echo "${pkg}: beginning build using script ${script_name}" base_dir="${PWD}" - patch_dir="${base_dir}/patches" + patch_dir="${base_dir}/${4:-patches}" mk_dir="${base_dir}/mk" files_dir="${base_dir}/files" diff --git a/sysa/musl-1.1.24/binutils-rebuild.sh b/sysa/musl-1.1.24/binutils-rebuild.sh new file mode 100755 index 0000000..f465148 --- /dev/null +++ b/sysa/musl-1.1.24/binutils-rebuild.sh @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: 2021 Andrius Štikonas +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + default_src_prepare + + # tcc does not support complex types + rm -rf src/complex +} + +src_configure() { + CC=tcc ./configure \ + --host=i386 \ + --disable-shared \ + --prefix=/after \ + --libdir=/after/lib/musl/ \ + --includedir=/after/include/musl + + # configure script creates this file + test -f /dev/null && rm /dev/null +} + +src_compile() { + make CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<' +} diff --git a/sysa/musl-1.1.24/checksums/pass3 b/sysa/musl-1.1.24/checksums/pass3 new file mode 100644 index 0000000..54122d5 --- /dev/null +++ b/sysa/musl-1.1.24/checksums/pass3 @@ -0,0 +1,14 @@ +a50500329680bed4dcc5ec3891fd50f65af9cae7de0b8e8fe925c37f1c6bb16b /after/lib/musl/Scrt1.o +457fff81b3188b82621f3ae49847ebc60128017fcbdba012245169af76cf122a /after/lib/musl/crt1.o +73f64b61e6e9ae83726ab4cc909a7b549b06b6df2b087aedddbcd39cb7146f69 /after/lib/musl/crti.o +f5e325819d86fb381574692b8f9ea24f88f44f185a75adfe461705ecf2619c6e /after/lib/musl/crtn.o +a18d576a501a596ffe67df13eeededeca0d61da42100b9b5687be3d479379641 /after/lib/musl/libc.a +f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libcrypt.a +f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libdl.a +f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libm.a +f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libpthread.a +f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libresolv.a +f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/librt.a +f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libutil.a +f0a17a43c74d2fe5474fa2fd29c8f14799e777d7d75a2cc4d11c20a6e7b161c5 /after/lib/musl/libxnet.a +b60b59a94f10f039977cea2cea6f15b55b402b25df2e1b2a4e83fa84ccf2fd43 /after/lib/musl/rcrt1.o diff --git a/sysa/musl-1.1.24/patches-pass3/set_thread_area.patch b/sysa/musl-1.1.24/patches-pass3/set_thread_area.patch new file mode 120000 index 0000000..e1389ab --- /dev/null +++ b/sysa/musl-1.1.24/patches-pass3/set_thread_area.patch @@ -0,0 +1 @@ +../patches/set_thread_area.patch \ No newline at end of file diff --git a/sysa/musl-1.1.24/patches-pass3/tcc_static.patch b/sysa/musl-1.1.24/patches-pass3/tcc_static.patch new file mode 120000 index 0000000..be8c7ac --- /dev/null +++ b/sysa/musl-1.1.24/patches-pass3/tcc_static.patch @@ -0,0 +1 @@ +../patches/tcc_static.patch \ No newline at end of file diff --git a/sysa/musl-1.1.24/patches-pass3/va_list.patch b/sysa/musl-1.1.24/patches-pass3/va_list.patch new file mode 120000 index 0000000..d71877f --- /dev/null +++ b/sysa/musl-1.1.24/patches-pass3/va_list.patch @@ -0,0 +1 @@ +../patches/va_list.patch \ No newline at end of file diff --git a/sysa/run.sh b/sysa/run.sh index 309cf15..35ed13c 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -84,4 +84,8 @@ build autoconf-2.12 build binutils-2.14 +# Build musl with fewer patches +build musl-1.1.24 binutils-rebuild.sh checksums/pass3 patches-pass3 +populate_device_nodes + echo "Bootstrapping completed."