[kvm-unit-tests PATCH 1/3] Move flags that are shared between C and C++ into COMMON_CFLAGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This way we can add some C-only parameters to CFLAGS later.

Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
---
 Makefile            | 21 +++++++++++----------
 x86/Makefile.common |  4 ++--
 x86/Makefile.x86_64 |  2 +-
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index e79cf93..3ef6ea7 100644
--- a/Makefile
+++ b/Makefile
@@ -50,8 +50,8 @@ include $(SRCDIR)/$(TEST_DIR)/Makefile
 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 -Wwrite-strings -Werror
+COMMON_CFLAGS += -g
+COMMON_CFLAGS += $(autodepend-flags) -Wall -Wwrite-strings -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, "")
@@ -59,14 +59,15 @@ fnostack_protector_all := $(call cc-option, -fno-stack-protector-all, "")
 wno_frame_address := $(call cc-option, -Wno-frame-address, "")
 fno_pic := $(call cc-option, -fno-pic, "")
 no_pie := $(call cc-option, -no-pie, "")
-CFLAGS += $(fomit_frame_pointer)
-CFLAGS += $(fno_stack_protector)
-CFLAGS += $(fno_stack_protector_all)
-CFLAGS += $(wno_frame_address)
-CFLAGS += $(if $(U32_LONG_FMT),-D__U32_LONG_FMT__,)
-CFLAGS += $(fno_pic) $(no_pie)
-
-CXXFLAGS += $(CFLAGS)
+COMMON_CFLAGS += $(fomit_frame_pointer)
+COMMON_CFLAGS += $(fno_stack_protector)
+COMMON_CFLAGS += $(fno_stack_protector_all)
+COMMON_CFLAGS += $(wno_frame_address)
+COMMON_CFLAGS += $(if $(U32_LONG_FMT),-D__U32_LONG_FMT__,)
+COMMON_CFLAGS += $(fno_pic) $(no_pie)
+
+CFLAGS += $(COMMON_CFLAGS)
+CXXFLAGS += $(COMMON_CFLAGS)
 
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
 
diff --git a/x86/Makefile.common b/x86/Makefile.common
index ca97a8e..e96812b 100644
--- a/x86/Makefile.common
+++ b/x86/Makefile.common
@@ -21,8 +21,8 @@ OBJDIRS += lib/x86
 $(libcflat): LDFLAGS += -nostdlib
 $(libcflat): CFLAGS += -ffreestanding -I $(SRCDIR)/lib -I lib
 
-CFLAGS += -m$(bits)
-CFLAGS += -O1
+COMMON_CFLAGS += -m$(bits)
+COMMON_CFLAGS += -O1
 
 # stack.o relies on frame pointers.
 KEEP_FRAME_POINTER := y
diff --git a/x86/Makefile.x86_64 b/x86/Makefile.x86_64
index fd34cce..623fc5b 100644
--- a/x86/Makefile.x86_64
+++ b/x86/Makefile.x86_64
@@ -1,7 +1,7 @@
 cstart.o = $(TEST_DIR)/cstart64.o
 bits = 64
 ldarch = elf64-x86-64
-CFLAGS += -mno-red-zone
+COMMON_CFLAGS += -mno-red-zone
 
 cflatobjs += lib/x86/setjmp64.o
 cflatobjs += lib/x86/intel-iommu.o
-- 
1.8.3.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux