diff --git a/cross/binutils-aarch64/APKBUILD b/cross/binutils-aarch64/APKBUILD index fd3ea30d6..bf1646fe1 100644 --- a/cross/binutils-aarch64/APKBUILD +++ b/cross/binutils-aarch64/APKBUILD @@ -4,7 +4,7 @@ pkgname=binutils-aarch64 pkgver=2.38 -pkgrel=0 +pkgrel=1 pkgdesc="Tools necessary to build programs for aarch64 targets" url="https://www.gnu.org/software/binutils/" makedepends="gettext libtool autoconf automake bison texinfo" @@ -16,6 +16,7 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz ld-bfd-mips.patch 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch binutils-mips-disable-assert.patch + binutils-ppc-fix-machine-options.patch " builddir="$srcdir/binutils-$pkgver" @@ -77,4 +78,5 @@ f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488 314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch 70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch 609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch +27ea91e0e406e2ed464fd692cf92a07e338781789f2d968c8b95d9d5545985056a6f7f500df3952e5ab42165db28b741aa33d6b717e880b11a2e41fe406b13c4 binutils-ppc-fix-machine-options.patch " diff --git a/cross/binutils-aarch64/binutils-ppc-fix-machine-options.patch b/cross/binutils-aarch64/binutils-ppc-fix-machine-options.patch new file mode 100644 index 000000000..703ecf98a --- /dev/null +++ b/cross/binutils-aarch64/binutils-ppc-fix-machine-options.patch @@ -0,0 +1,41 @@ +Fix for DARN opcode error during ppc64le compilation of rng-tools which +occurs with binutils 2.38 but not with binutils 2.37.. + +https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=cebc89b9328;hp=9cbed90ee623d75e31994e7943960c997ba565f2 + + +diff -aur a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c +--- a/gas/config/tc-ppc.c ++++ b/gas/config/tc-ppc.c +@@ -5965,7 +5965,30 @@ + options do not count as a new machine, instead they add + to currently selected opcodes. */ + ppc_cpu_t machine_sticky = 0; +- new_cpu = ppc_parse_cpu (ppc_cpu, &machine_sticky, cpu_string); ++ /* Unfortunately, some versions of gcc emit a .machine ++ directive very near the start of the compiler's assembly ++ output file. This is bad because it overrides user -Wa ++ cpu selection. Worse, there are versions of gcc that ++ emit the *wrong* cpu, not even respecting the -mcpu given ++ to gcc. See gcc pr101393. And to compound the problem, ++ as of 20220222 gcc doesn't pass the correct cpu option to ++ gas on the command line. See gcc pr59828. Hack around ++ this by keeping sticky options for an early .machine. */ ++ asection *sec; ++ for (sec = stdoutput->sections; sec != NULL; sec = sec->next) ++ { ++ segment_info_type *info = seg_info (sec); ++ /* Are the frags for this section perturbed from their ++ initial state? Even .align will count here. */ ++ if (info != NULL ++ && (info->frchainP->frch_root != info->frchainP->frch_last ++ || info->frchainP->frch_root->fr_type != rs_fill ++ || info->frchainP->frch_root->fr_fix != 0)) ++ break; ++ } ++ new_cpu = ppc_parse_cpu (ppc_cpu, ++ sec == NULL ? &sticky : &machine_sticky, ++ cpu_string); + if (new_cpu != 0) + ppc_cpu = new_cpu; + else diff --git a/cross/binutils-armhf/APKBUILD b/cross/binutils-armhf/APKBUILD index a81dd98f2..06f2ddcd8 100644 --- a/cross/binutils-armhf/APKBUILD +++ b/cross/binutils-armhf/APKBUILD @@ -4,7 +4,7 @@ pkgname=binutils-armhf pkgver=2.38 -pkgrel=0 +pkgrel=1 pkgdesc="Tools necessary to build programs for armhf targets" url="https://www.gnu.org/software/binutils/" makedepends="gettext libtool autoconf automake bison texinfo" @@ -16,6 +16,7 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz ld-bfd-mips.patch 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch binutils-mips-disable-assert.patch + binutils-ppc-fix-machine-options.patch " builddir="$srcdir/binutils-$pkgver" @@ -77,4 +78,5 @@ f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488 314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch 70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch 609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch +27ea91e0e406e2ed464fd692cf92a07e338781789f2d968c8b95d9d5545985056a6f7f500df3952e5ab42165db28b741aa33d6b717e880b11a2e41fe406b13c4 binutils-ppc-fix-machine-options.patch " diff --git a/cross/binutils-armhf/binutils-ppc-fix-machine-options.patch b/cross/binutils-armhf/binutils-ppc-fix-machine-options.patch new file mode 100644 index 000000000..703ecf98a --- /dev/null +++ b/cross/binutils-armhf/binutils-ppc-fix-machine-options.patch @@ -0,0 +1,41 @@ +Fix for DARN opcode error during ppc64le compilation of rng-tools which +occurs with binutils 2.38 but not with binutils 2.37.. + +https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=cebc89b9328;hp=9cbed90ee623d75e31994e7943960c997ba565f2 + + +diff -aur a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c +--- a/gas/config/tc-ppc.c ++++ b/gas/config/tc-ppc.c +@@ -5965,7 +5965,30 @@ + options do not count as a new machine, instead they add + to currently selected opcodes. */ + ppc_cpu_t machine_sticky = 0; +- new_cpu = ppc_parse_cpu (ppc_cpu, &machine_sticky, cpu_string); ++ /* Unfortunately, some versions of gcc emit a .machine ++ directive very near the start of the compiler's assembly ++ output file. This is bad because it overrides user -Wa ++ cpu selection. Worse, there are versions of gcc that ++ emit the *wrong* cpu, not even respecting the -mcpu given ++ to gcc. See gcc pr101393. And to compound the problem, ++ as of 20220222 gcc doesn't pass the correct cpu option to ++ gas on the command line. See gcc pr59828. Hack around ++ this by keeping sticky options for an early .machine. */ ++ asection *sec; ++ for (sec = stdoutput->sections; sec != NULL; sec = sec->next) ++ { ++ segment_info_type *info = seg_info (sec); ++ /* Are the frags for this section perturbed from their ++ initial state? Even .align will count here. */ ++ if (info != NULL ++ && (info->frchainP->frch_root != info->frchainP->frch_last ++ || info->frchainP->frch_root->fr_type != rs_fill ++ || info->frchainP->frch_root->fr_fix != 0)) ++ break; ++ } ++ new_cpu = ppc_parse_cpu (ppc_cpu, ++ sec == NULL ? &sticky : &machine_sticky, ++ cpu_string); + if (new_cpu != 0) + ppc_cpu = new_cpu; + else diff --git a/cross/binutils-armv7/APKBUILD b/cross/binutils-armv7/APKBUILD index 8f3d2550b..6abb08390 100644 --- a/cross/binutils-armv7/APKBUILD +++ b/cross/binutils-armv7/APKBUILD @@ -4,7 +4,7 @@ pkgname=binutils-armv7 pkgver=2.38 -pkgrel=0 +pkgrel=1 pkgdesc="Tools necessary to build programs for armv7 targets" url="https://www.gnu.org/software/binutils/" makedepends="gettext libtool autoconf automake bison texinfo" @@ -16,6 +16,7 @@ source="https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz ld-bfd-mips.patch 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch binutils-mips-disable-assert.patch + binutils-ppc-fix-machine-options.patch " builddir="$srcdir/binutils-$pkgver" @@ -77,4 +78,5 @@ f55cf2e0bf82f97583a1abe10710e4013ecf7d64f1da2ef8659a44a06d0dd8beaf58dab98a183488 314d2ef9071c89940aa6c8118e8a1e2f191a5d0a4bf596da1ad9cc84f884d8bc7dea8bd7b9fc3f8f1bddd3fd41c6eb017e1e804044b3bf084df1ed9e6e095e2d ld-bfd-mips.patch 70ec22bd72ef6dddecfd970613387dd4a8cdc8730dd3cbf03d5a0c3a7c4d839383167bb06dad21bf7c235329fd44b5dc4aefe762f68544f17155cf002bf1be4a 0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch 609cd90d8b334eb309f586b17b9d335a08d3dbb6def7c3eb5c010028fcb681674031e5b9d853aa7a39a50304356a86afc184b85562b3f228f8197f4d29395c8f binutils-mips-disable-assert.patch +27ea91e0e406e2ed464fd692cf92a07e338781789f2d968c8b95d9d5545985056a6f7f500df3952e5ab42165db28b741aa33d6b717e880b11a2e41fe406b13c4 binutils-ppc-fix-machine-options.patch " diff --git a/cross/binutils-armv7/binutils-ppc-fix-machine-options.patch b/cross/binutils-armv7/binutils-ppc-fix-machine-options.patch new file mode 100644 index 000000000..703ecf98a --- /dev/null +++ b/cross/binutils-armv7/binutils-ppc-fix-machine-options.patch @@ -0,0 +1,41 @@ +Fix for DARN opcode error during ppc64le compilation of rng-tools which +occurs with binutils 2.38 but not with binutils 2.37.. + +https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=cebc89b9328;hp=9cbed90ee623d75e31994e7943960c997ba565f2 + + +diff -aur a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c +--- a/gas/config/tc-ppc.c ++++ b/gas/config/tc-ppc.c +@@ -5965,7 +5965,30 @@ + options do not count as a new machine, instead they add + to currently selected opcodes. */ + ppc_cpu_t machine_sticky = 0; +- new_cpu = ppc_parse_cpu (ppc_cpu, &machine_sticky, cpu_string); ++ /* Unfortunately, some versions of gcc emit a .machine ++ directive very near the start of the compiler's assembly ++ output file. This is bad because it overrides user -Wa ++ cpu selection. Worse, there are versions of gcc that ++ emit the *wrong* cpu, not even respecting the -mcpu given ++ to gcc. See gcc pr101393. And to compound the problem, ++ as of 20220222 gcc doesn't pass the correct cpu option to ++ gas on the command line. See gcc pr59828. Hack around ++ this by keeping sticky options for an early .machine. */ ++ asection *sec; ++ for (sec = stdoutput->sections; sec != NULL; sec = sec->next) ++ { ++ segment_info_type *info = seg_info (sec); ++ /* Are the frags for this section perturbed from their ++ initial state? Even .align will count here. */ ++ if (info != NULL ++ && (info->frchainP->frch_root != info->frchainP->frch_last ++ || info->frchainP->frch_root->fr_type != rs_fill ++ || info->frchainP->frch_root->fr_fix != 0)) ++ break; ++ } ++ new_cpu = ppc_parse_cpu (ppc_cpu, ++ sec == NULL ? &sticky : &machine_sticky, ++ cpu_string); + if (new_cpu != 0) + ppc_cpu = new_cpu; + else