Skip to content

Commit c83aea0

Browse files
committed
binutils-2.41: various regenerations
1 parent 385cd87 commit c83aea0

File tree

3 files changed

+169
-92
lines changed

3 files changed

+169
-92
lines changed

steps/SHA256SUMS.pkgs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ c5807850a377e4bb9aa4121d9781d145bdd80327626a9419630a75ce2c8d9c71 automake-1.9.6
2424
7db49c9b024821d82d15afc0db2b1af8d89700101495a9cbadf471813ba5fa55 bc-1.07.1_0.tar.bz2
2525
3be27e61642ea7d3d4d50a396ab0316ee66b3c469cd38a0a7600e92a9d5022d2 binutils-2.30_0.tar.bz2
2626
43bed356bf52b3d52ef62b63adbeb3bbd1e763e93d0ffd3edb5c75354842f171 binutils-2.41_0.tar.bz2
27-
7808e5290bf530cd7068e91642def059bc3341b628630d1fb2600590477187db binutils-2.41_1.tar.bz2
27+
33e192d498f8fb3015a6b5407f06946f1e1dfd575911377c4201bd4611c72a3f binutils-2.41_1.tar.bz2
2828
fa047f6dd4595be1bf8a9cc6ff492357f02fefa3bf1ad965c8c50c8e79a52478 bison-2.3_0.tar.bz2
2929
81554c867db75101422797d227dd76c8a12c87246393126542ff92a0b97db6c1 bison-3.4.1_0.tar.bz2
3030
f7437edc081071cc3ecd3384abf4c63f33183858b8cae6b4ac3105c66f88b3b6 bison-3.4.1_1.tar.bz2

steps/binutils-2.41/pass1.sh

Lines changed: 81 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: 2022 Dor Askayo <[email protected]>
22
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <[email protected]>
33
# SPDX-FileCopyrightText: 2021 Paul Dersey <[email protected]>
4-
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]>
4+
# SPDX-FileCopyrightText: 2023,2025 fosslinux <[email protected]>
55
#
66
# SPDX-License-Identifier: GPL-3.0-or-later
77

