All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] optionrom: fix detection of -Wa,-32
@ 2016-07-20 19:36 Paolo Bonzini
  2016-07-29 13:22 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2016-07-20 19:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

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>
---
 pc-bios/optionrom/Makefile | 2 +-
 rules.mak                  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index d88ce11..72abb3c 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -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
 
diff --git a/rules.mak b/rules.mak
index ed8e482..99cd0b3 100644
--- 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)))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] optionrom: fix detection of -Wa,-32
  2016-07-20 19:36 [Qemu-devel] [PATCH] optionrom: fix detection of -Wa,-32 Paolo Bonzini
@ 2016-07-29 13:22 ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-07-29 13:22 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers, Stefan Hajnoczi

On 20 July 2016 at 20:36, Paolo Bonzini <pbonzini@redhat.com> wrote:
> 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>
> ---

Applied to master, thanks (since it fixes BSD builds).

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH] optionrom: fix detection of -Wa,-32
@ 2016-07-28 20:46 Sean Bruno
  0 siblings, 0 replies; 3+ messages in thread
From: Sean Bruno @ 2016-07-28 20:46 UTC (permalink / raw)
  To: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 166 bytes --]

http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg04839.html

If there is any way this can be pulled in, we FreeBSD nerds would
appreciate it.

sean


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 603 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-29 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-20 19:36 [Qemu-devel] [PATCH] optionrom: fix detection of -Wa,-32 Paolo Bonzini
2016-07-29 13:22 ` Peter Maydell
2016-07-28 20:46 Sean Bruno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.