0001-Fix-building-on-x86_64-with-binutils-2-41.patch 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. From 328de8e00e298f00d7ba6b25dc3950147e9642e6 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: Fix building on x86_64 with binutils 2.41
  5. Newer versions of the GNU assembler (observed with binutils 2.41) will
  6. complain about the ".arch i386" in files assembled with "as --64",
  7. with the message "Error: 64bit mode not supported on 'i386'".
  8. Fix by moving ".arch i386" below the relevant ".code32" directive, so
  9. that the assembler is no longer expecting 64-bit instructions to be used
  10. by the time that the ".arch i386" directive is encountered.
  11. Based on similar iPXE fix:
  12. https://github.com/ipxe/ipxe/commit/6ca597eee
  13. Signed-off-by: Michel Lind <michel@michel-slm.name>
  14. Signed-off-by: Simon Horman <horms@kernel.org>
  15. Upstream: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=328de8e00e298f00d7ba6b25dc3950147e9642e6
  16. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  17. ---
  18. purgatory/arch/i386/entry32-16-debug.S | 2 +-
  19. purgatory/arch/i386/entry32-16.S | 2 +-
  20. purgatory/arch/i386/entry32.S | 2 +-
  21. purgatory/arch/i386/setup-x86.S | 2 +-
  22. 4 files changed, 4 insertions(+), 4 deletions(-)
  23. diff --git a/purgatory/arch/i386/entry32-16-debug.S b/purgatory/arch/i386/entry32-16-debug.S
  24. index 5167944d..12e11649 100644
  25. --- a/purgatory/arch/i386/entry32-16-debug.S
  26. +++ b/purgatory/arch/i386/entry32-16-debug.S
  27. @@ -25,10 +25,10 @@
  28. .globl entry16_debug_pre32
  29. .globl entry16_debug_first32
  30. .globl entry16_debug_old_first32
  31. - .arch i386
  32. .balign 16
  33. entry16_debug:
  34. .code32
  35. + .arch i386
  36. /* Compute where I am running at (assumes esp valid) */
  37. call 1f
  38. 1: popl %ebx
  39. diff --git a/purgatory/arch/i386/entry32-16.S b/purgatory/arch/i386/entry32-16.S
  40. index c051aab0..eace0958 100644
  41. --- a/purgatory/arch/i386/entry32-16.S
  42. +++ b/purgatory/arch/i386/entry32-16.S
  43. @@ -20,10 +20,10 @@
  44. #undef i386
  45. .text
  46. .globl entry16, entry16_regs
  47. - .arch i386
  48. .balign 16
  49. entry16:
  50. .code32
  51. + .arch i386
  52. /* Compute where I am running at (assumes esp valid) */
  53. call 1f
  54. 1: popl %ebx
  55. diff --git a/purgatory/arch/i386/entry32.S b/purgatory/arch/i386/entry32.S
  56. index f7a494f1..8ce9e316 100644
  57. --- a/purgatory/arch/i386/entry32.S
  58. +++ b/purgatory/arch/i386/entry32.S
  59. @@ -20,10 +20,10 @@
  60. #undef i386
  61. .text
  62. - .arch i386
  63. .globl entry32, entry32_regs
  64. entry32:
  65. .code32
  66. + .arch i386
  67. /* Setup a gdt that should that is generally usefully */
  68. lgdt %cs:gdt
  69. diff --git a/purgatory/arch/i386/setup-x86.S b/purgatory/arch/i386/setup-x86.S
  70. index 201bb2cb..a212eed4 100644
  71. --- a/purgatory/arch/i386/setup-x86.S
  72. +++ b/purgatory/arch/i386/setup-x86.S
  73. @@ -21,10 +21,10 @@
  74. #undef i386
  75. .text
  76. - .arch i386
  77. .globl purgatory_start
  78. purgatory_start:
  79. .code32
  80. + .arch i386
  81. /* Load a gdt so I know what the segment registers are */
  82. lgdt %cs:gdt
  83. --
  84. cgit 1.2.3-korg