From patchwork Thu Dec 12 18:27:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11289059 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 0373A109A for ; Thu, 12 Dec 2019 18:29:06 +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 D4AD32253D for ; Thu, 12 Dec 2019 18:29:05 +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="bbuhZtYW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4AD32253D 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 1ifTC2-0007EU-0n; Thu, 12 Dec 2019 18:28:06 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifTC0-0007E4-Fr for xen-devel@lists.xenproject.org; Thu, 12 Dec 2019 18:28:04 +0000 X-Inumbo-ID: 1cdddb96-1d0d-11ea-b6f1-bc764e2007e4 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1cdddb96-1d0d-11ea-b6f1-bc764e2007e4; Thu, 12 Dec 2019 18:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1576175274; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tohU/VlMD/E9xTRkxkN4w8LGXcp4Wvo28htiAO9tnmI=; b=bbuhZtYWojvXcREr+7TmG+Q7JrmufPrPQJGXq6S8cBVQZGUgYLpXivr3 xUjTGQcPGPlGiao+mIiSeXBHApmOZjWaVMEUzPYmk01i6FP/wc48kQ8A1 Zyb2HOUTa5YNOItyeeJfg2+Pd/nrXXB+5Szy1Hfop914hL+Fd2DFBYuu9 k=; Authentication-Results: esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.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=esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: GzNvWbtQC7eHecGfgsGuNHLYchJWZQaH0DixNmYnebY9ZINBSsc1UFrBvFv9TIcechtepAiLoC 35Ws5RMCd3wu0sOKiWGsdtkv0CgkIqPAAGqU/MuGyieC5zR4jGGvkD8mateK/S+IJ/HGOT77pf obDcKyrserIRImdUhO0n6c0l3l3lptUekQBDfLnc/EKnCh6LGAI/F5GldVv8FQkNDt9tCi9YB0 ZjQrtcA+hDE40elt3bh5X9Sbg98g91ZnKO6zaXP2W+OmzUYYJ9BdXunrEhV4dj7tovj6z66YqT M50= X-SBRS: 2.7 X-MesageID: 10021230 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,306,1571716800"; d="scan'208";a="10021230" From: Anthony PERARD To: Date: Thu, 12 Dec 2019 18:27:37 +0000 Message-ID: <20191212182740.2190199-6-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191212182740.2190199-1-anthony.perard@citrix.com> References: <20191212182740.2190199-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH 5/8] 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))