mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-10 21:35:24 +01:00
Update binutils to 2.41
This commit is contained in:
parent
545bb42ca8
commit
191c013e23
11 changed files with 87 additions and 72 deletions
118
steps/binutils-2.41/pass1.sh
Executable file
118
steps/binutils-2.41/pass1.sh
Executable file
|
|
@ -0,0 +1,118 @@
|
|||
# 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
|
||||
|
||||
# Remove gprofng
|
||||
rm -r gprofng
|
||||
|
||||
# Regenerate autoconf
|
||||
for dir in bfd binutils gas gold gprof intl ld libctf libiberty libsframe 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
|
||||
|
||||
# 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 opcodes/i386-mnem.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)
|
||||
|
||||
rm libiberty/functions.texi
|
||||
|
||||
# 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 libsframe 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 libsframe 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 libsframe 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"
|
||||
}
|
||||
127
steps/binutils-2.41/pass2.sh
Executable file
127
steps/binutils-2.41/pass2.sh
Executable file
|
|
@ -0,0 +1,127 @@
|
|||
# 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 gprofng intl ld libctf libiberty libsframe 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 gprofng
|
||||
automake-1.15 -fai doc/Makefile
|
||||
automake-1.15 -fai gp-display-html/Makefile
|
||||
automake-1.15 -fai src/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 opcodes/i386-mnem.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)
|
||||
|
||||
rm libiberty/functions.texi
|
||||
|
||||
# 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 \
|
||||
--disable-gprofng \
|
||||
--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"
|
||||
}
|
||||
17
steps/binutils-2.41/patches/new-gettext.patch
Normal file
17
steps/binutils-2.41/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.])
|
||||
26
steps/binutils-2.41/patches/no-maint-functions-texi.patch
Normal file
26
steps/binutils-2.41/patches/no-maint-functions-texi.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
Ensure functions.texi dependencies are satisfied.
|
||||
|
||||
--- libiberty/Makefile.in 2023-12-08 15:18:57.985791235 +1100
|
||||
+++ libiberty/Makefile.in 2023-12-08 15:19:15.391252344 +1100
|
||||
@@ -368,12 +368,12 @@
|
||||
libiberty.html : $(srcdir)/libiberty.texi $(TEXISRC)
|
||||
$(MAKEINFO) --no-split --html -I$(srcdir) -o $@ $<
|
||||
|
||||
-@MAINT@$(srcdir)/functions.texi : stamp-functions
|
||||
-@MAINT@ @true
|
||||
+$(srcdir)/functions.texi : stamp-functions
|
||||
+ @true
|
||||
|
||||
-@MAINT@stamp-functions : $(CFILES:%=$(srcdir)/%) $(TEXIFILES:%=$(srcdir)/%) $(srcdir)/gather-docs Makefile
|
||||
-@MAINT@@HAVE_PERL@ $(PERL) $(srcdir)/gather-docs $(srcdir) $(srcdir)/functions.texi $(CFILES) $(TEXIFILES)
|
||||
-@MAINT@ echo stamp > stamp-functions
|
||||
+stamp-functions : $(CFILES:%=$(srcdir)/%) $(TEXIFILES:%=$(srcdir)/%) $(srcdir)/gather-docs Makefile
|
||||
+@HAVE_PERL@ $(PERL) $(srcdir)/gather-docs $(srcdir) $(srcdir)/functions.texi $(CFILES) $(TEXIFILES)
|
||||
+ echo stamp > stamp-functions
|
||||
|
||||
INSTALL_DEST = @INSTALL_DEST@
|
||||
install: install_to_$(INSTALL_DEST) install-subdir
|
||||
18
steps/binutils-2.41/patches/no-maint-opcodes.patch
Normal file
18
steps/binutils-2.41/patches/no-maint-opcodes.patch
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
SPDX-FileCopyrightText: 2022 Dor Askayo <dor.askayo@gmail.com>
|
||||
SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
Ensure i386-tbl.h dependencies are satisfied.
|
||||
|
||||
--- opcodes/Makefile.am 2023-12-08 17:13:05.669136957 +1100
|
||||
+++ opcodes/Makefile.am 2023-12-08 17:13:18.410480026 +1100
|
||||
@@ -540,7 +540,7 @@
|
||||
# i386-gen will generate all headers in one go. Use a pattern rule to properly
|
||||
# express this, with the inner dash ('-') arbitrarily chosen to be the stem.
|
||||
$(srcdir)/i386%tbl.h $(srcdir)/i386%init.h $(srcdir)/i386%mnem.h: \
|
||||
- @MAINT@ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
|
||||
+ i386-gen$(EXEEXT_FOR_BUILD) i386-opc.tbl i386-reg.tbl i386-opc.h
|
||||
$(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - \
|
||||
< $(srcdir)/i386-opc.tbl \
|
||||
| ./i386-gen$(EXEEXT_FOR_BUILD) --srcdir $(srcdir)
|
||||
1
steps/binutils-2.41/sources
Normal file
1
steps/binutils-2.41/sources
Normal file
|
|
@ -0,0 +1 @@
|
|||
https://mirrors.kernel.org/gnu/binutils/binutils-2.41.tar.xz ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450
|
||||
Loading…
Add table
Add a link
Reference in a new issue