From patchwork Fri Jun 30 10:00:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9819333 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 9E1ED60224 for ; Fri, 30 Jun 2017 11:33:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F3152861F for ; Fri, 30 Jun 2017 11:33:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83D3F2862E; Fri, 30 Jun 2017 11:33:01 +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 2438C2861F for ; Fri, 30 Jun 2017 11:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752040AbdF3KBf (ORCPT ); Fri, 30 Jun 2017 06:01:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50168 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbdF3KAb (ORCPT ); Fri, 30 Jun 2017 06:00:31 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9CB25612BC for ; Fri, 30 Jun 2017 10:00:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9CB25612BC Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9CB25612BC Received: from thh440s.redhat.com (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA0E07E681; Fri, 30 Jun 2017 10:00:25 +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 v3 PATCH 1/3] Move flags that are shared between C and C++ into COMMON_CFLAGS Date: Fri, 30 Jun 2017 12:00:17 +0200 Message-Id: <1498816819-32666-2-git-send-email-thuth@redhat.com> In-Reply-To: <1498816819-32666-1-git-send-email-thuth@redhat.com> References: <1498816819-32666-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 30 Jun 2017 10:00:30 +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