From patchwork Thu Jun 29 18:42:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9817719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3707B6020A for ; Thu, 29 Jun 2017 18:43:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B29E28787 for ; Thu, 29 Jun 2017 18:43:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DC2D2878A; Thu, 29 Jun 2017 18:43:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF9D628787 for ; Thu, 29 Jun 2017 18:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753125AbdF2SnO (ORCPT ); Thu, 29 Jun 2017 14:43:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35370 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752868AbdF2SnN (ORCPT ); Thu, 29 Jun 2017 14:43:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B29222DA449 for ; Thu, 29 Jun 2017 18:43:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B29222DA449 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B29222DA449 Received: from thh440s.redhat.com (ovpn-116-90.ams2.redhat.com [10.36.116.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9342E18EF6; Thu, 29 Jun 2017 18:43:08 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini Cc: David Hildenbrand , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Laurent Vivier , Drew Jones 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 Message-Id: <1498761773-11164-2-git-send-email-thuth@redhat.com> In-Reply-To: <1498761773-11164-1-git-send-email-thuth@redhat.com> References: <1498761773-11164-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 29 Jun 2017 18:43:12 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This way we can add some C-only parameters to CFLAGS later. Signed-off-by: Thomas Huth --- 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