From patchwork Wed Jan 15 17:00:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11335387 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B2BF13BD for ; Wed, 15 Jan 2020 17:01:50 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 273B5214AF for ; Wed, 15 Jan 2020 17:01:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="HTydct1v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 273B5214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irm1w-0008H0-JC; Wed, 15 Jan 2020 17:00:32 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irm1v-0008Gq-07 for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 17:00:31 +0000 X-Inumbo-ID: 83d5a0ca-37b8-11ea-ac27-bc764e2007e4 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 83d5a0ca-37b8-11ea-ac27-bc764e2007e4; Wed, 15 Jan 2020 17:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579107622; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7XxPk4DO2eSwzHsmnEYEkv5cmAkOZVzyc+zyg72XuUo=; b=HTydct1v1Tbt7/wD99T+ec5ovStpTHTixOQJXR7vwJpSqhNK/rAiqG0W dyZ/YstgBXtCSKPigbK+miAlWbD3QtSt7SyE4ogdTWnsscaCVCaohxFAh WQWjxjxoXsdzFzjWCH4/2IstCGFV7z+eghfqKPlOzYFW6LIubYHN3TLrK E=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: CeX3I2RzuC4yWwQu1gzfQuGWDhrlssPQSOoDHYGZqeFvhgaxf6ZLfzYhI5aJOSLIb/YlLtrD6q 4LCUH+w+Q8stmyav05361XNIuMIdeCTRtIgl2y6+mNOhAm7O+AI8gJsQhc5H3fxMUf6O5S5+A+ wlA0UXIFHS7CXieBtATp2cJdKh+THJgpAJjvaIEQmP4XsgH3Wuvpw8ROByKcfWjk+Gr90P3n1r rimoxJbHdqIZ5yVjNG6eBRV6RwL2aoBcV8Tx5s2JJSdkhMF50lCAUpm2sMQJUgsaOLYH8M9R+B U3Q= X-SBRS: 2.7 X-MesageID: 10973256 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,323,1574139600"; d="scan'208";a="10973256" From: Anthony PERARD To: Date: Wed, 15 Jan 2020 17:00:12 +0000 Message-ID: <20200115170015.249667-4-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200115170015.249667-1-anthony.perard@citrix.com> References: <20200115170015.249667-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v3 3/6] xen: Import cc-ifversion from Kbuild X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , Anthony PERARD Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This is in preparation of importing Kbuild to build Xen. We won't be able to include Config.mk so we will need a replacement for the macro `cc-ifversion'. This patch imports parts of "scripts/Kbuild.include" from Linux v5.4, the macro cc-ifversion. It makes use of CONFIG_GCC_VERSION that Kconfig now provides. Since they are no other use of Xen's `cc-ifversion' macro, we can remove it. Signed-off-by: Anthony PERARD Acked-by: Andrew Cooper --- Config.mk | 5 ----- xen/Rules.mk | 1 + xen/common/coverage/Makefile | 8 ++++---- xen/scripts/Kbuild.include | 7 +++++++ 4 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 xen/scripts/Kbuild.include diff --git a/Config.mk b/Config.mk index 35d66e5e121a..65649d6122d1 100644 --- a/Config.mk +++ b/Config.mk @@ -121,11 +121,6 @@ define cc-ver-check-closure endif endef -# cc-ifversion: Check compiler version and take branch accordingly -# Usage $(call cc-ifversion,lt,0x040700,string_if_y,string_if_n) -cc-ifversion = $(shell [ $(call cc-ver,$(CC),$(1),$(2)) = "y" ] \ - && echo $(3) || echo $(4)) - # Require GCC v4.1+ check-$(gcc) = $(call cc-ver-check,CC,0x040100,"Xen requires at least gcc-4.1") $(eval $(check-y)) diff --git a/xen/Rules.mk b/xen/Rules.mk index 5aba841b0a95..d053dbd26526 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -2,6 +2,7 @@ -include $(BASEDIR)/include/config/auto.conf include $(XEN_ROOT)/Config.mk +include $(BASEDIR)/scripts/Kbuild.include ifneq ($(origin crash_debug),undefined) diff --git a/xen/common/coverage/Makefile b/xen/common/coverage/Makefile index 46c78d1086d6..b509e51f960b 100644 --- a/xen/common/coverage/Makefile +++ b/xen/common/coverage/Makefile @@ -1,10 +1,10 @@ obj-y += coverage.o ifneq ($(clang),y) obj-y += gcov_base.o gcov.o -obj-y += $(call cc-ifversion,lt,0x040700, \ - gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \ - gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \ - gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \ +obj-y += $(call cc-ifversion,-lt,0407, \ + gcc_3_4.o, $(call cc-ifversion,-lt,0409, \ + gcc_4_7.o, $(call cc-ifversion,-lt,0500, \ + gcc_4_9.o, $(call cc-ifversion,-lt,0700, \ gcc_5.o, gcc_7.o)))) else obj-y += llvm.o diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include new file mode 100644 index 000000000000..a5c462fd9777 --- /dev/null +++ b/xen/scripts/Kbuild.include @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0 +#### +# kbuild: Generic definitions + +# cc-ifversion +# Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) +cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4))