diff mbox

[PULL,02/14] build-sys: fix building with make CFLAGS=.. argument

Message ID e908fe8e-1152-c046-4735-288bb308de12@de.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christian Borntraeger Aug. 15, 2016, 9:08 a.m. UTC
On 08/15/2016 10:41 AM, Christian Borntraeger wrote:
> On 08/10/2016 03:57 PM, Paolo Bonzini wrote:
>> 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>
>> Message-Id: <20160805082421.21994-2-marcandre.lureau@redhat.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> 
> This patch breaks the build on the s390-ccw.img bios if I enable
> --enable-debug
> 
[...]
> 
Something like 


seems to help. I need to double check...
diff mbox

Patch

--- a/pc-bios/s390-ccw/Makefile
+++ b/pc-bios/s390-ccw/Makefile
@@ -10,8 +10,10 @@  $(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw)
 .PHONY : all clean build-all
 
 OBJECTS = start.o main.o bootmap.o sclp-ascii.o virtio.o virtio-scsi.o
-CFLAGS += -fPIE -fno-stack-protector -ffreestanding -march=z900
-CFLAGS += -fno-delete-null-pointer-checks -msoft-float
+QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
+QEMU_CFLAGS := -ffreestanding -fno-delete-null-pointer-checks -msoft-float
+QEMU_CFLAGS := -march=z900 -fPIE
+QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector)
 LDFLAGS += -Wl,-pie -nostdlib
 
 build-all: s390-ccw.img