Skip to contentSkip to conversation

Unbreak FreeBSD build after optionrom update.

PATCH In review Sean Bruno 4 participants 7 messages Jul 25, 2016 – Sep 2, 2016

lore
Share & tools
lore

Sean Bruno

author
#0 lore raw

PATCH v2 1/1 Unbreak FreeBSD build after optionrom update.

Update the build flags appropriately for FreeBSD and add the correct LD_EMULATION type for the FreeBSD build case.

---
 pc-bios/optionrom/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
pc-bios/optionrom/Makefile +8 -0
index d88ce11..5cf7c93 100644
@@ -28,7 +28,11 @@ endif
 CFLAGS := $(filter -O% -g%, $(CFLAGS))
 QEMU_INCLUDES += -I$(SRC_PATH)
 
+ifdef CONFIG_BSD
+Wa = -Wa 
+else
 Wa = -Wa,
+endif
 ASFLAGS += -32
 QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), $(Wa)-32)
 
@@ -44,8 +48,12 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin
 ifdef CONFIG_WIN32
 LD_EMULATION = i386pe
 else
+ifdef CONFIG_BSD
+LD_EMULATION = elf_i386_fbsd
+else
 LD_EMULATION = elf_i386
 endif
+endif
 
 %.img: %.o
 	$(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_EMULATION) -Ttext 0 -e _start -s -o $@ $<,"  Building $(TARGET_DIR)$@")
Signature · 1 line
2.8.4
#1 lore raw

[Qemu-devel] R: [PATCH v2] Unbreak FreeBSD build after optionrom update.

Quoted 5 lines

Update the build flags appropriately for FreeBSD and add the correct LD_EMULATION type for the FreeBSD build case.

I posted the right fix a couple days ago, but didn't manage to send a pull request before leaving and I am on mobile until next Monday.

Search the archive for cc-c-option to get the right fix.

Also, the commit message for a build fix patch really should include the error message, so please do that even if your v3 only includes the change to the emulation name.

Thanks,

Paolo

Quoted 36 lines
---
 pc-bios/optionrom/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
pc-bios/optionrom/Makefile +8 -0
index d88ce11..5cf7c93 100644
@@ -28,7 +28,11 @@ endif
 CFLAGS := $(filter -O% -g%, $(CFLAGS))
 QEMU_INCLUDES += -I$(SRC_PATH)
 
+ifdef CONFIG_BSD
+Wa = -Wa 
+else
 Wa = -Wa,
+endif
 ASFLAGS += -32
 QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), $(Wa)-32)
 
@@ -44,8 +48,12 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin
 ifdef CONFIG_WIN32
 LD_EMULATION = i386pe
 else
+ifdef CONFIG_BSD
+LD_EMULATION = elf_i386_fbsd
+else
 LD_EMULATION = elf_i386
 endif
+endif
 
 %.img: %.o
 	$(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_EMULATION) -Ttext 0 -e _start -s -o $@ $<,"  Building $(TARGET_DIR)$@")
Signature · 1 line
2.8.4
author
#2 lore raw

Re: [Qemu-devel] R: [PATCH v2] Unbreak FreeBSD build after optionrom update.

Quoted 8 lines · Paolo Bonzini
Quoted 5 lines

Update the build flags appropriately for FreeBSD and add the correct LD_EMULATION type for the FreeBSD build case.

I posted the right fix a couple days ago, but didn't manage to send a pull request before leaving and I am on mobile until next Monday.

Quoted 8 lines

Search the archive for cc-c-option to get the right fix.

Also, the commit message for a build fix patch really should include the error message, so please do that even if your v3 only includes the change to the emulation name.

Thanks,

Paolo

Paolo:

Thanks for the pointer to the right fix. Confirmed that your changes DTRT for FreeBSD.

I still need the LD_EMULATION addition, which I have sent to the list as a separate patch for review.

sean

#3 lore raw

Re: [Qemu-devel] R: [PATCH v2] Unbreak FreeBSD build after optionrom update.

Quoted 6 lines · Sean Bruno

Thanks for the pointer to the right fix. Confirmed that your changes DTRT for FreeBSD.

I still need the LD_EMULATION addition, which I have sent to the list as a separate patch for review.

Great, thanks!

Paolo

#4 lore raw

Re: [Qemu-devel] R: [PATCH v2] Unbreak FreeBSD build after optionrom update.

Quoted 7 lines · Paolo Bonzini
Quoted 4 lines · Sean Bruno

Thanks for the pointer to the right fix. Confirmed that your changes DTRT for FreeBSD.

Quoted 6 lines
Quoted 2 lines

I still need the LD_EMULATION addition, which I have sent to the list as a separate patch for review.

Great, thanks!

Paolo

This breaks the build on OpenBSD..

ld: unrecognised emulation mode: elf_i386_fbsd Supported emulations: elf_x86_64_obsd elf_i386_obsd elf_i386 gmake[1]: *** [Makefile:55: multiboot.img] Error 1

#5 lore raw

Re: [Qemu-devel] R: [PATCH v2] Unbreak FreeBSD build after optionrom update.

Quoted 5 lines · Brad Smith

This breaks the build on OpenBSD..

ld: unrecognised emulation mode: elf_i386_fbsd Supported emulations: elf_x86_64_obsd elf_i386_obsd elf_i386 gmake[1]: *** [Makefile:55: multiboot.img] Error 1

Sorry about that; I've just sent out a patch which I hope will fix this, but which will need testing on the BSDs.

thanks
-- PMM

#6 lore raw

Re: [Qemu-devel] R: [PATCH v2] Unbreak FreeBSD build after optionrom update.

In reply to Brad Smith
Quoted 5 lines · Brad Smith

This breaks the build on OpenBSD..

ld: unrecognised emulation mode: elf_i386_fbsd Supported emulations: elf_x86_64_obsd elf_i386_obsd elf_i386 gmake[1]: *** [Makefile:55: multiboot.img] Error 1

I'm looking at adding some BSD build tests to my set,
using the VMs in the GCC compile farm. However for
OpenBSD the compile farm has an OpenBSD 5.0 which fails configure:
ERROR: Your compiler does not support the __thread specifier for
Thread-Local Storage (TLS). Please upgrade to a version that does.

Is this just too old an OpenBSD?

thanks
-- PMM