Rebuild GCC against musl 1.2.2.

This commit is contained in:
Andrius Štikonas 2021-03-21 00:24:24 +00:00
parent 8cd8c0fe31
commit 0572ff41ef
6 changed files with 117 additions and 12 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

81
sysa/gcc-4.0.4/pass2.sh Executable file
View File

@ -0,0 +1,81 @@
# 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
# 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
}

View File

@ -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