From 511dcaabf839ceeba4399bc13f51efc49c7383e5 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.12.1/pass2.sh | 2 +- steps/gcc-10.5.0/pass1.sh | 2 -- steps/gcc-13.3.0/pass1.sh | 4 +--- steps/gcc-4.7.4/pass1.sh | 1 + steps/guile-3.0.9/pass1.sh | 2 +- steps/musl-1.2.5/pass2.sh | 2 +- steps/musl-1.2.5/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.12.1/pass2.sh b/steps/curl-8.12.1/pass2.sh index 1a29092ed..3832b74bd 100755 --- a/steps/curl-8.12.1/pass2.sh +++ b/steps/curl-8.12.1/pass2.sh @@ -20,7 +20,7 @@ src_prepare() { } src_configure() { - LDFLAGS="-static" ./configure \ + ./configure \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ --build="${TARGET}" \ diff --git a/steps/gcc-10.5.0/pass1.sh b/steps/gcc-10.5.0/pass1.sh index 95a20f736..6da6b896c 100755 --- a/steps/gcc-10.5.0/pass1.sh +++ b/steps/gcc-10.5.0/pass1.sh @@ -173,7 +173,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}" \ @@ -181,7 +180,6 @@ src_configure() { --target="${TARGET}" \ --host="${TARGET}" \ --disable-bootstrap \ - --enable-static \ --program-transform-name= \ --enable-languages=c,c++ \ --with-system-zlib \ diff --git a/steps/gcc-13.3.0/pass1.sh b/steps/gcc-13.3.0/pass1.sh index e43890df6..6424a3af1 100755 --- a/steps/gcc-13.3.0/pass1.sh +++ b/steps/gcc-13.3.0/pass1.sh @@ -204,7 +204,6 @@ src_configure() { mkdir build cd build - LDFLAGS="-static" \ ../configure \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ @@ -212,7 +211,6 @@ src_configure() { --target="${TARGET}" \ --host="${TARGET}" \ --enable-bootstrap \ - --enable-static \ --disable-plugins \ --disable-libssp \ --disable-libsanitizer \ @@ -224,5 +222,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 d817bf333..ebe142855 100755 --- a/steps/gcc-4.7.4/pass1.sh +++ b/steps/gcc-4.7.4/pass1.sh @@ -185,6 +185,7 @@ src_configure() { --target="${TARGET}" \ --host="${TARGET}" \ --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 d7a03b73a..5a487945c 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="${TARGET}" \ - --disable-shared \ + --enable-shared \ --disable-jit popd done diff --git a/steps/musl-1.2.5/pass2.sh b/steps/musl-1.2.5/pass2.sh index c069796d1..b573b269f 120000 --- a/steps/musl-1.2.5/pass2.sh +++ b/steps/musl-1.2.5/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.5/pass3.sh b/steps/musl-1.2.5/pass3.sh index 369f4bb50..df13aea33 100755 --- a/steps/musl-1.2.5/pass3.sh +++ b/steps/musl-1.2.5/pass3.sh @@ -9,7 +9,9 @@ src_configure() { --host="${TARGET}" \ --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 3d671ba68..c3df8569d 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 ab87fc74e..74ec29552 --- 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 de84fbc04626149fcaf6d2db848084c6216649e8 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 828314c3d..088fcfd42 100644 --- a/steps/manifest +++ b/steps/manifest @@ -143,6 +143,8 @@ build: bash-5.2.15 improve: open_console ( CONSOLES == True ) build: xz-5.6.4 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 1296c44bb345ef5d54ecffd7688f9813d46a032a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= Date: Mon, 25 Aug 2025 14:58:24 +0200 Subject: [PATCH 3/3] Don't hardcode libc interpreter symlink paths --- steps/musl-1.2.5/pass3.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/steps/musl-1.2.5/pass3.sh b/steps/musl-1.2.5/pass3.sh index df13aea33..716246d6a 100755 --- a/steps/musl-1.2.5/pass3.sh +++ b/steps/musl-1.2.5/pass3.sh @@ -25,13 +25,13 @@ src_install() { rm "${DESTDIR}/lib/ld-musl-i386.so.1" rmdir "${DESTDIR}/lib" mkdir -p "${DESTDIR}${PREFIX}/lib" - 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" + ln -s "${TARGET}/libc.so" "${DESTDIR}${PREFIX}/lib/ld-musl-i386.so.1" + ln -s "${TARGET}/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 -s "i386-unknown-linux-musl/${i}" "${DESTDIR}${PREFIX}/lib/${i}" + ln -s "${TARGET}/${i}" "${DESTDIR}${PREFIX}/lib/${i}" done # Add symlink for ldd