From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWgOQ-0000wt-HR for qemu-devel@nongnu.org; Mon, 08 Aug 2016 04:58:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWgOL-0006Xb-G0 for qemu-devel@nongnu.org; Mon, 08 Aug 2016 04:58:42 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWgOL-0006XU-9r for qemu-devel@nongnu.org; Mon, 08 Aug 2016 04:58:37 -0400 Received: by mail-wm0-x244.google.com with SMTP id x83so14081057wma.3 for ; Mon, 08 Aug 2016 01:58:36 -0700 (PDT) Sender: Paolo Bonzini References: <20160805082421.21994-1-marcandre.lureau@redhat.com> <20160805082421.21994-2-marcandre.lureau@redhat.com> From: Paolo Bonzini Message-ID: <07edc948-34b0-c61b-2ae7-4761ba3c25ca@redhat.com> Date: Mon, 8 Aug 2016 10:58:33 +0200 MIME-Version: 1.0 In-Reply-To: <20160805082421.21994-2-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH for-2.7 v4 01/36] build-sys: fix building with make CFLAGS=.. argument List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Cc: armbru@redhat.com On 05/08/2016 10:23, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > 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 > Reviewed-by: Paolo Bonzini Applying this patch for 2.7. Paolo > --- > 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, >