On 22/08/2016 18:44, Thomas Hanson wrote: > On 22 August 2016 at 08:23, Peter Maydell <peter.mayd...@linaro.org > <mailto:peter.mayd...@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 --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