Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michel Lind <salimma@fedoraproject.org> |
| 3 | Date: Tue, 30 Jan 2024 04:14:31 -0600 |
| 4 | Subject: [PATCH] Fix building on x86_64 with binutils 2.41 |
| 5 | |
| 6 | Newer versions of the GNU assembler (observed with binutils 2.41) will |
| 7 | complain about the ".arch i386" in files assembled with "as --64", |
| 8 | with the message "Error: 64bit mode not supported on 'i386'". |
| 9 | |
| 10 | Fix by moving ".arch i386" below the relevant ".code32" directive, so |
| 11 | that the assembler is no longer expecting 64-bit instructions to be used |
| 12 | by the time that the ".arch i386" directive is encountered. |
| 13 | |
| 14 | Based on similar iPXE fix: |
| 15 | https://github.com/ipxe/ipxe/commit/6ca597eee |
| 16 | |
| 17 | Signed-off-by: Michel Lind <michel@michel-slm.name> |
| 18 | Signed-off-by: Simon Horman <horms@kernel.org> |
| 19 | |
| 20 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?h=main&id=328de8e00e298f00d7ba6b25dc3950147e9642e6] |
| 21 | Signed-off-by: Yoann Congal <yoann.congal@smile.fr> |
| 22 | --- |
| 23 | purgatory/arch/i386/entry32-16-debug.S | 2 +- |
| 24 | purgatory/arch/i386/entry32-16.S | 2 +- |
| 25 | purgatory/arch/i386/entry32.S | 2 +- |
| 26 | purgatory/arch/i386/setup-x86.S | 2 +- |
| 27 | 4 files changed, 4 insertions(+), 4 deletions(-) |
| 28 | |
| 29 | diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S |
| 30 | index 5167944..12e1164 100644 |
| 31 | --- a/purgatory/arch/i386/entry32-16-debug.S |
| 32 | +++ b/purgatory/arch/i386/entry32-16-debug.S |
| 33 | @@ -25,10 +25,10 @@ |
| 34 | .globl entry16_debug_pre32 |
| 35 | .globl entry16_debug_first32 |
| 36 | .globl entry16_debug_old_first32 |
| 37 | - .arch i386 |
| 38 | .balign 16 |
| 39 | entry16_debug: |
| 40 | .code32 |
| 41 | + .arch i386 |
| 42 | /* Compute where I am running at (assumes esp valid) */ |
| 43 | call 1f |
| 44 | 1: popl %ebx |
| 45 | diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S |
| 46 | index c051aab..eace095 100644 |
| 47 | --- a/purgatory/arch/i386/entry32-16.S |
| 48 | +++ b/purgatory/arch/i386/entry32-16.S |
| 49 | @@ -20,10 +20,10 @@ |
| 50 | #undef i386 |
| 51 | .text |
| 52 | .globl entry16, entry16_regs |
| 53 | - .arch i386 |
| 54 | .balign 16 |
| 55 | entry16: |
| 56 | .code32 |
| 57 | + .arch i386 |
| 58 | /* Compute where I am running at (assumes esp valid) */ |
| 59 | call 1f |
| 60 | 1: popl %ebx |
| 61 | diff --git a/purgatory/arch/i386/entry32.S b/purgatory/arch/i386/entry32.S |
| 62 | index f7a494f..8ce9e31 100644 |
| 63 | --- a/purgatory/arch/i386/entry32.S |
| 64 | +++ b/purgatory/arch/i386/entry32.S |
| 65 | @@ -20,10 +20,10 @@ |
| 66 | #undef i386 |
| 67 | |
| 68 | .text |
| 69 | - .arch i386 |
| 70 | .globl entry32, entry32_regs |
| 71 | entry32: |
| 72 | .code32 |
| 73 | + .arch i386 |
| 74 | |
| 75 | /* Setup a gdt that should that is generally usefully */ |
| 76 | lgdt %cs:gdt |
| 77 | diff --git a/purgatory/arch/i386/setup-x86.S b/purgatory/arch/i386/setup-x86.S |
| 78 | index 201bb2c..a212eed 100644 |
| 79 | --- a/purgatory/arch/i386/setup-x86.S |
| 80 | +++ b/purgatory/arch/i386/setup-x86.S |
| 81 | @@ -21,10 +21,10 @@ |
| 82 | #undef i386 |
| 83 | |
| 84 | .text |
| 85 | - .arch i386 |
| 86 | .globl purgatory_start |
| 87 | purgatory_start: |
| 88 | .code32 |
| 89 | + .arch i386 |
| 90 | |
| 91 | /* Load a gdt so I know what the segment registers are */ |
| 92 | lgdt %cs:gdt |
| 93 | -- |
| 94 | 2.39.2 |
| 95 | |