From f441e63de9d34631ad90d062239fe7cae0b7c996 Mon Sep 17 00:00:00 2001 From: Yoann Congal Date: Wed, 14 Feb 2024 00:03:01 +0100 Subject: kexec-tools: Replace a submitted patch by the backported one This replaces "kexec-tools: purgatory: fix build on `binutils-2.42`" (Submitted upstream) by "Fix building on x86_64 with binutils 2.41" (which was actually merged). Upstream maintainers found the second patch more complete [0]. [0]: https://lore.kernel.org/all/ZbopWV9qrxMME2hU@MiWiFi-R3L-srv/T/ (From OE-Core rev: 704523a383d6a7f5fa46348010e9676b4e828331) Signed-off-by: Yoann Congal Signed-off-by: Richard Purdie --- ...ools-purgatory-fix-build-on-binutils-2.42.patch | 59 -------------- ...Fix-building-on-x86_64-with-binutils-2.41.patch | 95 ++++++++++++++++++++++ meta/recipes-kernel/kexec/kexec-tools_2.0.28.bb | 2 +- 3 files changed, 96 insertions(+), 60 deletions(-) delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-kexec-tools-purgatory-fix-build-on-binutils-2.42.patch create mode 100644 meta/recipes-kernel/kexec/kexec-tools/Fix-building-on-x86_64-with-binutils-2.41.patch (limited to 'meta/recipes-kernel') diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-kexec-tools-purgatory-fix-build-on-binutils-2.42.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-kexec-tools-purgatory-fix-build-on-binutils-2.42.patch deleted file mode 100644 index 6104a29d71..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0001-kexec-tools-purgatory-fix-build-on-binutils-2.42.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 2cdbb12f4b101c7ecb3a4791819d9269d4f07c19 Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich -Date: Wed, 31 Jan 2024 10:05:08 +0000 -Subject: [PATCH] kexec-tools: purgatory: fix build on `binutils-2.42` - -`binutils-2.42` introduced stricter checks on what `.arch` can be used -in 64-bit mode and started failing the build as: - - $ as-2.42 --64 -o entry32-16-debug.o entry32-16-debug.s - purgatory/arch/i386/entry32-16-debug.S: Assembler messages: - purgatory/arch/i386/entry32-16-debug.S:28: Error: 64bit mode not supported on `i386'. - -The change moves `.code32` before `.arch 386` as suggested in -https://sourceware.org/PR31319 - -Upstream-Status: Submitted [https://lore.kernel.org/all/ZbopWV9qrxMME2hU@MiWiFi-R3L-srv/T/] -Signed-off-by: Sergei Trofimovich -Reviewed-by: Baoquan He -Signed-off-by: Khem Raj ---- - purgatory/arch/i386/entry32-16-debug.S | 2 +- - purgatory/arch/i386/entry32-16.S | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S -index 5167944..297d6f5 100644 ---- a/purgatory/arch/i386/entry32-16-debug.S -+++ b/purgatory/arch/i386/entry32-16-debug.S -@@ -25,10 +25,10 @@ - .globl entry16_debug_pre32 - .globl entry16_debug_first32 - .globl entry16_debug_old_first32 -+ .code32 - .arch i386 - .balign 16 - entry16_debug: -- .code32 - /* Compute where I am running at (assumes esp valid) */ - call 1f - 1: popl %ebx -diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S -index c051aab..7a84565 100644 ---- a/purgatory/arch/i386/entry32-16.S -+++ b/purgatory/arch/i386/entry32-16.S -@@ -20,10 +20,10 @@ - #undef i386 - .text - .globl entry16, entry16_regs -+ .code32 - .arch i386 - .balign 16 - entry16: -- .code32 - /* Compute where I am running at (assumes esp valid) */ - call 1f - 1: popl %ebx --- -2.43.0 - diff --git a/meta/recipes-kernel/kexec/kexec-tools/Fix-building-on-x86_64-with-binutils-2.41.patch b/meta/recipes-kernel/kexec/kexec-tools/Fix-building-on-x86_64-with-binutils-2.41.patch new file mode 100644 index 0000000000..4894f044fc --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools/Fix-building-on-x86_64-with-binutils-2.41.patch @@ -0,0 +1,95 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Michel Lind +Date: Tue, 30 Jan 2024 04:14:31 -0600 +Subject: [PATCH] Fix building on x86_64 with binutils 2.41 + +Newer versions of the GNU assembler (observed with binutils 2.41) will +complain about the ".arch i386" in files assembled with "as --64", +with the message "Error: 64bit mode not supported on 'i386'". + +Fix by moving ".arch i386" below the relevant ".code32" directive, so +that the assembler is no longer expecting 64-bit instructions to be used +by the time that the ".arch i386" directive is encountered. + +Based on similar iPXE fix: +https://github.com/ipxe/ipxe/commit/6ca597eee + +Signed-off-by: Michel Lind +Signed-off-by: Simon Horman + +Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?h=main&id=328de8e00e298f00d7ba6b25dc3950147e9642e6] +Signed-off-by: Yoann Congal +--- + purgatory/arch/i386/entry32-16-debug.S | 2 +- + purgatory/arch/i386/entry32-16.S | 2 +- + purgatory/arch/i386/entry32.S | 2 +- + purgatory/arch/i386/setup-x86.S | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S +index 5167944..12e1164 100644 +--- a/purgatory/arch/i386/entry32-16-debug.S ++++ b/purgatory/arch/i386/entry32-16-debug.S +@@ -25,10 +25,10 @@ + .globl entry16_debug_pre32 + .globl entry16_debug_first32 + .globl entry16_debug_old_first32 +- .arch i386 + .balign 16 + entry16_debug: + .code32 ++ .arch i386 + /* Compute where I am running at (assumes esp valid) */ + call 1f + 1: popl %ebx +diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S +index c051aab..eace095 100644 +--- a/purgatory/arch/i386/entry32-16.S ++++ b/purgatory/arch/i386/entry32-16.S +@@ -20,10 +20,10 @@ + #undef i386 + .text + .globl entry16, entry16_regs +- .arch i386 + .balign 16 + entry16: + .code32 ++ .arch i386 + /* Compute where I am running at (assumes esp valid) */ + call 1f + 1: popl %ebx +diff --git a/purgatory/arch/i386/entry32.S b/purgatory/arch/i386/entry32.S +index f7a494f..8ce9e31 100644 +--- a/purgatory/arch/i386/entry32.S ++++ b/purgatory/arch/i386/entry32.S +@@ -20,10 +20,10 @@ + #undef i386 + + .text +- .arch i386 + .globl entry32, entry32_regs + entry32: + .code32 ++ .arch i386 + + /* Setup a gdt that should that is generally usefully */ + lgdt %cs:gdt +diff --git a/purgatory/arch/i386/setup-x86.S b/purgatory/arch/i386/setup-x86.S +index 201bb2c..a212eed 100644 +--- a/purgatory/arch/i386/setup-x86.S ++++ b/purgatory/arch/i386/setup-x86.S +@@ -21,10 +21,10 @@ + #undef i386 + + .text +- .arch i386 + .globl purgatory_start + purgatory_start: + .code32 ++ .arch i386 + + /* Load a gdt so I know what the segment registers are */ + lgdt %cs:gdt +-- +2.39.2 + diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.28.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.28.bb index 4471cdf21e..dec821ea88 100644 --- a/meta/recipes-kernel/kexec/kexec-tools_2.0.28.bb +++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.28.bb @@ -17,7 +17,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz file://0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \ file://0005-Disable-PIE-during-link.patch \ file://0001-arm64-kexec-disabled-check-if-kaslr-seed-dtb-propert.patch \ - file://0001-kexec-tools-purgatory-fix-build-on-binutils-2.42.patch \ + file://Fix-building-on-x86_64-with-binutils-2.41.patch \ " SRC_URI[sha256sum] = "f33d2660b3e38d25a127e87097978e0f7a9a73ab5151a29eb80974d169ff6a29" -- cgit v1.2.3-54-g00ecf