Remove the notion of "sys*"

- This idea originates from very early in the project and was, at the
  time, a very easy way to categorise things.
- Now, it doesn't really make much sense - it is fairly arbitary, often
  occuring when there is a change in kernel, but not from builder-hex0
  to fiwix, and sysb is in reality completely unnecessary.
- In short, the sys* stuff is a bit of a mess that makes the project
  more difficult to understand.
- This puts everything down into one folder and has a manifest file that
  is used to generate the build scripts on the fly rather than using
  coded scripts.
- This is created in the "seed" stage.

stage0-posix -- (calls) --> seed -- (generates) --> main steps

Alongside this change there are a variety of other smaller fixups to the
general structure of the live-bootstrap rootfs.

- Creating a rootfs has become much simpler and is defined as code in
  go.sh. The new structure, for an about-to-be booted system, is

/
-- /steps (direct copy of steps/)
-- /distfiles (direct copy of distfiles/)
-- all files from seed/*
-- all files from seed/stage0-posix/*

- There is no longer such a thing as /usr/include/musl, this didn't
  really make any sense, as musl is the final libc used. Rather, to
  separate musl and mes, we have /usr/include/mes, which is much easier
  to work with.
- This also makes mes easier to blow away later.
- A few things that weren't properly in packages have been changed;
  checksum-transcriber, simple-patch, kexec-fiwix have all been given
  fully qualified package names.
- Highly breaking change, scripts now exist in their package directory
  but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh,
  etc. This avoids manual definition of passes.
  - Ditto with patches; default directory is patches, but then any patch
    series specific to a pass are named patches-passX.
This commit is contained in:
fosslinux 2023-11-07 10:51:23 +11:00
parent 0907cfd073
commit 6ed2e09f3a
546 changed files with 700 additions and 1299 deletions

106
steps/gcc-4.0.4/pass1.sh Executable file
View file

@ -0,0 +1,106 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="automake-1.16.3.tar.gz"
src_prepare() {
default
# 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
# Regenerating top level Makefile requires GNU Autogen and hence Guile,
# but it is not essential for building gcc.
rm configure Makefile.in fixincludes/fixincl.x
for dir in intl libcpp; do
cd $dir
rm aclocal.m4
AUTOM4TE=autom4te-2.61 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
AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 AUTOM4TE=autom4te-2.61 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
cp ../automake-1.16.3/lib/config.sub .
# 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 libcpp/po/*.gmo
# Pre-built texinfo files
rm gcc/doc/*.info
# Pre-built man files
rm gcc/doc/*.1 gcc/doc/*.7
}
src_configure() {
mkdir build
cd build
for dir in libiberty libcpp gcc; do
mkdir $dir
cd $dir
CC=tcc CFLAGS="-D HAVE_ALLOCA_H" ../../$dir/configure \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--build=i386-unknown-linux-musl \
--target=i386-unknown-linux-musl \
--host=i386-unknown-linux-musl \
--disable-shared \
--program-transform-name=
cd ..
done
cd ..
sed -i 's/C_alloca/alloca/g' libiberty/alloca.c
sed -i 's/C_alloca/alloca/g' include/libiberty.h
}
src_compile() {
ln -s . build/build-i386-unknown-linux-musl
mkdir build/gcc/include
ln -s ../../../gcc/gsyslimits.h build/gcc/include/syslimits.h
for dir in libiberty libcpp gcc; do
make "${MAKEJOBS}" -C build/$dir LIBGCC2_INCLUDES=-I"${PREFIX}/include" STMP_FIXINC=
done
}
src_install() {
mkdir -p "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/install-tools/include"
make -C build/gcc install STMP_FIXINC= DESTDIR="${DESTDIR}"
mkdir -p "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/include"
rm "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/include/syslimits.h"
cp gcc/gsyslimits.h "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/include/syslimits.h"
}

98
steps/gcc-4.0.4/pass2.sh Executable file
View file

@ -0,0 +1,98 @@
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
# SPDX-License-Identifier: GPL-3.0-or-later
EXTRA_DISTFILES="automake-1.16.3.tar.gz"
src_prepare() {
default
# Needed for musl
sed -i 's/struct siginfo/siginfo_t/' gcc/config/i386/linux-unwind.h
# Regenerating top level Makefile requires GNU Autogen and hence Guile,
# but it is not essential for building gcc.
rm configure Makefile.in fixincludes/fixincl.x
for dir in intl libcpp; do
cd $dir
rm aclocal.m4
AUTOM4TE=autom4te-2.61 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
AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 AUTOM4TE=autom4te-2.61 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
cp ../automake-1.16.3/lib/config.sub .
# 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
find . -name '*.gmo' -delete
# Pre-built texinfo files
find . -name '*.info' -delete
# Pre-built man files
rm gcc/doc/*.1 gcc/doc/*.7
}
src_configure() {
mkdir build
cd build
for dir in libiberty libcpp gcc; do
mkdir $dir
cd $dir
../../$dir/configure \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--build=i386-unknown-linux-musl \
--target=i386-unknown-linux-musl \
--host=i386-unknown-linux-musl \
--disable-shared \
--program-transform-name=
cd ..
done
cd ..
}
src_compile() {
ln -s . build/build-i386-unknown-linux-musl
for dir in libiberty libcpp gcc; do
make "${MAKEJOBS}" -C build/$dir LIBGCC2_INCLUDES=-I"${PREFIX}/include" STMP_FIXINC=
done
}
src_install() {
mkdir -p "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/install-tools/include"
make -C build/gcc install STMP_FIXINC= DESTDIR="${DESTDIR}"
cp gcc/gsyslimits.h "${DESTDIR}${LIBDIR}/gcc/i386-unknown-linux-musl/4.0.4/include/syslimits.h"
}

2
steps/gcc-4.0.4/sources Normal file
View file

@ -0,0 +1,2 @@
https://mirrors.kernel.org/gnu/gcc/gcc-4.0.4/gcc-core-4.0.4.tar.bz2 e9bf58c761a4f988311aef6b41f12fd5c7e51d09477468fb73826aecc1be32e7
https://mirrors.kernel.org/gnu/automake/automake-1.16.3.tar.gz ce010788b51f64511a1e9bb2a1ec626037c6d0e7ede32c1c103611b9d3cba65f