All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Cc: "David Hildenbrand" <david@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Drew Jones" <drjones@redhat.com>
Subject: [kvm-unit-tests PATCH 1/3] Move flags that are shared between C and C++ into COMMON_CFLAGS
Date: Thu, 29 Jun 2017 20:42:51 +0200	[thread overview]
Message-ID: <1498761773-11164-2-git-send-email-thuth@redhat.com> (raw)
In-Reply-To: <1498761773-11164-1-git-send-email-thuth@redhat.com>

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

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 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

  reply	other threads:[~2017-06-29 18:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 18:42 [kvm-unit-tests PATCH 0/3] Some more improvements related to compiler warnings Thomas Huth
2017-06-29 18:42 ` Thomas Huth [this message]
2017-06-29 18:42 ` [kvm-unit-tests v2 PATCH 2/3] Replace -Wextra with a saner list of warning flags Thomas Huth
2017-06-30  8:07   ` Andrew Jones
2017-06-30  9:08     ` Thomas Huth
2017-06-30  8:19   ` Andrew Jones
2017-06-30  9:09     ` Thomas Huth
2017-06-30 10:06   ` Paolo Bonzini
2017-06-29 18:42 ` [kvm-unit-tests PATCH 3/3] Mark some local functions as "static" Thomas Huth
2017-06-30 10:07   ` Paolo Bonzini
2017-06-30 10:08 ` [kvm-unit-tests PATCH 0/3] Some more improvements related to compiler warnings Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498761773-11164-2-git-send-email-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.