mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-07 20:05:24 +01:00
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:
parent
0907cfd073
commit
6ed2e09f3a
546 changed files with 700 additions and 1299 deletions
117
steps/binutils-2.38/pass1.sh
Executable file
117
steps/binutils-2.38/pass1.sh
Executable file
|
|
@ -0,0 +1,117 @@
|
|||
# SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
||||
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# Remove unused generated files
|
||||
rm etc/Makefile.in etc/configure
|
||||
|
||||
rm zlib/aclocal.m4 zlib/configure
|
||||
|
||||
# Regenerate autoconf
|
||||
for dir in bfd binutils gas gold gprof intl ld libctf libiberty opcodes; do
|
||||
cd $dir
|
||||
AUTOPOINT=true ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
|
||||
cd ..
|
||||
done
|
||||
ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
|
||||
|
||||
# Regenerate directories with Makefile.am only
|
||||
pushd gold
|
||||
automake-1.15 -fai testsuite/Makefile
|
||||
popd
|
||||
pushd bfd
|
||||
automake-1.15 -fai doc/Makefile
|
||||
popd
|
||||
|
||||
# Rebuild bison files
|
||||
touch -- */*.y
|
||||
rm binutils/arparse.c binutils/arparse.h
|
||||
rm binutils/defparse.c binutils/defparse.h
|
||||
rm binutils/mcparse.c binutils/mcparse.h
|
||||
rm binutils/rcparse.c binutils/rcparse.h
|
||||
rm binutils/sysinfo.c binutils/sysinfo.h
|
||||
rm gas/config/bfin-parse.c gas/config/bfin-parse.h
|
||||
rm gas/config/loongarch-parse.c gas/config/loongarch-parse.h
|
||||
rm gas/config/m68k-parse.c gas/config/rl78-parse.c
|
||||
rm gas/config/rl78-parse.h gas/config/rx-parse.c
|
||||
rm gas/config/rx-parse.h gas/itbl-parse.c
|
||||
rm gas/itbl-parse.h gold/yyscript.c
|
||||
rm gold/yyscript.h intl/plural.c
|
||||
rm ld/deffilep.c ld/deffilep.h
|
||||
rm ld/ldgram.c ld/ldgram.h
|
||||
|
||||
# Rebuild flex generated files
|
||||
touch -- */*.l */*/*.l
|
||||
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c
|
||||
rm gas/config/bfin-lex.c gas/config/loongarch-lex.c gas/itbl-lex.c
|
||||
rm ld/ldlex.c
|
||||
|
||||
# Remove prebuilt texinfo files
|
||||
find . -type f -name '*.info*' \
|
||||
-not -wholename './binutils/sysroff.info' \
|
||||
-delete
|
||||
|
||||
# Remove pregenerated opcodes files
|
||||
rm opcodes/i386-init.h opcodes/i386-tbl.h
|
||||
rm opcodes/ia64-asmtab.c
|
||||
rm opcodes/z8k-opc.h
|
||||
rm opcodes/aarch64-asm-2.c opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c
|
||||
rm $(grep -l 'MACHINE GENERATED' opcodes/*.c opcodes/*.h)
|
||||
|
||||
# Regenerate MeP sections
|
||||
./bfd/mep-relocs.pl
|
||||
|
||||
# Manpages
|
||||
find . -type f \( -name '*.1' -or -name '*.man' \) -delete
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
for dir in intl libctf libiberty opcodes bfd binutils gas gprof ld; do
|
||||
cd $dir
|
||||
|
||||
./configure \
|
||||
--disable-nls \
|
||||
--enable-install-libiberty \
|
||||
--enable-deterministic-archives \
|
||||
--with-system-zlib \
|
||||
--build=i386-unknown-linux-musl \
|
||||
--host=i386-unknown-linux-musl \
|
||||
--target=i386-unknown-linux-musl \
|
||||
--program-prefix="" \
|
||||
--prefix="${PREFIX}" \
|
||||
--libdir="${LIBDIR}" \
|
||||
--with-sysroot= \
|
||||
--srcdir=.
|
||||
cd ..
|
||||
done
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
make -C bfd headers
|
||||
for dir in libiberty bfd opcodes libctf binutils gas gprof ld; do
|
||||
make "${MAKEJOBS}" -C $dir tooldir=${PREFIX} CFLAGS="-std=c99"
|
||||
done
|
||||
}
|
||||
|
||||
src_install() {
|
||||
for dir in libiberty bfd opcodes libctf binutils gas gprof ld; do
|
||||
make -C $dir tooldir=${PREFIX} DESTDIR="${DESTDIR}" install
|
||||
done
|
||||
|
||||
# Create triplet symlinks
|
||||
pushd "${DESTDIR}${PREFIX}/bin"
|
||||
for f in *; do
|
||||
ln -s "${PREFIX}/bin/${f}" "i386-unknown-linux-musl-${f}"
|
||||
done
|
||||
popd
|
||||
|
||||
# FIXME: Binutils' manpages dates are not reproducible
|
||||
rm -r "${DESTDIR}${PREFIX}/share/man"
|
||||
}
|
||||
122
steps/binutils-2.38/pass2.sh
Executable file
122
steps/binutils-2.38/pass2.sh
Executable file
|
|
@ -0,0 +1,122 @@
|
|||
# SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
||||
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# Remove unused generated files
|
||||
rm etc/Makefile.in etc/configure
|
||||
rm zlib/aclocal.m4 zlib/configure
|
||||
|
||||
# Regenerate top-level (autogen + autotools)
|
||||
autogen Makefile.def
|
||||
ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
|
||||
|
||||
# Regenerate autoconf
|
||||
for dir in bfd binutils gas gold gprof intl ld libctf libiberty opcodes; do
|
||||
cd $dir
|
||||
ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
|
||||
cd ..
|
||||
done
|
||||
|
||||
# Regenerate directories with Makefile.am only
|
||||
pushd gold
|
||||
automake-1.15 -fai testsuite/Makefile
|
||||
popd
|
||||
pushd bfd
|
||||
automake-1.15 -fai doc/Makefile
|
||||
popd
|
||||
|
||||
# intl/ Makefile is a bit broken because of new gettext
|
||||
sed -i 's/@USE_INCLUDED_LIBINTL@/no/' intl/Makefile.in
|
||||
|
||||
# There is no way to add -all-static to libtool LDFLAGS (such a thing doesn't exist)
|
||||
# -all-static is required for static binaries with libtool
|
||||
sed -i 's:\(--mode=link $(CCLD)\):\1 -all-static:' {bfd,binutils,opcodes,ld,libctf,gas,gprof}/Makefile.in
|
||||
|
||||
# Rebuild bison files
|
||||
touch -- */*.y
|
||||
rm binutils/arparse.c binutils/arparse.h
|
||||
rm binutils/defparse.c binutils/defparse.h
|
||||
rm binutils/mcparse.c binutils/mcparse.h
|
||||
rm binutils/rcparse.c binutils/rcparse.h
|
||||
rm binutils/sysinfo.c binutils/sysinfo.h
|
||||
rm gas/config/bfin-parse.c gas/config/bfin-parse.h
|
||||
rm gas/config/loongarch-parse.c gas/config/loongarch-parse.h
|
||||
rm gas/config/m68k-parse.c gas/config/rl78-parse.c
|
||||
rm gas/config/rl78-parse.h gas/config/rx-parse.c
|
||||
rm gas/config/rx-parse.h gas/itbl-parse.c
|
||||
rm gas/itbl-parse.h gold/yyscript.c
|
||||
rm gold/yyscript.h intl/plural.c
|
||||
rm ld/deffilep.c ld/deffilep.h
|
||||
rm ld/ldgram.c ld/ldgram.h
|
||||
|
||||
# Rebuild flex generated files
|
||||
touch -- */*.l */*/*.l
|
||||
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c
|
||||
rm gas/config/bfin-lex.c gas/config/loongarch-lex.c gas/itbl-lex.c
|
||||
rm ld/ldlex.c
|
||||
|
||||
# Remove prebuilt texinfo files
|
||||
find . -type f -name '*.info*' \
|
||||
-not -wholename './binutils/sysroff.info' \
|
||||
-delete
|
||||
|
||||
# Remove pregenerated opcodes files
|
||||
rm opcodes/i386-init.h opcodes/i386-tbl.h
|
||||
rm opcodes/ia64-asmtab.c
|
||||
rm opcodes/z8k-opc.h
|
||||
rm opcodes/aarch64-asm-2.c opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c
|
||||
rm $(grep -l 'MACHINE GENERATED' opcodes/*.c opcodes/*.h)
|
||||
|
||||
# Regenerate MeP sections
|
||||
./bfd/mep-relocs.pl
|
||||
|
||||
# Manpages
|
||||
find . -type f \( -name '*.1' -or -name '*.man' \) -delete
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
LDFLAGS="-static" \
|
||||
../configure \
|
||||
--prefix="${PREFIX}" \
|
||||
--libdir="${LIBDIR}" \
|
||||
--build=i386-unknown-linux-musl \
|
||||
--host=i386-unknown-linux-musl \
|
||||
--target=i386-unknown-linux-musl \
|
||||
--enable-static \
|
||||
--disable-nls \
|
||||
--disable-multilib \
|
||||
--disable-plugins \
|
||||
--enable-threads \
|
||||
--enable-64-bit-bfd \
|
||||
--enable-gold \
|
||||
--enable-ld=default \
|
||||
--enable-install-libiberty \
|
||||
--enable-deterministic-archives \
|
||||
--with-system-zlib \
|
||||
--program-prefix="" \
|
||||
--with-sysroot= \
|
||||
--srcdir=..
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
|
||||
# Create triplet symlinks
|
||||
pushd "${DESTDIR}${PREFIX}/bin"
|
||||
for f in *; do
|
||||
ln -s "${PREFIX}/bin/${f}" "i386-unknown-linux-musl-${f}"
|
||||
done
|
||||
popd
|
||||
|
||||
# FIXME: Binutils' manpages dates are not reproducible
|
||||
rm -r "${DESTDIR}${PREFIX}/share/man"
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
Add missing AC_CONFIG_MACRO_DIR.
|
||||
|
||||
Required by autoreconf to create aclocal.m4 correctly.
|
||||
|
||||
--- /libiberty/configure.ac 2022-01-22 14:14:09.000000000 +0200
|
||||
+++ libiberty/configure.ac 2022-09-04 00:01:02.941738129 +0300
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([xmalloc.c])
|
||||
+AC_CONFIG_MACRO_DIR(../config)
|
||||
|
||||
# This works around the fact that libtool configuration may change LD
|
||||
# for this particular configuration, but some shells, instead of
|
||||
17
steps/binutils-2.38/patches/new-gettext.patch
Normal file
17
steps/binutils-2.38/patches/new-gettext.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
In new gettext external is required for AM_GNU_GETTEXT.
|
||||
|
||||
--- intl/configure.ac 2023-02-07 18:57:56.350832016 +1100
|
||||
+++ intl/configure.ac 2023-02-07 18:58:07.310054484 +1100
|
||||
@@ -4,7 +4,7 @@
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_MACRO_DIR(../config)
|
||||
AM_GNU_GETTEXT_VERSION(0.12.1)
|
||||
-AM_GNU_GETTEXT([], [need-ngettext])
|
||||
+AM_GNU_GETTEXT([external], [need-ngettext])
|
||||
|
||||
# This replaces the extensive use of DEFS in the original Makefile.in.
|
||||
AC_DEFINE(IN_LIBINTL, 1, [Define because this is libintl.])
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
Ensure i386-init.h dependencies are satisfied.
|
||||
|
||||
--- opcodes/Makefile.am 2022-01-22 14:14:09.000000000 +0200
|
||||
+++ opcodes/Makefile.am 2022-09-13 21:09:04.353324699 +0300
|
||||
@@ -575,7 +575,7 @@ i386-gen.o: i386-gen.c i386-opc.h $(srcd
|
||||
$(srcdir)/i386-tbl.h: $(srcdir)/i386-init.h
|
||||
@echo $@
|
||||
|
||||
-$(srcdir)/i386-init.h: @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
|
||||
+$(srcdir)/i386-init.h: i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
|
||||
$(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
|
||||
< $(srcdir)/i386-opc.tbl \
|
||||
| ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
|
||||
1
steps/binutils-2.38/sources
Normal file
1
steps/binutils-2.38/sources
Normal file
|
|
@ -0,0 +1 @@
|
|||
https://mirrors.kernel.org/gnu/binutils/binutils-2.38.tar.xz e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
|
||||
Loading…
Add table
Add a link
Reference in a new issue