Skip to contentSkip to conversation

kexec-tools: purgatory: fix build on `binutils-2.42`

PATCH In review Sergei Trofimovich 4 participants 6 messages Jan 31, 2024 – Feb 4, 2024

Subsystems (2)
lore
Share & tools
lore
Reviewed-by on v1 1/1
#1 lore raw
In reply to Sergei Trofimovich
Quoted 9 lines · Sergei Trofimovich

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

I am not familiar with the gas behaviour, the fix sounds good from discussion in above link.

Quoted 42 lines
---
 purgatory/arch/i386/entry32-16-debug.S | 2 +-
 purgatory/arch/i386/entry32-16.S       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
purgatory/arch/i386/entry32-16-debug.S +1 -1
index 5167944..297d6f5 100644
@@ -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
purgatory/arch/i386/entry32-16.S +1 -1
index c051aab..7a84565 100644
@@ -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
Signature · 1 line
2.43.0

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#0 lore raw

PATCH 1/1 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

---
 purgatory/arch/i386/entry32-16-debug.S | 2 +-
 purgatory/arch/i386/entry32-16.S       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
purgatory/arch/i386/entry32-16-debug.S +1 -1
index 5167944..297d6f5 100644
@@ -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
purgatory/arch/i386/entry32-16.S +1 -1
index c051aab..7a84565 100644
@@ -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
Signature · 7 lines
2.43.0


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#2 lore raw
In reply to Baoquan He

Hi,

FYI, before this patch, Michel already sent "[PATCH] Fix building on x86_64 with binutils 2.41" to address the same issue. Currently I almost know nothing about assembly but Michel's patch seems to be more complete because two more
files are touched.

Quoted 59 lines · Baoquan He
Quoted 9 lines · Sergei Trofimovich

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

I am not familiar with the gas behaviour, the fix sounds good from discussion in above link.

Quoted 42 lines
---
 purgatory/arch/i386/entry32-16-debug.S | 2 +-
 purgatory/arch/i386/entry32-16.S       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
purgatory/arch/i386/entry32-16-debug.S +1 -1
index 5167944..297d6f5 100644
@@ -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
purgatory/arch/i386/entry32-16.S +1 -2
index c051aab..7a84565 100644
@@ -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

Signature · 8 lines
Best regards,
Coiby


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#3 lore raw
Quoted 7 lines · Coiby Xu

Hi,

FYI, before this patch, Michel already sent "[PATCH] Fix building on x86_64 with binutils 2.41" to address the same issue. Currently I almost know nothing about
assembly but Michel's patch seems to be more complete because two more files are touched.

Thanks for telling, I didn't notice that one. I didn't know these either, leave them to Sergei and Michel to decide what is the appropriate solution.

Quoted 53 lines · Baoquan He
Quoted 51 lines · Sergei Trofimovich
Quoted 9 lines

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

I am not familiar with the gas behaviour, the fix sounds good from discussion in above link.

Quoted 35 lines
---
 purgatory/arch/i386/entry32-16-debug.S | 2 +-
 purgatory/arch/i386/entry32-16.S       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
purgatory/arch/i386/entry32-16-debug.S +1 -1
index 5167944..297d6f5 100644
@@ -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
purgatory/arch/i386/entry32-16.S +1 -0
index c051aab..7a84565 100644
@@ -20,10 +20,10 @@
 #undef i386	
 	.text
 	.globl entry16, entry16_regs
+	.code32
 	.arch i386
 	.balign 16
 entry16:
Quoted 13 lines
Quoted 8 lines
Quoted 7 lines
purgatory/arch/i386/entry32-16.S +0 -2
-	.code32
 	/* Compute where I am running at (assumes esp valid) */
 	call	1f
 1:	popl	%ebx
--

2.43.0

Signature · 2 lines
Best regards,
Coiby

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#4 lore raw
Quoted 9 lines · Baoquan He
Quoted 7 lines · Coiby Xu

Hi,

FYI, before this patch, Michel already sent "[PATCH] Fix building on x86_64 with binutils 2.41" to address the same issue. Currently I almost know nothing about
assembly but Michel's patch seems to be more complete because two more files are touched.

Quoted 3 lines

Thanks for telling, I didn't notice that one. I didn't know these either, leave them to Sergei and Michel to decide what is the appropriate solution.

Hi,

I did go ahead and apply Michael's patch. Let's follow-up with incremental changes if necessary.

...

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw
Quoted 10 lines · Simon Horman
Quoted 9 lines · Baoquan He
Quoted 7 lines · Coiby Xu

Hi,

FYI, before this patch, Michel already sent "[PATCH] Fix building on x86_64 with binutils 2.41" to address the same issue. Currently I almost know nothing about
assembly but Michel's patch seems to be more complete because two more files are touched.

Quoted 8 lines
Quoted 3 lines

Thanks for telling, I didn't notice that one. I didn't know these either, leave them to Sergei and Michel to decide what is the appropriate solution.

Hi,

I did go ahead and apply Michael's patch. Let's follow-up with incremental changes if necessary.

Sounds great, thanks.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec