diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-07-14 16:49:18 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-07-14 16:49:18 +0100 |
commit | 1c8e93fb41c1ee37853ff7b85ebe1218a4a43780 (patch) | |
tree | e1c580d9178fc918dc360ab8469e793333e53fde /pc-bios/optionrom/Makefile | |
parent | 22e28174ae423629e57b0d03f4bbf2d1bedcd58f (diff) | |
parent | b2a575a1c652904600869e774e45bf4c9ed72c55 (diff) |
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream-fwcfg' into staging
* Updated fw_cfg option ROM to include DMA support
# gpg: Signature made Thu 14 Jul 2016 14:51:06 BST
# gpg: using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg: aka "Paolo Bonzini <pbonzini@redhat.com>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1
# Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83
* remotes/bonzini/tags/for-upstream-fwcfg:
Add optionrom compatible with fw_cfg DMA version
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'pc-bios/optionrom/Makefile')
-rw-r--r-- | pc-bios/optionrom/Makefile | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 2cdda87f0e..d88ce119ce 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -9,22 +9,46 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/optionrom) .PHONY : all clean build-all -CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -CFLAGS += -I$(SRC_PATH) -CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector) -CFLAGS += $(CFLAGS_NOPIE) -QEMU_CFLAGS = $(CFLAGS) - -build-all: multiboot.bin linuxboot.bin kvmvapic.bin +# Drop -fstack-protector and the like +QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) $(CFLAGS_NOPIE) -ffreestanding +QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -m16) +ifeq ($(filter -m16, $(QEMU_CFLAGS)),) +# Attempt to work around compilers that lack -m16 (GCC <= 4.8, clang <= ??) +# On GCC we add -fno-toplevel-reorder to keep the order of asm blocks with +# respect to the rest of the code. clang does not have -fno-toplevel-reorder, +# but it places all asm blocks at the beginning and we're relying on it for +# the option ROM header. So just force clang not to use the integrated +# assembler, which doesn't support .code16gcc. +QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-toplevel-reorder) +QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -no-integrated-as) +QEMU_CFLAGS += -m32 -include $(SRC_PATH)/pc-bios/optionrom/code16gcc.h +endif + +# Drop gcov and glib flags +CFLAGS := $(filter -O% -g%, $(CFLAGS)) +QEMU_INCLUDES += -I$(SRC_PATH) + +Wa = -Wa, +ASFLAGS += -32 +QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), $(Wa)-32) + +build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin # suppress auto-removal of intermediate files .SECONDARY: + %.o: %.S - $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@," AS $(TARGET_DIR)$@") + $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@," AS $(TARGET_DIR)$@") + +ifdef CONFIG_WIN32 +LD_EMULATION = i386pe +else +LD_EMULATION = elf_i386 +endif %.img: %.o - $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@") + $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_EMULATION) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@") %.raw: %.img $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@") |