@@ -11,66 +11,104 @@ src_prepare() {
1111

1212
# Remove unused generated files
1313
rm etc/Makefile.in etc/configure
14-
rm zlib/aclocal.m4 zlib/configure
1514

16-
# Remove gprofng
17-
rm -r gprofng
18-
19-
# Regenerate autoconf
20-
for dir in bfd binutils gas gold gprof intl ld libctf libiberty libsframe opcodes; do
21-
cd $dir
22-
AUTOPOINT=true ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
23-
cd ..
24-
done
25-
ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
26-
27-
# Regenerate directories with Makefile.am only
28-
pushd gold
29-
automake-1.15 -fai testsuite/Makefile
30-
popd
15+
# Remove unused parts
16+
rm -r gprofng zlib
3117

3218
# Rebuild bison files
3319
touch -- */*.y
34-
rm binutils/arparse.c binutils/arparse.h
35-
rm binutils/defparse.c binutils/defparse.h
36-
rm binutils/mcparse.c binutils/mcparse.h
37-
rm binutils/rcparse.c binutils/rcparse.h
38-
rm binutils/sysinfo.c binutils/sysinfo.h
39-
rm gas/config/bfin-parse.c gas/config/bfin-parse.h
40-
rm gas/config/loongarch-parse.c gas/config/loongarch-parse.h
41-
rm gas/config/m68k-parse.c gas/config/rl78-parse.c
42-
rm gas/config/rl78-parse.h gas/config/rx-parse.c
43-
rm gas/config/rx-parse.h gas/itbl-parse.c
44-
rm gas/itbl-parse.h gold/yyscript.c
45-
rm gold/yyscript.h intl/plural.c
46-
rm ld/deffilep.c ld/deffilep.h
47-
rm ld/ldgram.c ld/ldgram.h
20+
rm binutils/arparse.c binutils/arparse.h binutils/defparse.c \
21+
binutils/defparse.h binutils/mcparse.c binutils/mcparse.h \
22+
binutils/rcparse.c binutils/rcparse.h binutils/sysinfo.c \
23+
binutils/sysinfo.h gas/config/bfin-parse.c gas/config/bfin-parse.h \
24+
gas/config/loongarch-parse.c gas/config/loongarch-parse.h \
25+
gas/config/m68k-parse.c gas/config/rl78-parse.c \
26+
gas/config/rl78-parse.h gas/config/rx-parse.c gas/config/rx-parse.h \
27+
gas/itbl-parse.c gas/itbl-parse.h gold/yyscript.c gold/yyscript.h \
28+
intl/plural.c ld/deffilep.c ld/deffilep.h ld/ldgram.c ld/ldgram.h
4829

4930
# Rebuild flex generated files
5031
touch -- */*.l */*/*.l
51-
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c
52-
rm gas/config/bfin-lex.c gas/config/loongarch-lex.c gas/itbl-lex.c
53-
rm ld/ldlex.c
32+
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c \
33+
gas/config/bfin-lex.c gas/config/loongarch-lex.c gas/itbl-lex.c \
34+
ld/ldlex.c
5435

55-
# Remove prebuilt texinfo files
36+
# Remove prebuilt docs
5637
find . -type f -name '*.info*' \
5738
-not -wholename './binutils/sysroff.info' \
5839
-delete
40+
find . -type f \( -name '*.1' -or -name '*.man' \) -delete
41+
rm libiberty/functions.texi
42+
43+
# Remove gettext translation files
44+
find . -type f -name '*.gmo' -delete
5945

6046
# Remove pregenerated opcodes files
61-
rm opcodes/i386-init.h opcodes/i386-tbl.h opcodes/i386-mnem.h
62-
rm opcodes/ia64-asmtab.c
63-
rm opcodes/z8k-opc.h
64-
rm opcodes/aarch64-asm-2.c opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c
47+
rm opcodes/i386-init.h opcodes/i386-tbl.h opcodes/i386-mnem.h \
48+
opcodes/ia64-asmtab.c opcodes/z8k-opc.h opcodes/aarch64-asm-2.c \
49+
opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c \
50+
opcodes/msp430-decode.c opcodes/rl78-decode.c opcodes/rx-decode.c
6551
rm $(grep -l 'MACHINE GENERATED' opcodes/*.c opcodes/*.h)
6652

67-
rm libiberty/functions.texi
53+
# Various other blobs/generated headers
54+
rm ld/emultempl/*.o_c
55+
rm gprof/bsd_callg_bl.c gprof/flat_bl.c gprof/fsf_callg_bl.c
56+
rm bfd/libcoff.h bfd/libbfd.h bfd/go32stub.h bfd/bfd-in2.h
57+
58+
# Generated testsuite stuff (xz-style attack)
59+
rm libsframe/testsuite/libsframe.decode/DATA* \
60+
ld/testsuite/ld-x86-64/*.obj.bz2 ld/testsuite/ld-sh/arch/*.s \
61+
ld/testsuite/ld-sh/arch/arch_expected.txt \
62+
ld/testsuite/ld-i386/pr27193a.o.bz2 \
63+
gas/testsuite/gas/xstormy16/allinsn.sh \
64+
gas/testsuite/gas/tic4x/opcodes.s gas/testsuite/gas/sh/arch/*.s \
65+
gas/testsuite/gas/sh/arch/arch_expected.txt \
66+
binutils/testsuite/binutils-all/x86-64/pr22451.o.bz2 \
67+
binutils/testsuite/binutils-all/x86-64/pr26808.dwp.bz2 \
68+
binutils/testsuite/binutils-all/x86-64/pr27708.exe.bz2 \
69+
binutils/testsuite/binutils-all/nfp/*.nffw \
70+
binutils/testsuite/binutils-all/pr26112.o.bz2 \
71+
binutils/testsuite/binutils-all/pr26160.dwp.bz2
72+
73+
# Regenerate crc table in libiberty/crc32.c
74+
cd libiberty
75+
sed -n '/^ #include <stdio.h>/,/^ \}$/p' crc32.c > crcgen.c
76+
gcc -o crcgen crcgen.c
77+
sed '/crc_v3\.txt/{n; q}' crc32.c > crc32.c.new
78+
./crcgen >> crc32.c.new
79+
sed '1,/^};$/d' crc32.c >> crc32.c.new
80+
mv crc32.c.new crc32.c
81+
cd ..
82+
83+
# bfd-in2.h is required to run autoreconf, but we don't have it yet
84+
cd bfd
85+
cp configure.ac configure.ac.bak
86+
sed -i "s/bfd-in3.h:bfd-in2.h //" configure.ac
87+
AUTOPOINT=true ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
88+
./configure
89+
make headers
90+
mv configure.ac.bak configure.ac
91+
make distclean
92+
cd ..
93+
94+
# Regenerate autoconf
95+
for dir in bfd binutils gas gold gprof intl ld libctf libiberty libsframe opcodes; do
96+
cd $dir
97+
AUTOPOINT=true ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
98+
cd ..
99+
done
100+
rm Makefile.in # autogen
101+
ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
102+
103+
# Rebuild dependencies in libiberty/Makefile.in
104+
cd libiberty
105+
./configure --enable-maintainer-mode
106+
make maint-deps
107+
make distclean
108+
cd ..
68109

69110
# Regenerate MeP sections
70111
./bfd/mep-relocs.pl
71-
72-
# Manpages
73-
find . -type f \( -name '*.1' -or -name '*.man' \) -delete
74112
}
75113

76114
src_configure() {

steps/binutils-2.41/pass2.sh

Lines changed: 87 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: 2022 Dor Askayo <[email protected]>
22
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <[email protected]>
33
# SPDX-FileCopyrightText: 2021 Paul Dersey <[email protected]>
4-
# SPDX-FileCopyrightText: 2023 fosslinux <[email protected]>
4+
# SPDX-FileCopyrightText: 2023,2025 fosslinux <[email protected]>
55
#
66
# SPDX-License-Identifier: GPL-3.0-or-later
77

@@ -10,28 +10,9 @@ src_prepare() {
1010

1111
# Remove unused generated files
1212
rm etc/Makefile.in etc/configure
13-
rm zlib/aclocal.m4 zlib/configure
1413

15-
# Regenerate top-level (autogen + autotools)
16-
autogen Makefile.def
17-
ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
18-
19-
# Regenerate autoconf
20-
for dir in bfd binutils gas gold gprof intl ld libctf libiberty libsframe opcodes; do
21-
cd $dir
22-
ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
23-
cd ..
24-
done
25-
26-
# Regenerate directories with Makefile.am only
27-
pushd gold
28-
automake-1.15 -fai testsuite/Makefile
29-
popd
30-
pushd gprofng
31-
automake-1.15 -fai doc/Makefile
32-
automake-1.15 -fai gp-display-html/Makefile
33-
automake-1.15 -fai src/Makefile
34-
popd
14+
# Remove unused parts
15+
rm -r zlib
3516

3617
# intl/ Makefile is a bit broken because of new gettext
3718
sed -i 's/@USE_INCLUDED_LIBINTL@/no/' intl/Makefile.in
@@ -42,46 +23,104 @@ src_prepare() {
4223

4324
# Rebuild bison files
4425
touch -- */*.y
45-
rm binutils/arparse.c binutils/arparse.h
46-
rm binutils/defparse.c binutils/defparse.h
47-
rm binutils/mcparse.c binutils/mcparse.h
48-
rm binutils/rcparse.c binutils/rcparse.h
49-
rm binutils/sysinfo.c binutils/sysinfo.h
50-
rm gas/config/bfin-parse.c gas/config/bfin-parse.h
51-
rm gas/config/loongarch-parse.c gas/config/loongarch-parse.h
52-
rm gas/config/m68k-parse.c gas/config/rl78-parse.c
53-
rm gas/config/rl78-parse.h gas/config/rx-parse.c
54-
rm gas/config/rx-parse.h gas/itbl-parse.c
55-
rm gas/itbl-parse.h gold/yyscript.c
56-
rm gold/yyscript.h intl/plural.c
57-
rm ld/deffilep.c ld/deffilep.h
58-
rm ld/ldgram.c ld/ldgram.h
26+
rm binutils/arparse.c binutils/arparse.h binutils/defparse.c \
27+
binutils/defparse.h binutils/mcparse.c binutils/mcparse.h \
28+
binutils/rcparse.c binutils/rcparse.h binutils/sysinfo.c \
29+
binutils/sysinfo.h gas/config/bfin-parse.c gas/config/bfin-parse.h \
30+
gas/config/loongarch-parse.c gas/config/loongarch-parse.h \
31+
gas/config/m68k-parse.c gas/config/rl78-parse.c \
32+
gas/config/rl78-parse.h gas/config/rx-parse.c gas/config/rx-parse.h \
33+
gas/itbl-parse.c gas/itbl-parse.h gold/yyscript.c gold/yyscript.h \
34+
intl/plural.c ld/deffilep.c ld/deffilep.h ld/ldgram.c ld/ldgram.h
5935

6036
# Rebuild flex generated files
6137
touch -- */*.l */*/*.l
62-
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c
63-
rm gas/config/bfin-lex.c gas/config/loongarch-lex.c gas/itbl-lex.c
64-
rm ld/ldlex.c
38+
rm binutils/arlex.c binutils/deflex.c binutils/syslex.c \
39+
gas/config/bfin-lex.c gas/config/loongarch-lex.c gas/itbl-lex.c \
40+
ld/ldlex.c
6541

66-
# Remove prebuilt texinfo files
42+
# Remove prebuilt docs
6743
find . -type f -name '*.info*' \
6844
-not -wholename './binutils/sysroff.info' \
6945
-delete
46+
find . -type f \( -name '*.1' -or -name '*.man' \) -delete
47+
rm libiberty/functions.texi
48+
49+
# Remove gettext translation files
50+
find . -type f -name '*.gmo' -delete
7051

7152
# Remove pregenerated opcodes files
72-
rm opcodes/i386-init.h opcodes/i386-tbl.h opcodes/i386-mnem.h
73-
rm opcodes/ia64-asmtab.c
74-
rm opcodes/z8k-opc.h
75-
rm opcodes/aarch64-asm-2.c opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c
53+
rm opcodes/i386-init.h opcodes/i386-tbl.h opcodes/i386-mnem.h \
54+
opcodes/ia64-asmtab.c opcodes/z8k-opc.h opcodes/aarch64-asm-2.c \
55+
opcodes/aarch64-opc-2.c opcodes/aarch64-dis-2.c \
56+
opcodes/msp430-decode.c opcodes/rl78-decode.c opcodes/rx-decode.c
7657
rm $(grep -l 'MACHINE GENERATED' opcodes/*.c opcodes/*.h)
7758

78-
rm libiberty/functions.texi
59+
# Various other blobs/generated headers
60+
rm ld/emultempl/*.o_c
61+
rm gprof/bsd_callg_bl.c gprof/flat_bl.c gprof/fsf_callg_bl.c
62+
rm bfd/libcoff.h bfd/libbfd.h bfd/go32stub.h bfd/bfd-in2.h
63+
64+
# Generated testsuite stuff (xz-style attack)
65+
rm libsframe/testsuite/libsframe.decode/DATA* \
66+
ld/testsuite/ld-x86-64/*.obj.bz2 ld/testsuite/ld-sh/arch/*.s \
67+
ld/testsuite/ld-sh/arch/arch_expected.txt \
68+
ld/testsuite/ld-i386/pr27193a.o.bz2 \
69+
gas/testsuite/gas/xstormy16/allinsn.sh \
70+
gas/testsuite/gas/tic4x/opcodes.s gas/testsuite/gas/sh/arch/*.s \
71+
gas/testsuite/gas/sh/arch/arch_expected.txt \
72+
binutils/testsuite/binutils-all/x86-64/pr22451.o.bz2 \
73+
binutils/testsuite/binutils-all/x86-64/pr26808.dwp.bz2 \
74+
binutils/testsuite/binutils-all/x86-64/pr27708.exe.bz2 \
75+
binutils/testsuite/binutils-all/nfp/*.nffw \
76+
binutils/testsuite/binutils-all/pr26112.o.bz2 \
77+
binutils/testsuite/binutils-all/pr26160.dwp.bz2
78+
79+
# Regenerate crc table in libiberty/crc32.c
80+
cd libiberty
81+
sed -n '/^ #include <stdio.h>/,/^ \}$/p' crc32.c > crcgen.c
82+
gcc -o crcgen crcgen.c
83+
sed '/crc_v3\.txt/{n; q}' crc32.c > crc32.c.new
84+
./crcgen >> crc32.c.new
85+
sed '1,/^};$/d' crc32.c >> crc32.c.new
86+
mv crc32.c.new crc32.c
87+
cd ..
88+
89+
# bfd-in2.h is required to run autoreconf, but we don't have it yet
90+
cd bfd
91+
cp configure.ac configure.ac.bak
92+
sed -i "s/bfd-in3.h:bfd-in2.h //" configure.ac
93+
AUTOPOINT=true ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
94+
./configure
95+
make headers
96+
mv configure.ac.bak configure.ac
97+
make distclean
98+
cd ..
99+
100+
# Regenerate top-level (autogen + autotools)
101+
autogen Makefile.def
102+
ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi
103+
104+
# Regenerate autoconf
105+
for dir in bfd binutils gas gold gprof intl ld libctf libiberty libsframe opcodes; do
106+
cd $dir
107+
ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
108+
cd ..
109+
done
110+
cd gprofng
111+
# there is no libtool in gprofng, and libtoolize fails
112+
LIBTOOLIZE=true ACLOCAL=aclocal-1.15 AUTOMAKE=automake-1.15 autoreconf-2.69 -fi
113+
cd ..
114+
115+
# Rebuild dependencies in libiberty/Makefile.in
116+
cd libiberty
117+
./configure --enable-maintainer-mode
118+
make maint-deps
119+
make distclean
120+
cd ..
79121

80122
# Regenerate MeP sections
81123
./bfd/mep-relocs.pl
82-
83-
# Manpages
84-
find . -type f \( -name '*.1' -or -name '*.man' \) -delete
85124
}
86125

87126
src_configure() {

0 commit comments

Comments
 (0)