qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, eblake@redhat.com, armbru@redhat.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH for-2.7 v4 01/36] build-sys: fix building with make CFLAGS=.. argument
Date: Fri,  5 Aug 2016 12:23:46 +0400	[thread overview]
Message-ID: <20160805082421.21994-2-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20160805082421.21994-1-marcandre.lureau@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

When calling make with a CFLAGS=.. argument, the -g/-O filter is not
applied, which may result with build failure with ASAN for example. It
could be solved with an 'override' directive on CFLAGS, but that would
actually prevent setting different CFLAGS manually.

Instead, filter the CFLAGS argument from the top-level Makefile (so
you could still call make with a different CFLAGS argument on a
rom/Makefile manually)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile                   | 3 ++-
 pc-bios/optionrom/Makefile | 2 --
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 0d7647f..50b4b3a 100644
--- a/Makefile
+++ b/Makefile
@@ -225,8 +225,9 @@ dtc/%:
 $(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
 
 ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
+# Only keep -O and -g cflags
 romsubdir-%:
-	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
+	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/" CFLAGS="$(filter -O% -g%,$(CFLAGS))",)
 
 ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
 
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 24e175e..6bab490 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -24,8 +24,6 @@ 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,
-- 
2.9.0

  reply	other threads:[~2016-08-05  8:24 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05  8:23 [Qemu-devel] [PATCH for-2.7 v4 00/36] Various memory leak fixes marcandre.lureau
2016-08-05  8:23 ` marcandre.lureau [this message]
2016-08-08  8:58   ` [Qemu-devel] [PATCH for-2.7 v4 01/36] build-sys: fix building with make CFLAGS=.. argument Paolo Bonzini
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 02/36] tests: fix test-qga leaks marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 03/36] glib-compat: add g_(s)list_free_full() marcandre.lureau
2016-08-05 11:25   ` Markus Armbruster
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 04/36] qga: free the whole blacklist marcandre.lureau
2016-08-05 11:25   ` Markus Armbruster
2016-08-05 16:57     ` Eric Blake
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 05/36] qga: free remaining leaking state marcandre.lureau
2016-08-05 11:26   ` Markus Armbruster
2016-08-05 16:56     ` Eric Blake
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 06/36] tests: fix test-cutils leaks marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 07/36] tests: fix test-vmstate leaks marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 08/36] tests: fix test-iov leaks marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 09/36] tests: fix check-qom-interface leaks marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 10/36] tests: fix check-qom-proplist leaks marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 11/36] tests: fix small leak in test-io-channel-command marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 12/36] tests: fix leak in test-string-input-visitor marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 13/36] portio: keep references on portio marcandre.lureau
2016-08-05  8:23 ` [Qemu-devel] [PATCH for-2.7 v4 14/36] numa: do not leak NumaOptions marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 15/36] pc: simplify passing qemu_irq marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 16/36] pc: don't leak a20_line marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 17/36] machine: use class base init generated name marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 18/36] acpi-build: fix array leak marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 19/36] char: free the tcp connection data when closing marcandre.lureau
2016-08-05 10:04   ` Paolo Bonzini
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 20/36] char: free MuxDriver " marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 21/36] tests: fix qom-test leaks marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 22/36] pc: free i8259 marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 23/36] pc: keep gsi reference marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 24/36] ahci: free irqs array marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 25/36] sd: free timer marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 26/36] qjson: free str marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 27/36] virtio-input: free config list marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 28/36] ipmi: free extern timer marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 29/36] usb: free USBDevice.strings marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 30/36] usb: free leaking path marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 31/36] bus: simplify name handling marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 32/36] tests: add qtest_add_data_func_full marcandre.lureau
2016-08-05 11:29   ` Markus Armbruster
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 33/36] tests: pc-cpu-test leaks fixes marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 34/36] tests: fix rsp leak in postcopy-test marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 35/36] ahci: fix sglist leak on retry marcandre.lureau
2016-08-05  8:24 ` [Qemu-devel] [PATCH for-2.7 v4 36/36] tests: fix postcopy-test leaks marcandre.lureau
2016-08-05  8:40 ` [Qemu-devel] [PATCH for-2.7 v4 00/36] Various memory leak fixes Daniel P. Berrange
2016-08-05 18:01 ` Marc-André Lureau
2016-08-07 19:15   ` Peter Maydell
2016-08-07 19:31     ` Marc-André Lureau
2016-08-07 19:38       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160805082421.21994-2-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).