Skip to contentSkip to conversation

pc-bios/optionrom: Use 32-bit linker emulation for the optionroms

PATCH In review Thomas Huth 4 participants 4 messages Jan 21 – Jan 28

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pc-bios/optionrom: Use 32-bit linker emulation for the optionroms

From: Thomas Huth <[email protected]>

Without this linker flag, the linking fails on NetBSD v10.1 with:

ld: i386 architecture of input file `multiboot.o' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `multiboot_dma.o' is incompatible with i386:x86-64 output

---
 pc-bios/optionrom/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/optionrom/Makefile +1 -1
index 30d07026c79..e6674a76e73 100644
@@ -36,7 +36,7 @@ config-cc.mak: Makefile
 	    $(call cc-option,-Wno-array-bounds)) 3> config-cc.mak
 -include config-cc.mak
 
-override LDFLAGS = -nostdlib -Wl,--build-id=none,-T,$(SRC_DIR)/flat.lds
+override LDFLAGS = -nostdlib -Wl,--build-id=none,-T,$(SRC_DIR)/flat.lds,-m,elf_i386
 
 pvh.img: pvh.o pvh_main.o
 
Signature · 1 line
2.52.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Thomas Huth

From: Thomas Huth <[email protected]>

Without this linker flag, the linking fails on NetBSD v10.1 with:

ld: i386 architecture of input file `multiboot.o' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `multiboot_dma.o' is incompatible with i386:x86-64 output

---
  pc-bios/optionrom/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/optionrom/Makefile +0 -0
index 30d07026c79..e6674a76e73 100644

pc-bios/optionrom/Makefile config-cc.mak: Makefile · line 42

Quoted 8 lines
pc-bios/optionrom/Makefile +1 -1
@@ -36,7 +36,7 @@ config-cc.mak: Makefile
  	    $(call cc-option,-Wno-array-bounds)) 3> config-cc.mak
  -include config-cc.mak
 
-override LDFLAGS = -nostdlib -Wl,--build-id=none,-T,$(SRC_DIR)/flat.lds
+override LDFLAGS = -nostdlib -Wl,--build-id=none,-T,$(SRC_DIR)/flat.lds,-m,elf_i386
 
  pvh.img: pvh.o pvh_main.o
 

r~

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

From: Thomas Huth <[email protected]>

Without this linker flag, the linking fails on NetBSD v10.1 with:

ld: i386 architecture of input file `multiboot.o' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `multiboot_dma.o' is incompatible with i386:x86-64 output

---
  pc-bios/optionrom/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
#3 lore raw
In reply to Thomas Huth
Quoted 6 lines · Thomas Huth

From: Thomas Huth <[email protected]>

Without this linker flag, the linking fails on NetBSD v10.1 with:

ld: i386 architecture of input file `multiboot.o' is incompatible with i386:x86-64 output
ld: i386 architecture of input file `multiboot_dma.o' is incompatible with i386:x86-64 output

I'm picking this up for stable series too.
Please let me know if I shouldn't.

Thanks,

/mjt