aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-08-05 12:23:46 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2016-08-09 22:57:36 +0200
commita9c87304b76d1d61687d585516abb4c6e0ae809e (patch)
tree8f905531a471b18efe4eafb9c7437a47dc669220 /Makefile
parent7f2569246c81d5f88e74c142b8fbdc0ee601bffe (diff)
build-sys: fix building with make CFLAGS=.. argument
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> Message-Id: <20160805082421.21994-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 0d7647f796..50b4b3afb9 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))