diff mbox

QEMU make: ROM is too large

Message ID 07583a90-3a12-7f98-3e32-4a617d9b1842@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Aug. 30, 2016, 12:29 p.m. UTC
On 22/08/2016 18:44, Thomas Hanson wrote:
> On 22 August 2016 at 08:23, Peter Maydell <peter.maydell@linaro.org
> <mailto:peter.maydell@linaro.org>> wrote:
> 
>     PS: just passing --enable-debug to configure should
>     be sufficient to do a no-optimization debug-symbols
>     build; do you really need to manually specify
>     CFLAGS? I wonder whether you're ending up with two
>     -Osomething options in your CFLAGS which is then
>     confusing the "override with -O2" logic in the
>     pc-bios/optionrom/Makefile.

Yes, here is a patch to fix it:
diff mbox

Patch

diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 9bdc497..eb92d75 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -10,10 +10,7 @@  $(call set-vpath, $(SRC_PATH)/pc-bios/optionrom)
 .PHONY : all clean build-all
 
 # Compiling with no optimization creates ROMs that are too large
-ifeq ($(filter -O%, $(CFLAGS)),)
-override CFLAGS += -O2
-endif
-ifeq ($(filter -O%, $(CFLAGS)),-O0)
+ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0)
 override CFLAGS += -O2
 endif