From 1aeb4c11f714516ad5c348d8f9a6581a892482b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 20 Mar 2021 21:20:43 +0000 Subject: [PATCH 01/11] Get rid of tcc-mes. --- sysa/tcc-0.9.27/tcc-musl-pass1.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysa/tcc-0.9.27/tcc-musl-pass1.sh b/sysa/tcc-0.9.27/tcc-musl-pass1.sh index 502dc30..891e927 100755 --- a/sysa/tcc-0.9.27/tcc-musl-pass1.sh +++ b/sysa/tcc-0.9.27/tcc-musl-pass1.sh @@ -45,8 +45,8 @@ src_compile() { } src_install() { - # Remove old tcc binaries, keep one for tcc-0.9.27 with mes C library - mv ${bindir}/tcc ${bindir}/tcc-mes + # Remove old tcc binaries + rm ${bindir}/tcc rm ${bindir}/boot*-tcc ${bindir}/tcc-0.9.26 ${bindir}/mes-tcc ln -s ${bindir}/tcc-musl ${bindir}/tcc } From 30ebe8ccba7b635a8bba2001deb7f0827d32cddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 20 Mar 2021 21:21:37 +0000 Subject: [PATCH 02/11] Install musl headers directly into /after/include. --- sysa/bash-5.1/checksums | 2 +- sysa/musl-1.1.24/binutils-rebuild.sh | 9 +++++++-- sysa/tcc-0.9.27/checksums/tcc-musl-pass3 | 2 +- sysa/tcc-0.9.27/tcc-musl-pass3.sh | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/sysa/bash-5.1/checksums b/sysa/bash-5.1/checksums index 2849017..984a5f1 100644 --- a/sysa/bash-5.1/checksums +++ b/sysa/bash-5.1/checksums @@ -1 +1 @@ -abb6aca766109a7dc2aa00ed976540ce631ad45daa11d5091a38c15dd62f1257 /after/bin/bash +63487b421c2e2386c526623e4b18605c0f83a419f19e75dec1bb5af109903755 /after/bin/bash diff --git a/sysa/musl-1.1.24/binutils-rebuild.sh b/sysa/musl-1.1.24/binutils-rebuild.sh index f465148..4ac8ff8 100755 --- a/sysa/musl-1.1.24/binutils-rebuild.sh +++ b/sysa/musl-1.1.24/binutils-rebuild.sh @@ -14,8 +14,8 @@ src_configure() { --host=i386 \ --disable-shared \ --prefix=/after \ - --libdir=/after/lib/musl/ \ - --includedir=/after/include/musl + --libdir=/after/lib/musl \ + --includedir=/after/include/ # configure script creates this file test -f /dev/null && rm /dev/null @@ -24,3 +24,8 @@ src_configure() { src_compile() { make CROSS_COMPILE= CFLAGS="-DSYSCALL_NO_TLS" AS_CMD='as -o $@ $<' } + +src_install() { + rm -rf /after/include + make install +} diff --git a/sysa/tcc-0.9.27/checksums/tcc-musl-pass3 b/sysa/tcc-0.9.27/checksums/tcc-musl-pass3 index cfb0091..32c6acd 100644 --- a/sysa/tcc-0.9.27/checksums/tcc-musl-pass3 +++ b/sysa/tcc-0.9.27/checksums/tcc-musl-pass3 @@ -1,2 +1,2 @@ -f8023d637f64e1e739b5f381a000eafb0f2e500dc7967ebd90642d4a13c755f8 /after/bin/tcc-musl +fd8fdc967f227f3a8ef4f51226ac8a45b6be78eb0b127d2cdf0a9df0e19451b0 /after/bin/tcc-musl a650b13efc65073fb851e9db89728089d8845c401f85faaa09801874ab058089 /after/lib/tcc/libtcc1.a diff --git a/sysa/tcc-0.9.27/tcc-musl-pass3.sh b/sysa/tcc-0.9.27/tcc-musl-pass3.sh index 07b2a2b..540d1ad 100755 --- a/sysa/tcc-0.9.27/tcc-musl-pass3.sh +++ b/sysa/tcc-0.9.27/tcc-musl-pass3.sh @@ -14,7 +14,7 @@ src_prepare() { src_compile() { export prefix=/after export libdir=${prefix}/lib/musl - export incdir=${prefix}/include/musl + export incdir=${prefix}/include export bindir=${prefix}/bin mkdir -p ${libdir}/tcc @@ -34,6 +34,7 @@ src_compile() { -D CONFIG_USE_LIBGCC=1 \ -D TCC_VERSION=\"0.9.27\" \ -D ONE_SOURCE=1 \ + -I ${incdir} \ tcc.c # libtcc1.a From f5c262e370c30fc6b1f52953621223558b5eefff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 20 Mar 2021 21:23:07 +0000 Subject: [PATCH 03/11] GNU GCC 4.0.4 --- SHA256SUMS.sources | 1 + parts.rst | 20 +++++++--- rootfs.sh | 3 ++ sysa/gcc-4.0.4/checksums | 14 +++++++ sysa/gcc-4.0.4/stage1.sh | 83 ++++++++++++++++++++++++++++++++++++++++ sysa/run2.sh | 2 + 6 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 sysa/gcc-4.0.4/checksums create mode 100755 sysa/gcc-4.0.4/stage1.sh diff --git a/SHA256SUMS.sources b/SHA256SUMS.sources index 6407c21..065c16d 100644 --- a/SHA256SUMS.sources +++ b/SHA256SUMS.sources @@ -24,6 +24,7 @@ d5f2489c4056a31528e3ada4adacc23d498532b0af1a980f2f76158162b139d6 diffutils-2.7. bc79b890f35ca38d66ff89a6e3758226131e51ccbd10ef78d5ff150b7bd73689 flex-2.5.11.tar.gz e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995 flex-2.6.4.tar.gz 5cc35def1ff4375a8b9a98c2ff79e95e80987d24f0d42fdbb7b7039b3ddb3fb0 gawk-3.0.4.tar.gz +e9bf58c761a4f988311aef6b41f12fd5c7e51d09477468fb73826aecc1be32e7 gcc-4.0.4.tar.bz2 a32032bab36208509466654df12f507600dfe0313feebbcd218c32a70bf72a16 grep-2.4.tar.gz 4d2ce9f314f39c9575f913503b0178d6fb2c92920db8e7b7b176b7bab7980fe6 gzip-1.2.4.tar 9f233d8b78e4351fe9dd2d50d83958a0e5af36f54e9818521458a08e058691ba heirloom-devtools-070527.tar.bz2 diff --git a/parts.rst b/parts.rst index 4c52184..f277803 100644 --- a/parts.rst +++ b/parts.rst @@ -502,12 +502,6 @@ autoconf 2.61 Yet another version of ``autoconf``. -automake 1.9.6 -============== - -Latest GNU Automake from 1.9 series. Slightly annoyingly depends itself but it is easy to patch -to make it buildable with 1.8.5. Then we rebuild ``automake-1.9`` with itself. - bash 5.1 ======== @@ -516,3 +510,17 @@ interactively. This new version of ``bash`` compiles without any patches, provides new features, and is built with GNU readline support so it can be used as an interactive shell. ``autoconf-2.61`` is used to regenerate the configure script and ``bison`` is used to recreate some included generated files. + +automake 1.9.6 +============== + +Latest GNU Automake from 1.9 series. Slightly annoyingly depends itself but it is easy to patch +to make it buildable with 1.8.5. Then we rebuild ``automake-1.9`` with itself. + +gcc 4.0.4 +========= + +The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU Project. +GCC is a key component of the GNU toolchain and the standard compiler for most projects related to GNU and the Linux kernel. + +Only C frontend is built at this stage. diff --git a/rootfs.sh b/rootfs.sh index 357acff..588ebcd 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -261,6 +261,9 @@ get_file https://ftp.gnu.org/gnu/bash/bash-5.1.tar.gz # automake 1.9.6 get_file https://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2 +# gcc 4.0.4 +get_file https://ftp.gnu.org/gnu/gcc/gcc-4.0.4/gcc-core-4.0.4.tar.bz2 0 gcc-4.0.4.tar.bz2 + # General cleanup find tmp -name .git -exec rm -rf \; diff --git a/sysa/gcc-4.0.4/checksums b/sysa/gcc-4.0.4/checksums new file mode 100644 index 0000000..54f8ade --- /dev/null +++ b/sysa/gcc-4.0.4/checksums @@ -0,0 +1,14 @@ +6ca1ff5a1dd835e2378a8d827c5ec8a68121c7b5c719ab56f71f9d717b8e007e /after/bin/cpp +236bb12f3c0b6fb28dee325dfcfcf1cd87dc057aaac307e76a7124c4d071c349 /after/bin/gcc +236bb12f3c0b6fb28dee325dfcfcf1cd87dc057aaac307e76a7124c4d071c349 /after/bin/i386-unknown-linux-gnu-gcc +236bb12f3c0b6fb28dee325dfcfcf1cd87dc057aaac307e76a7124c4d071c349 /after/bin/i386-unknown-linux-gnu-gcc-4.0.4 +903b1dae32b217048b1a35a934836496027e6947b77f5711cb8714cd5241dda0 /after/libexec/gcc/i386-unknown-linux-gnu/4.0.4/cc1 +711689a618e34a0cff2c6061e554f9a2f9d447a7623bd46ba11c2eb816932883 /after/libexec/gcc/i386-unknown-linux-gnu/4.0.4/collect2 +a3fbed284b1efaf6fccfc81eddd9bad8c4cf07673b16e8885ad6f31a1569c9b4 /after/libexec/gcc/i386-unknown-linux-gnu/4.0.4/install-tools/fixincl +de4566c661258fa626ea7076e6c57af95c01d0786bcdadb12af23852cc421a2a /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtbegin.o +c7eea5e845fe2ee5538704d59c6e777d4f72b7100e78d5f86f8d95d96ab2ec20 /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtbeginS.o +de4566c661258fa626ea7076e6c57af95c01d0786bcdadb12af23852cc421a2a /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtbeginT.o +342276a6ad25e3d064bba9c5d50fbeaae15d0aefdc5c72b1e796366189af1b1b /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtend.o +2bf001e0be96ea7c53adf35b1bf0a677eee02008e3aee6c30166d100b720687c /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtendS.o +7b416e87b8e5998c042b64b4b87499720895c17deeffc0bc1b79f6fac502d51b /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/libgcc.a +efc9783c7386519ef7d5bfe7fadf16d4b6b717deb18dd04e09d810354f015942 /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/libgcov.a diff --git a/sysa/gcc-4.0.4/stage1.sh b/sysa/gcc-4.0.4/stage1.sh new file mode 100755 index 0000000..4f34ef5 --- /dev/null +++ b/sysa/gcc-4.0.4/stage1.sh @@ -0,0 +1,83 @@ +# SPDX-FileCopyrightText: 2021 Andrius Štikonas +# SPDX-FileCopyrightText: 2021 Paul Dersey + +# SPDX-License-Identifier: GPL-3.0-or-later + +src_unpack() { + default_src_unpack +} + +src_prepare() { + default_src_prepare + sed -i 's/ix86_attribute_table\[\]/ix86_attribute_table\[10\]/' gcc/config/i386/i386.c + sed -i 's/struct siginfo/siginfo_t/' gcc/config/i386/linux-unwind.h + + rm configure + autoconf-2.13 + for dir in intl libcpp; do + cd $dir + rm aclocal.m4 + aclocal-1.9 --acdir=../config + cd .. + done + for dir in fixincludes gcc intl libcpp libiberty; do + cd $dir + rm configure + autoconf-2.61 + cd .. + done + cd libmudflap + autoreconf-2.61 -f + cd .. + + for dir in fixincludes intl libmudflap; do + cd $dir + rm -f config.in + autoheader-2.61 + cd .. + done + + # Rebuild libtool files + rm config.guess config.sub ltmain.sh + libtoolize + + # Rebuild bison files + # Workaround for bison being too new + sed -i 's/YYLEX/yylex()/' gcc/c-parse.y + rm gcc/c-parse.c + rm gcc/gengtype-yacc.{c,h} + rm intl/plural.c + + # Rebuild flex generated files + rm gcc/gengtype-lex.c + + # Remove translation catalogs + rm gcc/po/*.gmo +} + +src_configure() { + mkdir build + cd build + CC=tcc CFLAGS="-D HAVE_ALLOCA_H" ../configure \ + --prefix="${PREFIX}" \ + --libdir="${PREFIX}"/lib/musl \ + --build=i386-unknown-linux-gnu \ + --host=i386-unknown-linux-gnu \ + --disable-shared \ + --disable-nls \ + --disable-libmudflap + cd .. + + sed -i 's/C_alloca/alloca/g' libiberty/alloca.c + sed -i 's/C_alloca/alloca/g' include/libiberty.h +} + +src_compile() { + mkdir -p /usr/ + ln -sf "${PREFIX}"/include /usr/include + make -C build LIBGCC2_INCLUDES=-I"${PREFIX}/include/musl" +} + +src_install() { + make -C build install +} diff --git a/sysa/run2.sh b/sysa/run2.sh index 4cd95d7..09c6a47 100755 --- a/sysa/run2.sh +++ b/sysa/run2.sh @@ -12,6 +12,8 @@ set -e build automake-1.9.6 stage1.sh build automake-1.9.6 stage2.sh +build gcc-4.0.4 stage1.sh + echo "Bootstrapping completed." exec env - PATH=/after/bin PS1="\w # " bash -i From fd76a5b09dfba3c09db20b03aa2d1ce9b4837768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 20 Mar 2021 23:35:31 +0000 Subject: [PATCH 04/11] Increase CI timeout to 3h. --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 81a7d57..b067d7b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -26,7 +26,7 @@ reuse_lint_task: - reuse lint run_task: - timeout_in: 90m + timeout_in: 180m container: image: potyarkin/molecule:host-kvm kvm: true From fbaa01d84c343d94105822647def76a40a410667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sat, 20 Mar 2021 23:49:43 +0000 Subject: [PATCH 05/11] musl 1.2.2 --- SHA256SUMS.sources | 1 + parts.rst | 5 +++++ rootfs.sh | 3 +++ sysa/musl-1.2.2/checksums | 14 ++++++++++++++ sysa/musl-1.2.2/musl-1.2.2.sh | 19 +++++++++++++++++++ sysa/run2.sh | 4 ++++ 6 files changed, 46 insertions(+) create mode 100644 sysa/musl-1.2.2/checksums create mode 100755 sysa/musl-1.2.2/musl-1.2.2.sh diff --git a/SHA256SUMS.sources b/SHA256SUMS.sources index 065c16d..b44e5cd 100644 --- a/SHA256SUMS.sources +++ b/SHA256SUMS.sources @@ -33,6 +33,7 @@ a4adadf76b496a6bc50795702253ecfcb6f0d159b68038f31a5362009340bca2 help2man-1.36. 093c993767f563a11e41c1cf887f4e9065247129679d4c1e213d0544d16d8303 m4-1.4.7.tar.gz 64b30b41fde2ebf669e6af489883fb1df6a06ac30555a96cfa3c39ecce7267dd make-3.80.tar.gz 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3 musl-1.1.24.tar.gz +9b969322012d796dc23dda27a35866034fa67d8fb67e0e2c45c913c3d43219dd musl-1.2.2.tar.gz ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a patch-2.5.9.tar.gz 1ae43c8d2983404b9eec61c96e3ffa27e7b07e08215c95c015a4ab0095373ef3 perl-5.000.tar.gz 9fa29beb2fc4a3c373829fc051830796de301f32a719d0b52a400d1719bbd7b1 perl-5.003.tar.gz diff --git a/parts.rst b/parts.rst index f277803..a7d642c 100644 --- a/parts.rst +++ b/parts.rst @@ -524,3 +524,8 @@ The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU GCC is a key component of the GNU toolchain and the standard compiler for most projects related to GNU and the Linux kernel. Only C frontend is built at this stage. + +musl 1.2.2 +========== + +This is the latest musl version as of the time of writing. diff --git a/rootfs.sh b/rootfs.sh index 588ebcd..ba1dfed 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -264,6 +264,9 @@ get_file https://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2 # gcc 4.0.4 get_file https://ftp.gnu.org/gnu/gcc/gcc-4.0.4/gcc-core-4.0.4.tar.bz2 0 gcc-4.0.4.tar.bz2 +# musl 1.2.2 +get_file https://musl.libc.org/releases/musl-1.2.2.tar.gz + # General cleanup find tmp -name .git -exec rm -rf \; diff --git a/sysa/musl-1.2.2/checksums b/sysa/musl-1.2.2/checksums new file mode 100644 index 0000000..8f13fa4 --- /dev/null +++ b/sysa/musl-1.2.2/checksums @@ -0,0 +1,14 @@ +40e7962d82241e166dba1b12a7c4c0658ec8ade4e7b93e20a57485811a92f366 /after/lib/musl/Scrt1.o +13ae7b4895a3ce59ab6b8219e03b5e65ca3d9400b673325c1df86d75bb1b9ff9 /after/lib/musl/crt1.o +73f64b61e6e9ae83726ab4cc909a7b549b06b6df2b087aedddbcd39cb7146f69 /after/lib/musl/crti.o +f5e325819d86fb381574692b8f9ea24f88f44f185a75adfe461705ecf2619c6e /after/lib/musl/crtn.o +15b76dac0837370a1d1dea59e4570d15c1a5ab522810b758e3f32518975c9be3 /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 +ee385035a4d9b3f4f9a1c73148821ddf26a1b3c2e607aa948c70d8612559cf7d /after/lib/musl/rcrt1.o diff --git a/sysa/musl-1.2.2/musl-1.2.2.sh b/sysa/musl-1.2.2/musl-1.2.2.sh new file mode 100755 index 0000000..aa723b7 --- /dev/null +++ b/sysa/musl-1.2.2/musl-1.2.2.sh @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2021 Andrius Štikonas +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_configure() { + CC=gcc ./configure \ + --host=i386 \ + --disable-shared \ + --prefix=/after \ + --libdir=/after/lib/musl \ + --includedir=/after/include/ + + # configure script creates this file + test -f /dev/null && rm /dev/null && mknod -m 666 /dev/null c 1 3 +} + +src_compile() { + make CROSS_COMPILE= +} diff --git a/sysa/run2.sh b/sysa/run2.sh index 09c6a47..5fbef92 100755 --- a/sysa/run2.sh +++ b/sysa/run2.sh @@ -14,6 +14,10 @@ build automake-1.9.6 stage2.sh build gcc-4.0.4 stage1.sh +build musl-1.2.2 + +build musl-1.2.2 + echo "Bootstrapping completed." exec env - PATH=/after/bin PS1="\w # " bash -i From 8cd8c0fe31e731523598a2fd44420e9061c0c593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 21 Mar 2021 00:14:15 +0000 Subject: [PATCH 06/11] Rebuild bash 5.1 with gcc. --- parts.rst | 5 ++++ sysa/bash-5.1/{checksums => checksums/pass1} | 0 sysa/bash-5.1/checksums/pass2 | 1 + sysa/bash-5.1/{bash-5.1.sh => pass1.sh} | 1 + sysa/bash-5.1/pass2.sh | 25 ++++++++++++++++++++ sysa/run.sh | 2 +- sysa/run2.sh | 2 +- 7 files changed, 34 insertions(+), 2 deletions(-) rename sysa/bash-5.1/{checksums => checksums/pass1} (100%) create mode 100644 sysa/bash-5.1/checksums/pass2 rename sysa/bash-5.1/{bash-5.1.sh => pass1.sh} (88%) create mode 100755 sysa/bash-5.1/pass2.sh diff --git a/parts.rst b/parts.rst index a7d642c..cf30318 100644 --- a/parts.rst +++ b/parts.rst @@ -525,6 +525,11 @@ GCC is a key component of the GNU toolchain and the standard compiler for most p Only C frontend is built at this stage. +bash 5.1 (gcc) +============== + +Rebuild bash with GCC. + musl 1.2.2 ========== diff --git a/sysa/bash-5.1/checksums b/sysa/bash-5.1/checksums/pass1 similarity index 100% rename from sysa/bash-5.1/checksums rename to sysa/bash-5.1/checksums/pass1 diff --git a/sysa/bash-5.1/checksums/pass2 b/sysa/bash-5.1/checksums/pass2 new file mode 100644 index 0000000..17e41b8 --- /dev/null +++ b/sysa/bash-5.1/checksums/pass2 @@ -0,0 +1 @@ +62dd23127c9ccef9706f5a89baab25e4c5f74cb96ed9373843bc97252fbd4f4e /after/bin/bash diff --git a/sysa/bash-5.1/bash-5.1.sh b/sysa/bash-5.1/pass1.sh similarity index 88% rename from sysa/bash-5.1/bash-5.1.sh rename to sysa/bash-5.1/pass1.sh index ca3f394..5baee03 100755 --- a/sysa/bash-5.1/bash-5.1.sh +++ b/sysa/bash-5.1/pass1.sh @@ -1,4 +1,5 @@ # SPDX-FileCopyrightText: 2021 Paul Dersey +# SPDX-FileCopyrightText: 2021 Andrius Štikonas # # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/sysa/bash-5.1/pass2.sh b/sysa/bash-5.1/pass2.sh new file mode 100755 index 0000000..aabfc0b --- /dev/null +++ b/sysa/bash-5.1/pass2.sh @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2021 Paul Dersey +# SPDX-FileCopyrightText: 2021 Andrius Štikonas +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + # Remove bison generated files + rm y.tab.c y.tab.h + + # Rebuild configure script + rm configure + autoconf-2.61 +} + +src_configure() { + ./configure --prefix="${PREFIX}" \ + --without-bash-malloc \ + --disable-nls \ + --build=i386-unknown-linux-gnu \ + --enable-static-link +} + +src_install() { + install bash ${bindir} +} diff --git a/sysa/run.sh b/sysa/run.sh index 00d98b6..c2fb2df 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -126,6 +126,6 @@ build help2man-1.36.4 build autoconf-2.61 stage1.sh build autoconf-2.61 stage2.sh -build bash-5.1 +build bash-5.1 pass1.sh checksums/pass1 exec bash run2.sh diff --git a/sysa/run2.sh b/sysa/run2.sh index 5fbef92..737a290 100755 --- a/sysa/run2.sh +++ b/sysa/run2.sh @@ -14,7 +14,7 @@ build automake-1.9.6 stage2.sh build gcc-4.0.4 stage1.sh -build musl-1.2.2 +build bash-5.1 pass2.sh checksums/pass2 build musl-1.2.2 From 0572ff41ef460d49b891e9d0a6452a6cb9719b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 21 Mar 2021 00:24:24 +0000 Subject: [PATCH 07/11] Rebuild GCC against musl 1.2.2. --- parts.rst | 16 +++- sysa/gcc-4.0.4/{checksums => checksums/pass1} | 0 sysa/gcc-4.0.4/checksums/pass2 | 14 ++++ sysa/gcc-4.0.4/{stage1.sh => pass1.sh} | 14 ++-- sysa/gcc-4.0.4/pass2.sh | 81 +++++++++++++++++++ sysa/run2.sh | 4 +- 6 files changed, 117 insertions(+), 12 deletions(-) rename sysa/gcc-4.0.4/{checksums => checksums/pass1} (100%) create mode 100644 sysa/gcc-4.0.4/checksums/pass2 rename sysa/gcc-4.0.4/{stage1.sh => pass1.sh} (88%) create mode 100755 sysa/gcc-4.0.4/pass2.sh diff --git a/parts.rst b/parts.rst index cf30318..3444369 100644 --- a/parts.rst +++ b/parts.rst @@ -520,10 +520,11 @@ to make it buildable with 1.8.5. Then we rebuild ``automake-1.9`` with itself. gcc 4.0.4 ========= -The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU Project. -GCC is a key component of the GNU toolchain and the standard compiler for most projects related to GNU and the Linux kernel. +The GNU Compiler Collection (GCC) is an optimizing compiler produced by the +GNU Project. GCC is a key component of the GNU toolchain and the standard +compiler for most projects related to GNU and the Linux kernel. -Only C frontend is built at this stage. +Only the C frontend is built at this stage. bash 5.1 (gcc) ============== @@ -533,4 +534,11 @@ Rebuild bash with GCC. musl 1.2.2 ========== -This is the latest musl version as of the time of writing. +GCC can build the latest as of the time of writing musl version. + +We also don't need any of the TCC patches that we used before. + +gcc 4.0.4 +========= + +Rebuild GCC with GCC and also against the latest musl. diff --git a/sysa/gcc-4.0.4/checksums b/sysa/gcc-4.0.4/checksums/pass1 similarity index 100% rename from sysa/gcc-4.0.4/checksums rename to sysa/gcc-4.0.4/checksums/pass1 diff --git a/sysa/gcc-4.0.4/checksums/pass2 b/sysa/gcc-4.0.4/checksums/pass2 new file mode 100644 index 0000000..437b4bb --- /dev/null +++ b/sysa/gcc-4.0.4/checksums/pass2 @@ -0,0 +1,14 @@ +22234bd8a949cfab257e10e97a3e990ebb79a75afc5f50e875586bb9367910a7 /after/bin/cpp +a47e2b29f19aa69b4a40757accd73307f6b51bc9ebcc101aa628906d7c2d3b67 /after/bin/gcc +a47e2b29f19aa69b4a40757accd73307f6b51bc9ebcc101aa628906d7c2d3b67 /after/bin/i386-unknown-linux-gnu-gcc +a47e2b29f19aa69b4a40757accd73307f6b51bc9ebcc101aa628906d7c2d3b67 /after/bin/i386-unknown-linux-gnu-gcc-4.0.4 +9d4c0a3b340c1c22b81dd450ef894b02323e059c56cd3ceff423ee316f0ac0a2 /after/libexec/gcc/i386-unknown-linux-gnu/4.0.4/cc1 +ada38c050d3b2e6e96da2db86dbabebbd2c4cc4bdc2ba258358af9c64e882bed /after/libexec/gcc/i386-unknown-linux-gnu/4.0.4/collect2 +7c335c92800b34be9a3add28d529657812f62ec066b4c2a2dcba28c65f6d4e34 /after/libexec/gcc/i386-unknown-linux-gnu/4.0.4/install-tools/fixincl +a07db1648128987f10debb1730b4456c0423aab5bd93d68e4f2b47447a11c5d9 /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtbegin.o +20a3bbbd5cd59b91660628d416d489437463b651fa15b5ea5f026b45c9e35b65 /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtbeginS.o +a07db1648128987f10debb1730b4456c0423aab5bd93d68e4f2b47447a11c5d9 /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtbeginT.o +342276a6ad25e3d064bba9c5d50fbeaae15d0aefdc5c72b1e796366189af1b1b /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtend.o +2bf001e0be96ea7c53adf35b1bf0a677eee02008e3aee6c30166d100b720687c /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/crtendS.o +5d3c8a9b80e4e34dfb70a56d6e23a05e01d2ecdbf60232a1b053462d4a98e99e /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/libgcc.a +f8c3b07e0f98b7f34ac0960d98f3b59ee0f47c42e72c529d10d66dccdc9b5d46 /after/lib/musl/gcc/i386-unknown-linux-gnu/4.0.4/libgcov.a diff --git a/sysa/gcc-4.0.4/stage1.sh b/sysa/gcc-4.0.4/pass1.sh similarity index 88% rename from sysa/gcc-4.0.4/stage1.sh rename to sysa/gcc-4.0.4/pass1.sh index 4f34ef5..d666437 100755 --- a/sysa/gcc-4.0.4/stage1.sh +++ b/sysa/gcc-4.0.4/pass1.sh @@ -59,13 +59,13 @@ src_configure() { mkdir build cd build CC=tcc CFLAGS="-D HAVE_ALLOCA_H" ../configure \ - --prefix="${PREFIX}" \ - --libdir="${PREFIX}"/lib/musl \ - --build=i386-unknown-linux-gnu \ - --host=i386-unknown-linux-gnu \ - --disable-shared \ - --disable-nls \ - --disable-libmudflap + --prefix="${PREFIX}" \ + --libdir="${PREFIX}"/lib/musl \ + --build=i386-unknown-linux-gnu \ + --host=i386-unknown-linux-gnu \ + --disable-shared \ + --disable-nls \ + --disable-libmudflap cd .. sed -i 's/C_alloca/alloca/g' libiberty/alloca.c diff --git a/sysa/gcc-4.0.4/pass2.sh b/sysa/gcc-4.0.4/pass2.sh new file mode 100755 index 0000000..6924919 --- /dev/null +++ b/sysa/gcc-4.0.4/pass2.sh @@ -0,0 +1,81 @@ +# SPDX-FileCopyrightText: 2021 Andrius Štikonas +# SPDX-FileCopyrightText: 2021 Paul Dersey + +# SPDX-License-Identifier: GPL-3.0-or-later + +src_unpack() { + default_src_unpack +} + +src_prepare() { + default_src_prepare + + # Needed for musl + sed -i 's/struct siginfo/siginfo_t/' gcc/config/i386/linux-unwind.h + + rm configure + autoconf-2.13 + for dir in intl libcpp; do + cd $dir + rm aclocal.m4 + aclocal-1.9 --acdir=../config + cd .. + done + for dir in fixincludes gcc intl libcpp libiberty; do + cd $dir + rm configure + autoconf-2.61 + cd .. + done + cd libmudflap + autoreconf-2.61 -f + cd .. + + for dir in fixincludes intl libmudflap; do + cd $dir + rm -f config.in + autoheader-2.61 + cd .. + done + + # Rebuild libtool files + rm config.guess config.sub ltmain.sh + libtoolize + + # Rebuild bison files + # Workaround for bison being too new + sed -i 's/YYLEX/yylex()/' gcc/c-parse.y + rm gcc/c-parse.c + rm gcc/gengtype-yacc.c gcc/gengtype-yacc.h + rm intl/plural.c + + # Rebuild flex generated files + rm gcc/gengtype-lex.c + + # Remove translation catalogs + rm gcc/po/*.gmo +} + +src_configure() { + mkdir build + cd build + ../configure \ + --prefix="${PREFIX}" \ + --libdir="${PREFIX}"/lib/musl \ + --build=i386-unknown-linux-gnu \ + --host=i386-unknown-linux-gnu \ + --disable-shared \ + --disable-nls \ + --disable-libmudflap + cd .. +} + +src_compile() { + mkdir -p /usr/ + ln -sf "${PREFIX}"/include /usr/include + make -C build LIBGCC2_INCLUDES=-I"${PREFIX}/include/musl" +} + +src_install() { + make -C build install +} diff --git a/sysa/run2.sh b/sysa/run2.sh index 737a290..8515aee 100755 --- a/sysa/run2.sh +++ b/sysa/run2.sh @@ -12,12 +12,14 @@ set -e build automake-1.9.6 stage1.sh build automake-1.9.6 stage2.sh -build gcc-4.0.4 stage1.sh +build gcc-4.0.4 pass1.sh checksums/pass1 build bash-5.1 pass2.sh checksums/pass2 build musl-1.2.2 +build gcc-4.0.4 pass2.sh checksums/pass2 + echo "Bootstrapping completed." exec env - PATH=/after/bin PS1="\w # " bash -i From 19c113127bedd69d6e7ad7aaf6f82e3f246419ce Mon Sep 17 00:00:00 2001 From: Paul Dersey Date: Wed, 24 Mar 2021 15:24:59 -0400 Subject: [PATCH 08/11] coreutils-5.0: build sync in pass2 --- parts.rst | 2 +- sysa/coreutils-5.0/checksums/pass2 | 1 + sysa/coreutils-5.0/mk/pass2.mk | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/parts.rst b/parts.rst index 4c52184..78c1829 100644 --- a/parts.rst +++ b/parts.rst @@ -304,7 +304,7 @@ coreutils 5.0 ============= ``coreutils`` is rebuilt against musl. Additional utilities are built -including ``comm``, ``expr``, ``date``, ``dd``, ``sort``, ``uname`` and +including ``comm``, ``expr``, ``dd``, ``sort``, ``sync``, ``uname`` and ``uniq``. This fixes a variety of issues with existing ``coreutils``. coreutils 6.3 diff --git a/sysa/coreutils-5.0/checksums/pass2 b/sysa/coreutils-5.0/checksums/pass2 index 1fd2d3b..300788e 100644 --- a/sysa/coreutils-5.0/checksums/pass2 +++ b/sysa/coreutils-5.0/checksums/pass2 @@ -38,6 +38,7 @@ fa7ff4f943ca592c623e41a303e697114a420c0a3e5d91c779dfd57ab39b7053 /after/bin/pwd 4b7609bd5da6de314b418be80f1be1a525bb4756efb1e9925f0ae7814c6eedef /after/bin/sleep c40dac27f90c5f793a1ed37e78bd1015e44688dc2179da209b1065d02ed0c6e3 /after/bin/sort 5087a0f86f238062a85f2f6ca3e6b33ba6b3c8dd9700e314c1ae3b2af3331409 /after/bin/split +533d8a75e4460e37714c50eed989a643dffe08e3ab4f7400b966f2241e28a60f /after/bin/sync 35f681f7cc31a895f5c5e0db8b6a3c203b2ed9ce1771503f198614302e42c600 /after/bin/sum 7272d4fb3313ad3e19c79393d8785d4b343a915e605332eebbc8f5ac5338e071 /after/bin/tail c2c6fae2cad8e29a75ff3f793ca7d059cc50ea4ee7d55f659e8f2d371f7763d6 /after/bin/tee diff --git a/sysa/coreutils-5.0/mk/pass2.mk b/sysa/coreutils-5.0/mk/pass2.mk index e2abe42..2c28f5f 100644 --- a/sysa/coreutils-5.0/mk/pass2.mk +++ b/sysa/coreutils-5.0/mk/pass2.mk @@ -83,7 +83,7 @@ CFLAGS = -I . -I lib \ SRC_DIR=src -COREUTILS = basename cat chmod cksum comm csplit cut dd dirname echo env expand expr factor false fmt fold head id join kill link ln logname mkfifo mkdir mknod nl od paste pathchk printf ptx pwd readlink rmdir seq sleep sort split sum tail tee tr tsort uname unexpand uniq unlink wc whoami test true yes +COREUTILS = basename cat chmod cksum comm csplit cut dd dirname echo env expand expr factor false fmt fold head id join kill link ln logname mkfifo mkdir mknod nl od paste pathchk printf ptx pwd readlink rmdir seq sleep sort split sum sync tail tee tr tsort uname unexpand uniq unlink wc whoami test true yes BINARIES = $(addprefix $(SRC_DIR)/, $(COREUTILS)) From 366dc2eac54df83de930182175d762e97bbe842c Mon Sep 17 00:00:00 2001 From: Paul Dersey Date: Tue, 23 Mar 2021 15:14:45 -0400 Subject: [PATCH 09/11] Replace coreutils-6.3 with coreutils-6.10 Build only date, mktemp, and sha256sum --- SHA256SUMS.sources | 2 +- parts.rst | 7 ++++--- rootfs.sh | 4 ++-- sysa/coreutils-6.10/checksums | 3 +++ .../coreutils-6.10.sh} | 5 +---- .../mk/main.mk | 19 +++++++++++++------ sysa/coreutils-6.3/checksums | 1 - sysa/run.sh | 4 ++-- 8 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 sysa/coreutils-6.10/checksums rename sysa/{coreutils-6.3/coreutils-6.3.sh => coreutils-6.10/coreutils-6.10.sh} (76%) rename sysa/{coreutils-6.3 => coreutils-6.10}/mk/main.mk (72%) delete mode 100644 sysa/coreutils-6.3/checksums diff --git a/SHA256SUMS.sources b/SHA256SUMS.sources index 6407c21..de84ffe 100644 --- a/SHA256SUMS.sources +++ b/SHA256SUMS.sources @@ -19,7 +19,7 @@ e20bdd49a0fb317959b410c1fe81269a620ec21207045d8a37cadea621be4b59 binutils-2.14. 7007fc89c216fbfaff5525359b02a7e5b612694df5168c74673f67055f015095 bison-3.4.1.tar.gz ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 bzip2-1.0.8.tar.gz c25b36b8af6e0ad2a875daf4d6196bd0df28a62be7dd252e5f99a4d5d7288d95 coreutils-5.0.tar.bz2 -8815a918867a14dcfeb623786b3a7f7483a039a78dd5a94e9b562667684c07a1 coreutils-6.3.tar.bz2 +1d013547889f20576460249c4210632d5314531c8477378a2e046b13a8ebeb7e coreutils-6.10.tar.gz d5f2489c4056a31528e3ada4adacc23d498532b0af1a980f2f76158162b139d6 diffutils-2.7.tar.gz bc79b890f35ca38d66ff89a6e3758226131e51ccbd10ef78d5ff150b7bd73689 flex-2.5.11.tar.gz e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995 flex-2.6.4.tar.gz diff --git a/parts.rst b/parts.rst index 78c1829..6fe32d6 100644 --- a/parts.rst +++ b/parts.rst @@ -307,10 +307,11 @@ coreutils 5.0 including ``comm``, ``expr``, ``dd``, ``sort``, ``sync``, ``uname`` and ``uniq``. This fixes a variety of issues with existing ``coreutils``. -coreutils 6.3 +coreutils 6.10 ============= -We build ``sha256sum`` from coreutils 6.3 since it is absent in 5.0. -Other utils are not build at this stage. +We build ``date``, ``mktemp`` and ``sha256sum`` from coreutils 6.10 which are +either missing or don't build correctly in 5.0. Other utils are not built at +this stage. gawk 3.0.4 ========== diff --git a/rootfs.sh b/rootfs.sh index 357acff..880b621 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -183,8 +183,8 @@ get_file https://ftp.gnu.org/gnu/grep/grep-2.4.tar.gz # diffutils 2.7 get_file https://ftp.gnu.org/gnu/diffutils/diffutils-2.7.tar.gz -# coreutils 6.3 -get_file https://ftp.gnu.org/gnu/coreutils/coreutils-6.3.tar.bz2 +# coreutils 6.10 +get_file https://ftp.gnu.org/gnu/coreutils/coreutils-6.10.tar.gz # gawk 3.0.4 get_file https://ftp.gnu.org/gnu/gawk/gawk-3.0.4.tar.gz diff --git a/sysa/coreutils-6.10/checksums b/sysa/coreutils-6.10/checksums new file mode 100644 index 0000000..819eeaa --- /dev/null +++ b/sysa/coreutils-6.10/checksums @@ -0,0 +1,3 @@ +98124acfaf5cd8c1795d9557455607fb157a514867de5b908a9a3c8d00d88717 /after/bin/date +fe8a8a6d39e35ca2d980ac0dfb57204f34c34aa2ec543bc15f93ff80bcbbd38a /after/bin/mktemp +40289b9aae91f72a7d44bbc93616dcf2397b60d2532b549d053f3ce9b1040119 /after/bin/sha256sum diff --git a/sysa/coreutils-6.3/coreutils-6.3.sh b/sysa/coreutils-6.10/coreutils-6.10.sh similarity index 76% rename from sysa/coreutils-6.3/coreutils-6.3.sh rename to sysa/coreutils-6.10/coreutils-6.10.sh index b87a37b..a06d65b 100755 --- a/sysa/coreutils-6.3/coreutils-6.3.sh +++ b/sysa/coreutils-6.10/coreutils-6.10.sh @@ -4,10 +4,7 @@ src_prepare() { default_src_prepare - - cp lib/fnmatch_.h lib/fnmatch.h - cp lib/fcntl_.h lib/fcntl.h - sed -i 's#@ABSOLUTE_FCNTL_H@#"/after/include/musl/fcntl.h"#' lib/fcntl.h + mv lib/fnmatch.in.h lib/fnmatch.h # Rebuild bison pre-generated file rm lib/getdate.c diff --git a/sysa/coreutils-6.3/mk/main.mk b/sysa/coreutils-6.10/mk/main.mk similarity index 72% rename from sysa/coreutils-6.3/mk/main.mk rename to sysa/coreutils-6.10/mk/main.mk index 6f7d95b..89445ee 100644 --- a/sysa/coreutils-6.3/mk/main.mk +++ b/sysa/coreutils-6.10/mk/main.mk @@ -6,8 +6,8 @@ PACKAGE=coreutils PACKAGE_NAME=GNU\ coreutils PACKAGE_BUGREPORT=bug-coreutils@gnu.org -PACKAGE_VERSION=6.3 -VERSION=6.3 +PACKAGE_VERSION=6.10 +VERSION=6.10 CC = tcc LD = tcc @@ -75,7 +75,11 @@ CFLAGS = -I . -I lib \ -Dminor_t=unsigned \ -DHAVE_GETTIMEOFDAY=1 \ -DHAVE_TIME_R_POSIX=1 \ - -DHASH_ALGO_SHA256 + -DHASH_ALGO_SHA256 \ + -DFLEXIBLE_ARRAY_MEMBER \ + -DS_IRWXUGO='(S_IRWXU | S_IRWXG | S_IRWXO)' \ + -DGNULIB_CANONICALIZE \ + -DO_BINARY=0 .PHONY: all install @@ -85,11 +89,11 @@ COREUTILS = date BINARIES = $(addprefix $(SRC_DIR)/, $(COREUTILS)) -ALL=$(BINARIES) $(SRC_DIR)/sha256sum -all: $(BINARIES) $(SRC_DIR)/sha256sum +ALL=$(BINARIES) $(SRC_DIR)/sha256sum $(SRC_DIR)/mktemp +all: $(BINARIES) $(SRC_DIR)/sha256sum $(SRC_DIR)/mktemp LIB_DIR = lib -LIB_SRC = acl alloca getdate fprintftime posixtm posixver strftime getopt hash hash-pjw argmatch backupfile basename canon-host closeout cycle-check diacrit dirname dup-safer error exclude exitfail filemode __fpending file-type fnmatch fopen-safer full-read full-write getline gettime hard-locale human idcache imaxtostr linebuffer localcharset long-options mbswidth md5 memcasecmp memcoll modechange offtostr physmem quote quotearg readtokens rpmatch safe-read safe-write same save-cwd savedir settime sha256 stpcpy stripslash umaxtostr unicodeio userspec version-etc version-etc-fsf xgetcwd xgethostname xmalloc xmemcoll xnanosleep xreadlink xstrtod xstrtol xstrtoul xstrtoimax xstrtoumax yesno strnlen getcwd sig2str mountlist canonicalize mkstemp memrchr euidaccess obstack strverscmp strftime xalloc-die close-stream +LIB_SRC = acl alloca getdate fprintftime posixtm posixver strftime getopt hash hash-pjw argmatch backupfile basename canon-host closeout cycle-check diacrit dirname dup-safer error exclude exitfail filemode fpending file-type fnmatch fopen-safer full-read full-write getline gettime hard-locale human idcache imaxtostr linebuffer localcharset long-options mbswidth md5 memcasecmp memcoll modechange offtostr physmem quote quotearg readtokens rpmatch safe-read safe-write same save-cwd savedir settime sha256 stpcpy stripslash umaxtostr unicodeio userspec version-etc version-etc-fsf xgetcwd xgethostname xmalloc xmemcoll xnanosleep readlink xstrtod xstrtol xstrtoul xstrtoimax xstrtoumax yesno strnlen getcwd sig2str mountlist canonicalize mkstemp memrchr euidaccess obstack strverscmp strftime xalloc-die close-stream tempname filenamecat xstrndup randint randread rand-isaac gethrxtime LIB_OBJECTS = $(addprefix $(LIB_DIR)/, $(addsuffix .o, $(LIB_SRC))) @@ -102,5 +106,8 @@ $(BINARIES) : % : %.o $(LIB_DIR)/libfettish.a $(SRC_DIR)/sha256sum: $(SRC_DIR)/md5sum.o $(LIB_DIR)/libfettish.a $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ +$(SRC_DIR)/mktemp: $(SRC_DIR)/mktemp.o $(LIB_DIR)/libfettish.a + $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ + install: $(ALL) install $^ $(bindir) diff --git a/sysa/coreutils-6.3/checksums b/sysa/coreutils-6.3/checksums deleted file mode 100644 index e2b85e4..0000000 --- a/sysa/coreutils-6.3/checksums +++ /dev/null @@ -1 +0,0 @@ -34ec35d9de41dd954802dbcfc7c07697f1e7e3cecedbe32ea16a6da85c3eb260 /after/bin/sha256sum diff --git a/sysa/run.sh b/sysa/run.sh index 00d98b6..00ccb72 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -57,8 +57,8 @@ build diffutils-2.7 # Rebuild coreutils using musl build coreutils-5.0 coreutils-5.0.sh checksums/pass2 -# Build only sha256sum -build coreutils-6.3 +# Build only date, mktemp and sha256sum +build coreutils-6.10 build gawk-3.0.4 From 634cae7b68e149a6713caef7b4c186d7564e9e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 21 Mar 2021 16:10:53 +0000 Subject: [PATCH 10/11] Build bash 5.1 only after GCC. --- parts.rst | 23 +++++++++-------------- rootfs.sh | 6 +++--- sysa/bash-5.1/{pass1.sh => bash-5.1.sh} | 7 ++++--- sysa/bash-5.1/checksums | 1 + sysa/bash-5.1/checksums/pass1 | 1 - sysa/bash-5.1/checksums/pass2 | 1 - sysa/bash-5.1/pass2.sh | 25 ------------------------- sysa/gcc-4.0.4/pass1.sh | 4 +++- sysa/run.sh | 13 +++++++++++-- sysa/run2.sh | 12 +----------- 10 files changed, 32 insertions(+), 61 deletions(-) rename sysa/bash-5.1/{pass1.sh => bash-5.1.sh} (79%) create mode 100644 sysa/bash-5.1/checksums delete mode 100644 sysa/bash-5.1/checksums/pass1 delete mode 100644 sysa/bash-5.1/checksums/pass2 delete mode 100755 sysa/bash-5.1/pass2.sh diff --git a/parts.rst b/parts.rst index 3444369..19c5cbd 100644 --- a/parts.rst +++ b/parts.rst @@ -502,15 +502,6 @@ autoconf 2.61 Yet another version of ``autoconf``. -bash 5.1 -======== - -Up to this point, our build of ``bash`` could run scripts but could not be used -interactively. This new version of ``bash`` compiles without any patches, -provides new features, and is built with GNU readline support so it can be used -as an interactive shell. ``autoconf-2.61`` is used to regenerate the configure -script and ``bison`` is used to recreate some included generated files. - automake 1.9.6 ============== @@ -526,11 +517,6 @@ compiler for most projects related to GNU and the Linux kernel. Only the C frontend is built at this stage. -bash 5.1 (gcc) -============== - -Rebuild bash with GCC. - musl 1.2.2 ========== @@ -542,3 +528,12 @@ gcc 4.0.4 ========= Rebuild GCC with GCC and also against the latest musl. + +bash 5.1 +======== + +Up to this point, our build of ``bash`` could run scripts but could not be used +interactively. This new version of ``bash`` compiles without any patches, +provides new features, and is built with GNU readline support so it can be used +as an interactive shell. ``autoconf-2.61`` is used to regenerate the configure +script and ``bison`` is used to recreate some included generated files. diff --git a/rootfs.sh b/rootfs.sh index ba1dfed..ec2aba8 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -255,9 +255,6 @@ get_file https://ftp.gnu.org/gnu/help2man/help2man-1.36.4.tar.gz # autoconf 2.61 get_file https://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2 -# bash 5.1 -get_file https://ftp.gnu.org/gnu/bash/bash-5.1.tar.gz - # automake 1.9.6 get_file https://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2 @@ -267,6 +264,9 @@ get_file https://ftp.gnu.org/gnu/gcc/gcc-4.0.4/gcc-core-4.0.4.tar.bz2 0 gcc-4.0. # musl 1.2.2 get_file https://musl.libc.org/releases/musl-1.2.2.tar.gz +# bash 5.1 +get_file https://ftp.gnu.org/gnu/bash/bash-5.1.tar.gz + # General cleanup find tmp -name .git -exec rm -rf \; diff --git a/sysa/bash-5.1/pass1.sh b/sysa/bash-5.1/bash-5.1.sh similarity index 79% rename from sysa/bash-5.1/pass1.sh rename to sysa/bash-5.1/bash-5.1.sh index 5baee03..dc064b0 100755 --- a/sysa/bash-5.1/pass1.sh +++ b/sysa/bash-5.1/bash-5.1.sh @@ -10,11 +10,12 @@ src_prepare() { # Rebuild configure script rm configure autoconf-2.61 + + sed -i 's/sleep 3/sleep 3; sync/' builtins/psize.sh } src_configure() { - CC=tcc CPPFLAGS="-D HAVE_ALLOCA_H" \ - ./configure --prefix="${PREFIX}" \ + ./configure --prefix="${PREFIX}" \ --without-bash-malloc \ --disable-nls \ --build=i386-unknown-linux-gnu \ @@ -22,5 +23,5 @@ src_configure() { } src_install() { - install bash ${bindir} + install bash "${PREFIX}/bin" } diff --git a/sysa/bash-5.1/checksums b/sysa/bash-5.1/checksums new file mode 100644 index 0000000..89e966c --- /dev/null +++ b/sysa/bash-5.1/checksums @@ -0,0 +1 @@ +bf782a82ac8ce393d2a028cec337a4f9428f8ab93d2ae11b026dcc8a027b80a7 /after/bin/bash diff --git a/sysa/bash-5.1/checksums/pass1 b/sysa/bash-5.1/checksums/pass1 deleted file mode 100644 index 984a5f1..0000000 --- a/sysa/bash-5.1/checksums/pass1 +++ /dev/null @@ -1 +0,0 @@ -63487b421c2e2386c526623e4b18605c0f83a419f19e75dec1bb5af109903755 /after/bin/bash diff --git a/sysa/bash-5.1/checksums/pass2 b/sysa/bash-5.1/checksums/pass2 deleted file mode 100644 index 17e41b8..0000000 --- a/sysa/bash-5.1/checksums/pass2 +++ /dev/null @@ -1 +0,0 @@ -62dd23127c9ccef9706f5a89baab25e4c5f74cb96ed9373843bc97252fbd4f4e /after/bin/bash diff --git a/sysa/bash-5.1/pass2.sh b/sysa/bash-5.1/pass2.sh deleted file mode 100755 index aabfc0b..0000000 --- a/sysa/bash-5.1/pass2.sh +++ /dev/null @@ -1,25 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Paul Dersey -# SPDX-FileCopyrightText: 2021 Andrius Štikonas -# -# SPDX-License-Identifier: GPL-3.0-or-later - -src_prepare() { - # Remove bison generated files - rm y.tab.c y.tab.h - - # Rebuild configure script - rm configure - autoconf-2.61 -} - -src_configure() { - ./configure --prefix="${PREFIX}" \ - --without-bash-malloc \ - --disable-nls \ - --build=i386-unknown-linux-gnu \ - --enable-static-link -} - -src_install() { - install bash ${bindir} -} diff --git a/sysa/gcc-4.0.4/pass1.sh b/sysa/gcc-4.0.4/pass1.sh index d666437..b18b04e 100755 --- a/sysa/gcc-4.0.4/pass1.sh +++ b/sysa/gcc-4.0.4/pass1.sh @@ -9,7 +9,9 @@ src_unpack() { src_prepare() { default_src_prepare + # This is needed for building with TCC sed -i 's/ix86_attribute_table\[\]/ix86_attribute_table\[10\]/' gcc/config/i386/i386.c + # Needed for musl sed -i 's/struct siginfo/siginfo_t/' gcc/config/i386/linux-unwind.h rm configure @@ -45,7 +47,7 @@ src_prepare() { # Workaround for bison being too new sed -i 's/YYLEX/yylex()/' gcc/c-parse.y rm gcc/c-parse.c - rm gcc/gengtype-yacc.{c,h} + rm gcc/gengtype-yacc.c gcc/gengtype-yacc.h rm intl/plural.c # Rebuild flex generated files diff --git a/sysa/run.sh b/sysa/run.sh index c2fb2df..2633aa4 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -126,6 +126,15 @@ build help2man-1.36.4 build autoconf-2.61 stage1.sh build autoconf-2.61 stage2.sh -build bash-5.1 pass1.sh checksums/pass1 +build automake-1.9.6 stage1.sh +build automake-1.9.6 stage2.sh -exec bash run2.sh +build gcc-4.0.4 pass1.sh checksums/pass1 + +build musl-1.2.2 + +build gcc-4.0.4 pass2.sh checksums/pass2 + +build bash-5.1 + +exec env -i PATH=/after/bin PREFIX=/after bash run2.sh diff --git a/sysa/run2.sh b/sysa/run2.sh index 8515aee..b63c38a 100755 --- a/sysa/run2.sh +++ b/sysa/run2.sh @@ -7,19 +7,9 @@ # SPDX-License-Identifier: GPL-3.0-or-later set -e + . helpers.sh -build automake-1.9.6 stage1.sh -build automake-1.9.6 stage2.sh - -build gcc-4.0.4 pass1.sh checksums/pass1 - -build bash-5.1 pass2.sh checksums/pass2 - -build musl-1.2.2 - -build gcc-4.0.4 pass2.sh checksums/pass2 - echo "Bootstrapping completed." exec env - PATH=/after/bin PS1="\w # " bash -i From cb52876ba8a064e3fcbb08ddcdefb86160ff4ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Wed, 24 Mar 2021 22:09:23 +0000 Subject: [PATCH 11/11] Add a comment explaining bash workaround. --- sysa/bash-5.1/bash-5.1.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sysa/bash-5.1/bash-5.1.sh b/sysa/bash-5.1/bash-5.1.sh index dc064b0..22fbc9a 100755 --- a/sysa/bash-5.1/bash-5.1.sh +++ b/sysa/bash-5.1/bash-5.1.sh @@ -11,6 +11,8 @@ src_prepare() { rm configure autoconf-2.61 + # Without this bash build can be non-deterministic when using + # our old bash 2.05b which was built with Mes C library. sed -i 's/sleep 3/sleep 3; sync/' builtins/psize.sh }