From 6ffeb64a1c93c1da9f9fa33198d10c25be54371b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= Date: Wed, 22 May 2024 21:26:57 +0200 Subject: [PATCH 1/3] Build dynamic versions of musl, curl, openssl, zlib, libgcc & guile This is required for the Guix bootstrap to work. --- steps/curl-8.5.0/pass2.sh | 2 +- steps/gcc-10.4.0/pass1.sh | 2 -- steps/gcc-13.1.0/pass1.sh | 4 +--- steps/gcc-4.7.4/pass1.sh | 1 + steps/guile-3.0.9/pass1.sh | 2 +- steps/musl-1.2.4/pass2.sh | 2 +- steps/musl-1.2.4/pass3.sh | 9 ++++++--- steps/openssl-3.0.13/pass1.sh | 2 +- steps/zlib-1.2.13/pass1.sh | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) mode change 100755 => 100644 steps/zlib-1.2.13/pass1.sh diff --git a/steps/curl-8.5.0/pass2.sh b/steps/curl-8.5.0/pass2.sh index efc3339c..ffe61c68 100755 --- a/steps/curl-8.5.0/pass2.sh +++ b/steps/curl-8.5.0/pass2.sh @@ -19,7 +19,7 @@ src_prepare() { } src_configure() { - LDFLAGS="-static" ./configure \ + ./configure \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ --build=i386-unknown-linux-musl \ diff --git a/steps/gcc-10.4.0/pass1.sh b/steps/gcc-10.4.0/pass1.sh index 99db8dda..dd2dd463 100755 --- a/steps/gcc-10.4.0/pass1.sh +++ b/steps/gcc-10.4.0/pass1.sh @@ -80,7 +80,6 @@ src_configure() { # For this GCC, we only build one stage, as extra is superfluous, # since we build GCC 12 straight after. CFLAGS="-std=gnu11" \ - LDFLAGS="-static" \ ../configure \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ @@ -88,7 +87,6 @@ src_configure() { --target=i386-unknown-linux-musl \ --host=i386-unknown-linux-musl \ --disable-bootstrap \ - --enable-static \ --program-transform-name= \ --enable-languages=c,c++ \ --with-system-zlib \ diff --git a/steps/gcc-13.1.0/pass1.sh b/steps/gcc-13.1.0/pass1.sh index 232df118..1d056b25 100755 --- a/steps/gcc-13.1.0/pass1.sh +++ b/steps/gcc-13.1.0/pass1.sh @@ -75,7 +75,6 @@ src_configure() { mkdir build cd build - LDFLAGS="-static" \ ../configure \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ @@ -83,7 +82,6 @@ src_configure() { --target=i386-unknown-linux-musl \ --host=i386-unknown-linux-musl \ --enable-bootstrap \ - --enable-static \ --disable-plugins \ --disable-libssp \ --disable-libsanitizer \ @@ -95,5 +93,5 @@ src_configure() { } src_compile() { - make "${MAKEJOBS}" BOOT_LDFLAGS="-static" + make "${MAKEJOBS}" } diff --git a/steps/gcc-4.7.4/pass1.sh b/steps/gcc-4.7.4/pass1.sh index 21027ecc..dcf79850 100755 --- a/steps/gcc-4.7.4/pass1.sh +++ b/steps/gcc-4.7.4/pass1.sh @@ -112,6 +112,7 @@ src_configure() { --target=i386-unknown-linux-musl \ --host=i386-unknown-linux-musl \ --disable-shared \ + --disable-plugin \ --program-transform-name= \ --enable-languages=c,c++ \ --disable-sjlj-exceptions \ diff --git a/steps/guile-3.0.9/pass1.sh b/steps/guile-3.0.9/pass1.sh index 205af11a..91c54ecc 100755 --- a/steps/guile-3.0.9/pass1.sh +++ b/steps/guile-3.0.9/pass1.sh @@ -56,7 +56,7 @@ src_configure() { --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ --build=i386-unknown-linux-musl \ - --disable-shared \ + --enable-shared \ --disable-jit popd done diff --git a/steps/musl-1.2.4/pass2.sh b/steps/musl-1.2.4/pass2.sh index c069796d..b573b269 120000 --- a/steps/musl-1.2.4/pass2.sh +++ b/steps/musl-1.2.4/pass2.sh @@ -1 +1 @@ -pass1.sh \ No newline at end of file +pass3.sh \ No newline at end of file diff --git a/steps/musl-1.2.4/pass3.sh b/steps/musl-1.2.4/pass3.sh index b3e42263..0ea0f15b 100755 --- a/steps/musl-1.2.4/pass3.sh +++ b/steps/musl-1.2.4/pass3.sh @@ -9,7 +9,9 @@ src_configure() { --host=i386-unknown-linux-musl \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ - --includedir="${PREFIX}/include/" + --includedir="${PREFIX}/include/" \ + --enable-static \ + --enable-shared } src_compile() { @@ -23,12 +25,13 @@ src_install() { 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" + ln -s "i386-unknown-linux-musl/libc.so" "${DESTDIR}${PREFIX}/lib/ld-musl-i386.so.1" + ln -s "i386-unknown-linux-musl/libc.so" "${DESTDIR}${PREFIX}/lib/ld-linux.so.2" # 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}" + ln -s "i386-unknown-linux-musl/${i}" "${DESTDIR}${PREFIX}/lib/${i}" done # Add symlink for ldd diff --git a/steps/openssl-3.0.13/pass1.sh b/steps/openssl-3.0.13/pass1.sh index 3d671ba6..c3df8569 100755 --- a/steps/openssl-3.0.13/pass1.sh +++ b/steps/openssl-3.0.13/pass1.sh @@ -16,7 +16,7 @@ src_prepare() { src_configure() { ./config --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ - no-shared linux-generic32 + linux-generic32 } src_compile() { diff --git a/steps/zlib-1.2.13/pass1.sh b/steps/zlib-1.2.13/pass1.sh old mode 100755 new mode 100644 index ab87fc74..74ec2955 --- a/steps/zlib-1.2.13/pass1.sh +++ b/steps/zlib-1.2.13/pass1.sh @@ -3,5 +3,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later src_configure() { - ./configure --prefix="${PREFIX}" --libdir="${LIBDIR}" --static + ./configure --prefix="${PREFIX}" --libdir="${LIBDIR}" } From 659cb090d0ec0b10e4603d121fddcfbcfbd865a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= Date: Thu, 23 May 2024 13:57:07 +0200 Subject: [PATCH 2/3] HACK: repopulate device nodes before libtool-2.4.7 Somehow, on bare metal, we end up with a regular file named /dev/null when we build libtool-2.4.7, which breaks configure. This really shouldn't be happening at all, and while this change fixes configure, it's clearly not the right fix. --- steps/manifest | 2 ++ 1 file changed, 2 insertions(+) diff --git a/steps/manifest b/steps/manifest index 36413fcd..6e92afa4 100644 --- a/steps/manifest +++ b/steps/manifest @@ -141,6 +141,8 @@ build: bash-5.2.15 improve: open_console ( CONSOLES == True ) build: xz-5.4.1 build: file-5.44 +# TODO this shouldn't be needed, but we somehow have a regular file as /dev/null without this, which breaks libtool configure +improve: populate_device_nodes build: libtool-2.4.7 build: tar-1.34 build: coreutils-9.4 From fddc14fd9ee64a600c1adc5c6da143a93ce91d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= Date: Fri, 24 May 2024 22:25:09 +0200 Subject: [PATCH 3/3] Make the final Python build dynamic, to support runtime library loading --- steps/python-3.11.1/pass1.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/steps/python-3.11.1/pass1.sh b/steps/python-3.11.1/pass1.sh index 56928e26..885d64d3 100755 --- a/steps/python-3.11.1/pass1.sh +++ b/steps/python-3.11.1/pass1.sh @@ -54,14 +54,12 @@ src_configure() { MACHDEP=linux ac_sys_system=Linux \ CPPFLAGS="-U__DATE__ -U__TIME__" \ PKG_CONFIG_PATH="${LIBDIR}/pkgconfig/" \ - LDFLAGS="-static" \ ./configure \ --build=i386-unknown-linux-musl \ --host=i386-unknown-linux-musl \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ - --with-system-ffi \ - --disable-shared + --with-system-ffi } src_compile() {