From patchwork Tue Dec 17 10:58:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11297253 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 128BE112B for ; Tue, 17 Dec 2019 11:00:30 +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 E273B2064B for ; Tue, 17 Dec 2019 11:00:28 +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="RXD6w0Pc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E273B2064B 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 1ihAZO-00087N-BK; Tue, 17 Dec 2019 10:59:14 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihAZM-00087F-BP for xen-devel@lists.xenproject.org; Tue, 17 Dec 2019 10:59:12 +0000 X-Inumbo-ID: 3f188488-20bc-11ea-8e9d-12813bfff9fa Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 3f188488-20bc-11ea-8e9d-12813bfff9fa; Tue, 17 Dec 2019 10:59:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1576580347; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7XxPk4DO2eSwzHsmnEYEkv5cmAkOZVzyc+zyg72XuUo=; b=RXD6w0PcVXbWa7S5KVrw0Dt7AnE6KdTF3aWCX17mcXW7FJg181tG8TER LedAtX4tZnEdBbb6E4+Zc6zSLE1+CvT3QwrIrw++pNbvAsVPykBJKyjzM BqR/dfPFnkLQlqowwsxTw2Vw/qFqeX3jaJt7nj6gjNWvTvqin5c8L0YFR g=; 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: zN8uTkGzg8jeJGR8tKD3P+mip2OSNLoBQLGUDtnMpFoQn24wET5Bf/Ko1pCj47SBbrDxowBAyo cb3aC7b7lcdviL9gGJ615HCwGhIRcQyxmOaqYCFMGbJYrAg1JvbB6vXPYps0WtwFM2Bnku2yoO 1F/4rr4zL8JoSEa/55MY09r6RrrrfXq/pRsFnD7BDSDI9ws0sIopQse9JUoL3HkJHImeCL+LIp N1vsQzQlBmHt8yQ7E5/UFQOFqtgwHvakfd3xaOuMyaNBOSHyH1rkx5C5AyfV5gjASOK30Z+P/B A8E= X-SBRS: 2.7 X-MesageID: 10211656 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,325,1571716800"; d="scan'208";a="10211656" From: Anthony PERARD To: Date: Tue, 17 Dec 2019 10:58:58 +0000 Message-ID: <20191217105901.68158-4-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191217105901.68158-1-anthony.perard@citrix.com> References: <20191217105901.68158-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 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))