]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
optionrom: fix detection of -Wa,-32
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Jul 2016 19:36:49 +0000 (21:36 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 29 Jul 2016 12:56:52 +0000 (13:56 +0100)
The cc-option macro runs $(CC) in -S mode (generate assembly) to avoid a
pointless run of the assembler.  However, this does not work when you want
to detect support for cc->as option passthrough.  clang ignores -Wa unless
-c is provided, and exits successfully even if the -Wa,-32 option is not
supported.

Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1469043409-14033-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
pc-bios/optionrom/Makefile
rules.mak

index d88ce119ce3dccc6be14d6b5aa251ce8389129c9..72abb3c9a02d9b3553dcd678e6a30ceb43a33f04 100644 (file)
@@ -30,7 +30,7 @@ QEMU_INCLUDES += -I$(SRC_PATH)
 
 Wa = -Wa,
 ASFLAGS += -32
-QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), $(Wa)-32)
+QEMU_CFLAGS += $(call cc-c-option, $(QEMU_CFLAGS), $(Wa)-32)
 
 build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin
 
index ed8e482780642616a9627faf196bad2dca3cf861..99cd0b3371c00396439a5100d7798c18e60c083b 100644 (file)
--- a/rules.mak
+++ b/rules.mak
@@ -113,6 +113,8 @@ quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))
 
 cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \
               >/dev/null 2>&1 && echo OK), $2, $3)
+cc-c-option = $(if $(shell $(CC) $1 $2 -c -o /dev/null -xc /dev/null \
+                >/dev/null 2>&1 && echo OK), $2, $3)
 
 VPATH_SUFFIXES = %.c %.h %.S %.cc %.cpp %.m %.mak %.texi %.sh %.rc
 set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1)))