commit: f5c262e370c30fc6b1f52953621223558b5eefff
parent 30ebe8ccba7b635a8bba2001deb7f0827d32cddc
Author: Andrius Štikonas <andrius@stikonas.eu>
Date: Sat, 20 Mar 2021 21:23:07 +0000
GNU GCC 4.0.4
Diffstat:
6 files changed, 117 insertions(+), 6 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,83 @@
+# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
+# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
+
+# 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
@@ -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