From f34364490461dd76add0bdfebc37aca154b861e2270e70171581ae3ab531041e Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 5 Feb 2024 16:58:24 +0000 Subject: [PATCH] - Add binutils-disable-code-arch-error.diff to demote an error about swapped .arch/.code directives to a warning. It happens in the wild. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=462 --- binutils-disable-code-arch-error.diff | 25 +++++++++++++++++++++++++ binutils.changes | 7 +++++++ binutils.spec | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 binutils-disable-code-arch-error.diff diff --git a/binutils-disable-code-arch-error.diff b/binutils-disable-code-arch-error.diff new file mode 100644 index 0000000..a721097 --- /dev/null +++ b/binutils-disable-code-arch-error.diff @@ -0,0 +1,25 @@ +Index: binutils-2.42/gas/config/tc-i386.c +=================================================================== +--- binutils-2.42.orig/gas/config/tc-i386.c 2024-01-29 01:00:00.000000000 +0100 ++++ binutils-2.42/gas/config/tc-i386.c 2024-02-05 17:54:33.515139672 +0100 +@@ -2992,13 +2992,17 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED + { + check_cpu_arch_compatible (string, cpu_arch[j].enable); + ++ /* XXX code in the wild calls 'as --64' (to generate ELF64), ++ but then does '.arch i386' first and only then '.code32' or ++ '.code16'. This checking here would require swapping these ++ two directives, so just warn for the time being. */ + if (flag_code == CODE_64BIT && !cpu_arch[j].enable.bitfield.cpu64 ) + { +- as_bad (_("64bit mode not supported on `%s'."), ++ as_warn (_("64bit mode not supported on `%s' (consider swapping .arch and .code directives)."), + cpu_arch[j].name); +- (void) restore_line_pointer (e); ++ /*(void) restore_line_pointer (e); + ignore_rest_of_line (); +- return; ++ return;*/ + } + + if (flag_code == CODE_32BIT && !cpu_arch[j].enable.bitfield.cpui386) diff --git a/binutils.changes b/binutils.changes index c587810..d31f6bb 100644 --- a/binutils.changes +++ b/binutils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Feb 5 16:57:05 UTC 2024 - Michael Matz + +- Add binutils-disable-code-arch-error.diff to demote an + error about swapped .arch/.code directives to a warning. + It happens in the wild. + ------------------------------------------------------------------- Tue Jan 30 13:52:11 UTC 2024 - Michael Matz diff --git a/binutils.spec b/binutils.spec index 3f786d4..47f57c8 100644 --- a/binutils.spec +++ b/binutils.spec @@ -153,6 +153,7 @@ Patch41: binutils-fix-relax.diff Patch42: binutils-compat-old-behaviour.diff Patch43: binutils-revert-hlasm-insns.diff Patch44: binutils-revert-rela.diff +Patch60: binutils-disable-code-arch-error.diff Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch Patch93: cross-avr-size.patch @@ -278,6 +279,7 @@ cp ld/ldgram.y ld/ldgram.y.orig %patch43 -p1 %patch44 -p1 %endif +%patch60 -p1 %if "%{TARGET}" == "avr" cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h %patch90