From e57218b6ed9d8e45585eea8fe1dc49068f51a1d2 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Mon, 8 Aug 2016 17:11:28 +0100 Subject: pc-bios/optionrom: Fix OpenBSD build with better detection of linker emulation The various host OSes are irritatingly variable about the name of the linker emulation we need to pass to ld's -m option to build the i386 option ROMs. Instead of doing this via a CONFIG ifdef, check in configure whether any of the emulation names we know about will work and pass the right answer through to the makefile. If we can't find one, we fall back to not trying to build the option ROMs, in the same way we would for a non-x86 host platform. This is in particular necessary to unbreak the build on OpenBSD, since it wants a different answer to FreeBSD and we don't have an existing CONFIG_ variable that distinguishes the two. Signed-off-by: Peter Maydell Reviewed-by: Sean Bruno Message-id: 1470672688-6754-1-git-send-email-peter.maydell@linaro.org --- pc-bios/optionrom/Makefile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'pc-bios/optionrom') diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 8aef152262..9bdc49798c 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -48,18 +48,8 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin %.o: %.S $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@," AS $(TARGET_DIR)$@") -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) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<," Building $(TARGET_DIR)$@") + $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<," Building $(TARGET_DIR)$@") %.raw: %.img $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@") -- cgit v1.2.3-55-g7522