Comment 2 for bug 1798007

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Solution is here:
commit 29ff4881e498192118065dbc722e7302df740f6d
Author: Paolo Bonzini <email address hidden>
Date: Tue Oct 25 15:26:43 2016 +0200

    autodetect -Wno-frame-address

    Not all targets have -Wframe-address, and those that don't will
    report an error if -Wno-frame-address is passed (because of -Werror).
    So autodetect it.

diff --git a/Makefile b/Makefile
index 0ffe234..5201472 100644
--- a/Makefile
+++ b/Makefile
@@ -45,14 +45,16 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
               > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)

 CFLAGS += -g
-CFLAGS += $(autodepend-flags) -Wall -Werror -Wno-frame-address
+CFLAGS += $(autodepend-flags) -Wall -Werror
 frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer
 fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "")
 fnostack_protector := $(call cc-option, -fno-stack-protector, "")
 fnostack_protector_all := $(call cc-option, -fno-stack-protector-all, "")
+wno_frame_address := $(call cc-option, -Wno-frame-address, "")
 CFLAGS += $(fomit_frame_pointer)
 CFLAGS += $(fno_stack_protector)
 CFLAGS += $(fno_stack_protector_all)
+CFLAGS += $(wno_frame_address)

 CXXFLAGS += $(CFLAGS)