summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2022-02-26 18:33:36 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2022-02-27 01:48:50 +0100
commit5e69c04c6e5557f5bb45850e06fb2a1d747a6f9d (patch)
tree8851354fa330fe58801142c70ad88b587ab2fa26
parentd7daffed366df1f70d5dd3d344f40f9fbe45ed08 (diff)
binutils: default to 2.38
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
-rw-r--r--target/config/Config.in.binutils2
-rw-r--r--toolchain/binutils/patches/2.38/0001-binutils-2.38-vs.-ppc32-linux-kernel.patch55
-rw-r--r--toolchain/gcc/patches/11.2.0/revert.sparc (renamed from toolchain/gcc/patches/11.2.0/revert-sparc.patch)0
3 files changed, 56 insertions, 1 deletions
diff --git a/target/config/Config.in.binutils b/target/config/Config.in.binutils
index af46e6ec2..1ccec16e5 100644
--- a/target/config/Config.in.binutils
+++ b/target/config/Config.in.binutils
@@ -7,7 +7,7 @@ default ADK_TOOLCHAIN_BINUTILS_ARC if ADK_TARGET_ARCH_ARC
default ADK_TOOLCHAIN_BINUTILS_AVR32 if ADK_TARGET_ARCH_AVR32
default ADK_TOOLCHAIN_BINUTILS_KVX if ADK_TARGET_ARCH_KVX
default ADK_TOOLCHAIN_BINUTILS_2_28 if ADK_TARGET_CPU_SH_J2
-default ADK_TOOLCHAIN_BINUTILS_2_37
+default ADK_TOOLCHAIN_BINUTILS_2_38
config ADK_TOOLCHAIN_BINUTILS_GIT
bool "git"
diff --git a/toolchain/binutils/patches/2.38/0001-binutils-2.38-vs.-ppc32-linux-kernel.patch b/toolchain/binutils/patches/2.38/0001-binutils-2.38-vs.-ppc32-linux-kernel.patch
new file mode 100644
index 000000000..c62652c95
--- /dev/null
+++ b/toolchain/binutils/patches/2.38/0001-binutils-2.38-vs.-ppc32-linux-kernel.patch
@@ -0,0 +1,55 @@
+From ed9b2e40ebffec835d63473367da8dd8f80d7d5b Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Mon, 21 Feb 2022 10:58:57 +1030
+Subject: [PATCH] binutils 2.38 vs. ppc32 linux kernel
+
+Commit b25f942e18d6 made .machine more strict. Weaken it again.
+
+ * config/tc-ppc.c (ppc_machine): Treat an early .machine specially,
+ keeping sticky options to work around gcc bugs.
+
+(cherry picked from commit cebc89b9328eab994f6b0314c263f94e7949a553)
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ gas/config/tc-ppc.c | 25 ++++++++++++++++++++++++-
+ 1 file changed, 24 insertions(+), 1 deletion(-)
+
+diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
+index 054f9c72161..89bc7d3f9b9 100644
+--- a/gas/config/tc-ppc.c
++++ b/gas/config/tc-ppc.c
+@@ -5965,7 +5965,30 @@ ppc_machine (int ignore ATTRIBUTE_UNUSED)
+ 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
+--
+2.30.2
+
diff --git a/toolchain/gcc/patches/11.2.0/revert-sparc.patch b/toolchain/gcc/patches/11.2.0/revert.sparc
index 2ce948c82..2ce948c82 100644
--- a/toolchain/gcc/patches/11.2.0/revert-sparc.patch
+++ b/toolchain/gcc/patches/11.2.0/revert.sparc