From patchwork Fri Jan 17 10:53:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338767 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 3E48F13A0 for ; Fri, 17 Jan 2020 10:55:29 +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 1A6012072B for ; Fri, 17 Jan 2020 10:55:29 +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="TzdR+j1x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A6012072B 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 1isPGg-0004wJ-AP; Fri, 17 Jan 2020 10:54:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1isPGe-0004vf-LS for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:20 +0000 X-Inumbo-ID: b10dd35e-3917-11ea-b833-bc764e2007e4 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b10dd35e-3917-11ea-b833-bc764e2007e4; Fri, 17 Jan 2020 10:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258450; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bp6VeAtawBJ7+KlC2XEdokxk4K2nHX7ktie28XH2YH8=; b=TzdR+j1xBCYBH+P+UTqX3BvJxSldGklZhTtabq7IP4O4T50tciKSLGvU jAIRWALfCwjRg3qaBMKDqGTiJA6emr7uSAyDV0vfIMQ9jzEIXzRZJ6IhN BBinQo9vY8DfqKzkpwcTpJXMDUut270BKy2iUMH6vd0bAVa0yzVAOIeZo I=; 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: itnPg+duLNhOj4iFx7kyj+aVvzuXCS7Z+mMrNKL6mx5Nv5J0aqUzFlcX3lcNvnC6wp7iTmmYbi Li7hMrcav0PrmCLA4mf3NMtYPFZlsQ5JSqrTIi3Bqf4GW406kuGqDlra1S2RvLTYJZrglJAdHT Klo1HRWk7QhcRqt5RhXSAk7DHTcfc7hUC+oJkAcF1YjU+gWeCyipVTnEt4xWY431NwNQ5lrcQN z4H02iyJ1rAU8DlsTH+uGpR59vxljkz5n7Qi2AleDJMKKlrRsz3TZLAOpVRsI/uYIa2LTVrDhc ILA= X-SBRS: 2.7 X-MesageID: 11498515 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.70,329,1574139600"; d="scan'208";a="11498515" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:47 +0000 Message-ID: <20200117105358.607910-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 01/12] xen/build: Remove left over -DMAX_PHYS_IRQS 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 , Anthony PERARD , Jan Beulich , Anthony PERARD Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Anthony PERARD The use of MAX_PHYS_IRQS have been removed in cf5e6f2d3441 ("x86: eliminate hard-coded NR_IRQS"), so remove the left over CFLAGS. Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- xen/Rules.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index fcdafd029342..22f25c5b2be8 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -71,10 +71,6 @@ ifneq ($(CONFIG_CC_IS_CLANG),y) CFLAGS += -Wa,--strip-local-absolute endif -ifneq ($(max_phys_irqs),) -CFLAGS-y += -DMAX_PHYS_IRQS=$(max_phys_irqs) -endif - AFLAGS-y += -D__ASSEMBLY__ ALL_OBJS := $(ALL_OBJS-y) From patchwork Fri Jan 17 10:53:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338765 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 CF686184C for ; Fri, 17 Jan 2020 10:55:25 +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 A10972072B for ; Fri, 17 Jan 2020 10:55:25 +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="akK6Wmj3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A10972072B 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 1isPGT-0004rP-Ke; Fri, 17 Jan 2020 10:54:09 +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 1isPGR-0004rK-TT for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:07 +0000 X-Inumbo-ID: ac23702f-3917-11ea-88b0-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ac23702f-3917-11ea-88b0-12813bfff9fa; Fri, 17 Jan 2020 10:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258443; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OkZwjS3pj+/ZAonBHya3McIakWZxrlb5MxoOipB81G0=; b=akK6Wmj3BlrTnAZhKtyfDplzyzA0JDkZo+6ag70osOuoBgD0eX/6ZkxC 6a24AU5n/R83XwFQFxJvy1QwG3Q54ZGpQMaYphRk5bZcDFdjhwAWvf0gB hK63ZCLKZi2bbhVVjPhHq4no75LcbIbi/ERzX7ZGdl6gtMZnN55Vy+Ko7 c=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: kBRTzXiohr4IKnoCTTTEz3q++zRBAy+HtcQbJYn3c2L61IdtAZSHnhfrfQpc0gQ8mpW9HM1VQ/ /u5zqVJMnIPO5J24wqxxyYYpSW9sw765CBvBunn8imj4o440hbIJsA5oFQ5ZbgBmO3Wt+eU6Va 4191dZFmbzwK15QsuP87FzCdqh6+UegWNEETSj3CwmpdMnvy5kGl7yBOxI+m4mjn1Qnxl/i6yH J+D9SMfCJLyMwXXJQqt9fGOP0xGQZPfyTV8K7SUbb4g3tCIPtOD2V4RMqWw7sXa6ACqzCX+QBM xrE= X-SBRS: 2.7 X-MesageID: 11432448 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432448" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:48 +0000 Message-ID: <20200117105358.607910-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 02/12] xen/build: Use obj-y += subdir/ instead of subdir-y 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: Kevin Tian , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , Anthony PERARD , Daniel De Graaf , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This is part of upgrading our build system and import more of Linux's one. In Linux, subdir-y in Makefiles is only used to descend into subdirectory when there are no object to build, Xen doesn't have that and all subdir have object to be included in the final binary. To allow the new syntax, the "obj-y" and "subdir-*" calculation in Rules.mk is changed and partially imported from Linux's Kbuild. The command used to modify the Makefile was: sed -i -r 's#^subdir-(.*)#obj-\1/#;' **/Makefile Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- xen/Rules.mk | 21 ++++++++++----------- xen/arch/arm/Makefile | 14 +++++++------- xen/arch/arm/arm32/Makefile | 2 +- xen/arch/arm/arm64/Makefile | 2 +- xen/arch/x86/Makefile | 18 +++++++++--------- xen/arch/x86/acpi/Makefile | 2 +- xen/arch/x86/cpu/Makefile | 4 ++-- xen/arch/x86/guest/Makefile | 4 ++-- xen/arch/x86/hvm/Makefile | 6 +++--- xen/arch/x86/mm/Makefile | 4 ++-- xen/arch/x86/x86_64/Makefile | 2 +- xen/common/Makefile | 8 ++++---- xen/drivers/Makefile | 14 +++++++------- xen/drivers/acpi/Makefile | 6 +++--- xen/drivers/passthrough/Makefile | 8 ++++---- xen/drivers/passthrough/vtd/Makefile | 2 +- xen/lib/Makefile | 2 +- xen/xsm/Makefile | 2 +- xen/xsm/flask/Makefile | 2 +- 19 files changed, 61 insertions(+), 62 deletions(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index 22f25c5b2be8..8b04cbdd24ca 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -105,17 +105,16 @@ define gendep endef $(foreach o,$(filter-out %/,$(obj-y) $(obj-bin-y) $(extra-y)),$(eval $(call gendep,$(o)))) -# Ensure each subdirectory has exactly one trailing slash. -subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-))) -subdir-y := $(patsubst %,%/,$(patsubst %/,%,$(subdir-y))) - -# Add explicitly declared subdirectories to the object lists. -obj-y += $(patsubst %/,%/built_in.o,$(subdir-y)) - -# Add implicitly declared subdirectories (in the object lists) to the -# subdirectory list, and rewrite the object-list entry. -subdir-y += $(filter %/,$(obj-y)) -obj-y := $(patsubst %/,%/built-in.o,$(obj-y)) +# Handle objects in subdirs +# --------------------------------------------------------------------------- +# o if we encounter foo/ in $(obj-y), replace it by foo/built_in.o +# and add the directory to the list of dirs to descend into: $(subdir-y) +__subdir-y := $(filter %/, $(obj-y)) +subdir-y += $(__subdir-y) +obj-y := $(patsubst %/, %/built_in.o, $(obj-y)) + +subdir-n := $(subdir-n) $(subdir-) \ + $(filter %/, $(obj-n) $(obj-)) subdir-all := $(subdir-y) $(subdir-n) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 70f532e42a06..1044c2298a05 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -1,11 +1,11 @@ -subdir-$(CONFIG_ARM_32) += arm32 -subdir-$(CONFIG_ARM_64) += arm64 -subdir-$(CONFIG_ARM_64) += efi -subdir-$(CONFIG_ACPI) += acpi +obj-$(CONFIG_ARM_32) += arm32/ +obj-$(CONFIG_ARM_64) += arm64/ +obj-$(CONFIG_ARM_64) += efi/ +obj-$(CONFIG_ACPI) += acpi/ ifneq ($(CONFIG_NO_PLAT),y) -subdir-y += platforms +obj-y += platforms/ endif -subdir-$(CONFIG_TEE) += tee +obj-$(CONFIG_TEE) += tee/ obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o obj-y += bootfdt.init.o @@ -48,7 +48,7 @@ obj-y += sysctl.o obj-y += time.o obj-y += traps.o obj-y += vcpreg.o -subdir-$(CONFIG_NEW_VGIC) += vgic +obj-$(CONFIG_NEW_VGIC) += vgic/ ifneq ($(CONFIG_NEW_VGIC),y) obj-y += gic-vgic.o obj-y += vgic.o diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile index 0ac254f34714..539bbef298a7 100644 --- a/xen/arch/arm/arm32/Makefile +++ b/xen/arch/arm/arm32/Makefile @@ -1,4 +1,4 @@ -subdir-y += lib +obj-y += lib/ obj-$(EARLY_PRINTK) += debug.o obj-y += domctl.o diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile index c4f3a28a0d0b..db8565b71a33 100644 --- a/xen/arch/arm/arm64/Makefile +++ b/xen/arch/arm/arm64/Makefile @@ -1,4 +1,4 @@ -subdir-y += lib +obj-y += lib/ obj-y += cache.o obj-$(CONFIG_HARDEN_BRANCH_PREDICTOR) += bpi.o diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 6783688b00be..461d1f3dc2a6 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -1,12 +1,12 @@ -subdir-y += acpi -subdir-y += cpu -subdir-y += genapic -subdir-$(CONFIG_GUEST) += guest -subdir-$(CONFIG_HVM) += hvm -subdir-y += mm -subdir-$(CONFIG_XENOPROF) += oprofile -subdir-$(CONFIG_PV) += pv -subdir-y += x86_64 +obj-y += acpi/ +obj-y += cpu/ +obj-y += genapic/ +obj-$(CONFIG_GUEST) += guest/ +obj-$(CONFIG_HVM) += hvm/ +obj-y += mm/ +obj-$(CONFIG_XENOPROF) += oprofile/ +obj-$(CONFIG_PV) += pv/ +obj-y += x86_64/ alternative-y := alternative.init.o alternative-$(CONFIG_LIVEPATCH) := diff --git a/xen/arch/x86/acpi/Makefile b/xen/arch/x86/acpi/Makefile index 27b4aa30b0ca..1b9e62571301 100644 --- a/xen/arch/x86/acpi/Makefile +++ b/xen/arch/x86/acpi/Makefile @@ -1,4 +1,4 @@ -subdir-y += cpufreq +obj-y += cpufreq/ obj-y += lib.o power.o suspend.o cpu_idle.o cpuidle_menu.o obj-bin-y += boot.init.o wakeup_prot.o diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile index 466acc8b10e5..de983006a1b1 100644 --- a/xen/arch/x86/cpu/Makefile +++ b/xen/arch/x86/cpu/Makefile @@ -1,5 +1,5 @@ -subdir-y += mcheck -subdir-y += mtrr +obj-y += mcheck/ +obj-y += mtrr/ obj-y += amd.o obj-y += centaur.o diff --git a/xen/arch/x86/guest/Makefile b/xen/arch/x86/guest/Makefile index f164196772e8..a1e370d69df8 100644 --- a/xen/arch/x86/guest/Makefile +++ b/xen/arch/x86/guest/Makefile @@ -1,4 +1,4 @@ obj-y += hypervisor.o -subdir-$(CONFIG_HYPERV_GUEST) += hyperv -subdir-$(CONFIG_XEN_GUEST) += xen +obj-$(CONFIG_HYPERV_GUEST) += hyperv/ +obj-$(CONFIG_XEN_GUEST) += xen/ diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile index 43e5f3a21f8b..346419154460 100644 --- a/xen/arch/x86/hvm/Makefile +++ b/xen/arch/x86/hvm/Makefile @@ -1,6 +1,6 @@ -subdir-y += svm -subdir-y += vmx -subdir-y += viridian +obj-y += svm/ +obj-y += vmx/ +obj-y += viridian/ obj-y += asid.o obj-y += dm.o diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile index 5010a29d6cb0..d87dc0aa6eeb 100644 --- a/xen/arch/x86/mm/Makefile +++ b/xen/arch/x86/mm/Makefile @@ -1,5 +1,5 @@ -subdir-y += shadow -subdir-$(CONFIG_HVM) += hap +obj-y += shadow/ +obj-$(CONFIG_HVM) += hap/ obj-$(CONFIG_HVM) += altp2m.o obj-$(CONFIG_HVM) += guest_walk_2.o guest_walk_3.o guest_walk_4.o diff --git a/xen/arch/x86/x86_64/Makefile b/xen/arch/x86/x86_64/Makefile index 4bfa1480eb7e..2bb1eb0a8131 100644 --- a/xen/arch/x86/x86_64/Makefile +++ b/xen/arch/x86/x86_64/Makefile @@ -1,4 +1,4 @@ -subdir-$(CONFIG_PV) += compat +obj-$(CONFIG_PV) += compat/ obj-bin-y += entry.o obj-y += traps.o diff --git a/xen/common/Makefile b/xen/common/Makefile index 62b34e69e95c..d4db0a6d466a 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -73,8 +73,8 @@ obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall extra-y := symbols-dummy.o -subdir-$(CONFIG_COVERAGE) += coverage -subdir-$(CONFIG_UBSAN) += ubsan +obj-$(CONFIG_COVERAGE) += coverage/ +obj-$(CONFIG_UBSAN) += ubsan/ -subdir-$(CONFIG_NEEDS_LIBELF) += libelf -subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt +obj-$(CONFIG_NEEDS_LIBELF) += libelf/ +obj-$(CONFIG_HAS_DEVICE_TREE) += libfdt/ diff --git a/xen/drivers/Makefile b/xen/drivers/Makefile index 30bab3cfdb36..2a1ae8ad130a 100644 --- a/xen/drivers/Makefile +++ b/xen/drivers/Makefile @@ -1,7 +1,7 @@ -subdir-y += char -subdir-$(CONFIG_HAS_CPUFREQ) += cpufreq -subdir-$(CONFIG_HAS_PCI) += pci -subdir-$(CONFIG_HAS_VPCI) += vpci -subdir-$(CONFIG_HAS_PASSTHROUGH) += passthrough -subdir-$(CONFIG_ACPI) += acpi -subdir-$(CONFIG_VIDEO) += video +obj-y += char/ +obj-$(CONFIG_HAS_CPUFREQ) += cpufreq/ +obj-$(CONFIG_HAS_PCI) += pci/ +obj-$(CONFIG_HAS_VPCI) += vpci/ +obj-$(CONFIG_HAS_PASSTHROUGH) += passthrough/ +obj-$(CONFIG_ACPI) += acpi/ +obj-$(CONFIG_VIDEO) += video/ diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile index 444b11d5839d..4f8e97228ee2 100644 --- a/xen/drivers/acpi/Makefile +++ b/xen/drivers/acpi/Makefile @@ -1,6 +1,6 @@ -subdir-y += tables -subdir-y += utilities -subdir-$(CONFIG_X86) += apei +obj-y += tables/ +obj-y += utilities/ +obj-$(CONFIG_X86) += apei/ obj-bin-y += tables.init.o obj-$(CONFIG_NUMA) += numa.o diff --git a/xen/drivers/passthrough/Makefile b/xen/drivers/passthrough/Makefile index d50ab188c83c..e973e16c7484 100644 --- a/xen/drivers/passthrough/Makefile +++ b/xen/drivers/passthrough/Makefile @@ -1,7 +1,7 @@ -subdir-$(CONFIG_X86) += vtd -subdir-$(CONFIG_X86) += amd -subdir-$(CONFIG_X86) += x86 -subdir-$(CONFIG_ARM) += arm +obj-$(CONFIG_X86) += vtd/ +obj-$(CONFIG_X86) += amd/ +obj-$(CONFIG_X86) += x86/ +obj-$(CONFIG_ARM) += arm/ obj-y += iommu.o obj-$(CONFIG_HAS_PCI) += pci.o diff --git a/xen/drivers/passthrough/vtd/Makefile b/xen/drivers/passthrough/vtd/Makefile index f302653858a0..fde7555fac07 100644 --- a/xen/drivers/passthrough/vtd/Makefile +++ b/xen/drivers/passthrough/vtd/Makefile @@ -1,4 +1,4 @@ -subdir-$(CONFIG_X86) += x86 +obj-$(CONFIG_X86) += x86/ obj-y += iommu.o obj-y += dmar.o diff --git a/xen/lib/Makefile b/xen/lib/Makefile index dcdb75931378..7019ca00e8fd 100644 --- a/xen/lib/Makefile +++ b/xen/lib/Makefile @@ -1 +1 @@ -subdir-$(CONFIG_X86) += x86 +obj-$(CONFIG_X86) += x86/ diff --git a/xen/xsm/Makefile b/xen/xsm/Makefile index e4d581e065f8..cf0a728f1c96 100644 --- a/xen/xsm/Makefile +++ b/xen/xsm/Makefile @@ -3,4 +3,4 @@ obj-$(CONFIG_XSM) += xsm_policy.o obj-$(CONFIG_XSM) += dummy.o obj-$(CONFIG_XSM_SILO) += silo.o -subdir-$(CONFIG_XSM_FLASK) += flask +obj-$(CONFIG_XSM_FLASK) += flask/ diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile index 7c3f381287be..b1fd45421993 100644 --- a/xen/xsm/flask/Makefile +++ b/xen/xsm/flask/Makefile @@ -2,7 +2,7 @@ obj-y += avc.o obj-y += hooks.o obj-y += flask_op.o -subdir-y += ss +obj-y += ss/ CFLAGS += -I./include From patchwork Fri Jan 17 10:53:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338763 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 9CEB117EA for ; Fri, 17 Jan 2020 10:55:25 +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 799462072B for ; Fri, 17 Jan 2020 10:55:25 +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="E6R4KR/A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 799462072B 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 1isPGa-0004tP-LO; Fri, 17 Jan 2020 10:54:16 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1isPGZ-0004sW-KH for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:15 +0000 X-Inumbo-ID: abe97ca2-3917-11ea-8e9a-bc764e2007e4 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id abe97ca2-3917-11ea-8e9a-bc764e2007e4; Fri, 17 Jan 2020 10:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258442; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jiF1/fUcVDrgXgau77P1H2MuBbFylED2F0KmBkGvr2s=; b=E6R4KR/ApF2wMJX9+6botW5c9lao/+cp1hEtAvOjb88ioLZkwLZ09fgl qss7NOp2GeB0FkLgXcYXNENOH4BJEgVKZKcRMLt59rX7fqNpS8fxBEILo NjpETxDBqCL9FyToqsyQVbhPNzyzGrWp8iwI0HzHuNyfyDpqqUUfzBy8z M=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: HPH7t11yLUKN87tdsVKkomuUZue4UJje9WK43aNJi9F3Jfgpm6M9J3qpLv1+zRXkJmKI6KxZmi D3vGB0Vuec4HyCJYfa1Lchr0iQvHqr7nCkI4un075A62qjCUJUy2AMa4/Q/f9UP4iFvOjb4LDD AiJ1NjTjbOP+m+HHPFpGWHz1Rqq/9r4Rcga1la7MBhymx8tL+AoRPj68nntVBAqwn3kMLNa4Tn DssVGAxaed+ODoMrMQgpF2t965Hs5LdA27jPrlOHp37QXmiPnPWmrA31z9QMfkvFKs5wTnxTgf lKs= X-SBRS: 2.7 X-MesageID: 11432447 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432447" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:49 +0000 Message-ID: <20200117105358.607910-4-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 03/12] xen/build: use $(clean) shorthand for clean targets 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 , Anthony PERARD , Jan Beulich , Anthony PERARD Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Anthony PERARD Collect all the clean targets as we are going to modify it shortly. Also, this is inspired by Linux's Kbuild. "Kbuild.include" isn't included by "Makefile", but the "_clean" target is only used by Rules.mk which include Kbuild.include. Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- xen/Makefile | 16 ++++++++-------- xen/Rules.mk | 2 +- xen/scripts/Kbuild.include | 5 +++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index c326fee5880e..814011175fd8 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -117,14 +117,14 @@ _debug: .PHONY: _clean _clean: delete-unfresh-files $(MAKE) -C tools clean - $(MAKE) -f $(BASEDIR)/Rules.mk -C include clean - $(MAKE) -f $(BASEDIR)/Rules.mk -C common clean - $(MAKE) -f $(BASEDIR)/Rules.mk -C drivers clean - $(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean - $(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean - $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/arm clean - $(MAKE) -f $(BASEDIR)/Rules.mk -C arch/x86 clean - $(MAKE) -f $(BASEDIR)/Rules.mk -C test clean + $(MAKE) $(clean) include + $(MAKE) $(clean) common + $(MAKE) $(clean) drivers + $(MAKE) $(clean) xsm + $(MAKE) $(clean) crypto + $(MAKE) $(clean) arch/arm + $(MAKE) $(clean) arch/x86 + $(MAKE) $(clean) test $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) clean find . \( -name "*.o" -o -name ".*.d" -o -name ".*.d2" -o -name "*.gcno" \) -exec rm -f {} \; rm -f include/asm $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET).efi.map $(TARGET)-syms $(TARGET)-syms.map *~ core diff --git a/xen/Rules.mk b/xen/Rules.mk index 8b04cbdd24ca..120323717d87 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -185,7 +185,7 @@ FORCE: clean:: $(addprefix _clean_, $(subdir-all)) rm -f *.o .*.o.tmp *~ core $(DEPS_RM) _clean_%/: FORCE - $(MAKE) -f $(BASEDIR)/Rules.mk -C $* clean + $(MAKE) $(clean) $* SRCPATH := $(patsubst $(BASEDIR)/%,%,$(CURDIR)) diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include index a5c462fd9777..2465cc4060c3 100644 --- a/xen/scripts/Kbuild.include +++ b/xen/scripts/Kbuild.include @@ -5,3 +5,8 @@ # 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)) + +# Shorthand for $(MAKE) clean +# Usage: +# $(MAKE) $(clean) dir +clean := -f $(BASEDIR)/Rules.mk clean -C From patchwork Fri Jan 17 10:53:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338759 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 2BF8E17EA for ; Fri, 17 Jan 2020 10:55:21 +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 08D5B20842 for ; Fri, 17 Jan 2020 10:55:20 +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="KAV/BxKf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08D5B20842 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 1isPGY-0004rw-7Y; Fri, 17 Jan 2020 10:54: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 1isPGW-0004rm-TO for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:12 +0000 X-Inumbo-ID: ad953898-3917-11ea-88b0-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ad953898-3917-11ea-88b0-12813bfff9fa; Fri, 17 Jan 2020 10:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258444; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BaVL54Bogf22hBGa7/sAqmT8wuvNZRQ1/2NJj3UBFd0=; b=KAV/BxKfLKTkHA7ctSnpMFWvXBN+bFHq+iL3y/xtbwzxWDRK2UxyKRmv YySzaSYcxvo7TCl6Tcv+pRgK/jILPrYPMThR5JbNGUu9B4bbMpomwzEAt q1CQXdi3hzAkhyQBGgWewnxSTZ1TeR23rEnZV+nFvkgtzrcAs9+1ycMiA E=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: CgK8RSRYP93o4sJcM7pfI3F88EkDAWf6XUZ2sXgXh1BlTfIMK0eb2ZRcjF4RVm1ENbtl8zFyxd soFOFNcYR8YpKCzxysRK+4ph0X/M3EAXUIpSyVJNQP5vtsdV7KTxBYk70D6vi57SgcHQnjFOpT /dTXfOK1WcQ6RejjSeKducrs5KgxVRYPkNOIfRNeGKiCreEso9xvG2AkpAPI1eDVot5TeL80fI ZYNGVDeRHwQwCAHbCb2PmuurLQWuF54cf0/6nyAsRIZep1kjKCnPYGp8ArdbxTGMC23FKnBQAU kNE= X-SBRS: 2.7 X-MesageID: 11432449 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432449" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:50 +0000 Message-ID: <20200117105358.607910-5-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 04/12] xen/build: extract clean target from Rules.mk 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 , Anthony PERARD , Jan Beulich , Anthony PERARD Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Anthony PERARD Most of the code executed by Rules.mk isn't necessary for the clean target, especially not the CFLAGS. This make running make clean much faster. This extract the code into a different Makefile. It doesn't want to include Config.mk either so variables DEPS_RM and DEPS_INCLUDE are extracted from Config.mk as well. DEPS_INCLUDE is put into Kbuild.include so it could be use by other Makefiles. This is inspired by Kbuild, with Makefile.clean partially copied from Linux v5.4. Signed-off-by: Anthony PERARD --- xen/Rules.mk | 13 ------------- xen/scripts/Kbuild.include | 7 ++++++- xen/scripts/Makefile.clean | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 xen/scripts/Makefile.clean diff --git a/xen/Rules.mk b/xen/Rules.mk index 120323717d87..deab0abd63e1 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -94,8 +94,6 @@ LDFLAGS += $(LDFLAGS-y) include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk -DEPS = .*.d - include Makefile define gendep @@ -113,11 +111,6 @@ __subdir-y := $(filter %/, $(obj-y)) subdir-y += $(__subdir-y) obj-y := $(patsubst %/, %/built_in.o, $(obj-y)) -subdir-n := $(subdir-n) $(subdir-) \ - $(filter %/, $(obj-n) $(obj-)) - -subdir-all := $(subdir-y) $(subdir-n) - $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -DINIT_SECTIONS_ONLY ifeq ($(CONFIG_COVERAGE),y) @@ -181,12 +174,6 @@ FORCE: %/built_in_bin.o: FORCE $(MAKE) -f $(BASEDIR)/Rules.mk -C $* built_in_bin.o -.PHONY: clean -clean:: $(addprefix _clean_, $(subdir-all)) - rm -f *.o .*.o.tmp *~ core $(DEPS_RM) -_clean_%/: FORCE - $(MAKE) $(clean) $* - SRCPATH := $(patsubst $(BASEDIR)/%,%,$(CURDIR)) %.o: %.c Makefile diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include index 2465cc4060c3..6a9b0c39da53 100644 --- a/xen/scripts/Kbuild.include +++ b/xen/scripts/Kbuild.include @@ -2,6 +2,11 @@ #### # kbuild: Generic definitions +### +# dependencies +DEPS = .*.d +DEPS_INCLUDE = $(addsuffix .d2, $(basename $(wildcard $(DEPS)))) + # 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)) @@ -9,4 +14,4 @@ cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || e # Shorthand for $(MAKE) clean # Usage: # $(MAKE) $(clean) dir -clean := -f $(BASEDIR)/Rules.mk clean -C +clean := -f $(BASEDIR)/scripts/Makefile.clean clean -C diff --git a/xen/scripts/Makefile.clean b/xen/scripts/Makefile.clean new file mode 100644 index 000000000000..31cf2b59594e --- /dev/null +++ b/xen/scripts/Makefile.clean @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: GPL-2.0 +# ========================================================================== +# Cleaning up +# ========================================================================== + +clean:: + +include $(BASEDIR)/scripts/Kbuild.include + +include Makefile + +# Figure out what we need to build from the various variables +# ========================================================================== +__subdir-y := $(filter %/, $(obj-y)) +subdir-y += $(__subdir-y) +subdir-n := $(subdir-n) $(subdir-) \ + $(filter %/, $(obj-n) $(obj-)) +subdir-all := $(subdir-y) $(subdir-n) + +DEPS_RM = $(DEPS) $(DEPS_INCLUDE) +.PHONY: clean +clean:: $(addprefix _clean_, $(subdir-all)) + rm -f *.o .*.o.tmp *~ core $(DEPS_RM) + +# Descending +# --------------------------------------------------------------------------- + +_clean_%/: FORCE + $(MAKE) $(clean) $* + +# Force execution of pattern rules (for which PHONY cannot be directly used). +.PHONY: FORCE +FORCE: From patchwork Fri Jan 17 10:53:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338757 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 15E5213BD for ; Fri, 17 Jan 2020 10:55:21 +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 E64D22072B for ; Fri, 17 Jan 2020 10:55:20 +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="HN5dR0nx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E64D22072B 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 1isPGc-0004ul-W1; Fri, 17 Jan 2020 10:54:18 +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 1isPGb-0004uA-Tf for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:17 +0000 X-Inumbo-ID: af6d3e4a-3917-11ea-88b0-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id af6d3e4a-3917-11ea-88b0-12813bfff9fa; Fri, 17 Jan 2020 10:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258447; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6/qLtkj5Jww3gcQ65tbXPo+HgTWCoq9UnH4sl83WjiQ=; b=HN5dR0nxa187o49+EAq3alSjy3DKMYCXoLJYgZzE+T6PyMx7nGSAHcsS ZyC3C/b7oLRL/aZk95OTStM3tgEGz9viwdDvJ/F5aBOXNZsxgr7/rYdx0 lqAck2RQ7aLYSO9nK8pq8B6nEo8himDoYR6UikqT1taImF0sQfqz2QmNi I=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: v5wtkjO/h4kST/tUm8SjDFWG9L5NuJYxBF173ZfCt8+DjuKgjd6s9pGJfyTni+pqRnc2Xz+WQA VaFmY48d8/1HHMutR+eWkZDMshQ0jdbCblzz034SaA7up2sJM4x2HnewYGRgBX4S8MfhbFLIH6 tZZpRH6Kb7lOM67R+RBO+jBYAIwPkvWWxfxBEoJwAEahetAq16k+YaXiMk5PUpzni1bjBVL17Z I7NSgxxBDRqVlct7MSeGNqqKW5SxC39kM6NHK2Ovyel4/0LWqi0L915mxw1GcfUcYhwZKoBy2o kLs= X-SBRS: 2.7 X-MesageID: 11432450 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432450" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:51 +0000 Message-ID: <20200117105358.607910-6-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 05/12] xen/include: remove include of Config.mk 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" It isn't necessary to include Config.mk here because this Makefile is only used by xen/Rules.mk which already includes Config.mk. Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- xen/include/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/xen/include/Makefile b/xen/include/Makefile index fde0ca013121..433bad9055b2 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -1,5 +1,3 @@ -include $(XEN_ROOT)/Config.mk - ifneq ($(CONFIG_COMPAT),) compat-arch-$(CONFIG_X86) := x86_32 From patchwork Fri Jan 17 10:53:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338761 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 4D0E413A0 for ; Fri, 17 Jan 2020 10:55:25 +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 298302072B for ; Fri, 17 Jan 2020 10:55:25 +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="VYUVDOqq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 298302072B 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 1isPGh-0004xD-Jt; Fri, 17 Jan 2020 10:54:23 +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 1isPGg-0004wj-Tr for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:22 +0000 X-Inumbo-ID: af6d3e4b-3917-11ea-88b0-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id af6d3e4b-3917-11ea-88b0-12813bfff9fa; Fri, 17 Jan 2020 10:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WAzvgb5QtA3Q71diJ/2r7MTArKvBTK8BaKDtrTl7ayg=; b=VYUVDOqqPOyu/x4dvQfaeH4hopNKrZCxTqvErM23MViinPPTLQhjKw2g RMTkfRhjUDE7s9ms6M6lJZLOEHDeIlQIgpZKR6EGazQBDWX+LAy4PIQ+v uNi1qoy4WQLbqi/gHF0d6Y0Dhq92ctvVoz0ni5gCWDJdODkcnFLC1B/rk o=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 6sR9/7VmzZNDFnO3YOvkoGmgwAjGLnTi1LSRGbjlS8ZxNlExmkjJQNi+4sU30sshurFL0Kdgs1 365IePzZr9ke4oE/XZ1FGe5brF9sEUunwbYawAQzhenZecn3LOsjlg5Cnat+T/GyUar1C+wpdN uYIqVfjhWGj1KEQXbYotCKS0mK2SWvn/rJEzIwG/QjoPpZAWheuscP5PYMC6GOcLtO2nMqjEF6 xZXPQQcr6JcNHMIM7O5pO3ecnhLwm+1s4k9mBsj5cdOp71WRME4kE1bkE7mgpS3QO3ASIJMmWh MiM= X-SBRS: 2.7 X-MesageID: 11432451 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432451" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:52 +0000 Message-ID: <20200117105358.607910-7-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 06/12] xen/test/livepatch: remove include of Config.mk 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: Anthony PERARD , Ross Lagerwall , Konrad Rzeszutek Wilk Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" livepatch/Makefile seems to only be used via Rules.mk, which already includes Config.mk, avoid the second include. Signed-off-by: Anthony PERARD Reviewed-by: Ross Lagerwall --- xen/test/livepatch/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile index 82a076aac1eb..148dddb90473 100644 --- a/xen/test/livepatch/Makefile +++ b/xen/test/livepatch/Makefile @@ -1,5 +1,3 @@ -include $(XEN_ROOT)/Config.mk - ifeq ($(XEN_TARGET_ARCH),x86_64) OBJCOPY_MAGIC := -I binary -O elf64-x86-64 -B i386:x86-64 endif From patchwork Fri Jan 17 10:53:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338773 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 3E4CA13A0 for ; Fri, 17 Jan 2020 10:55:41 +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 1A93B2072B for ; Fri, 17 Jan 2020 10:55:41 +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="TOR63abd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A93B2072B 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 1isPGs-00054l-AZ; Fri, 17 Jan 2020 10:54:34 +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 1isPGq-00053T-Ua for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:32 +0000 X-Inumbo-ID: b09611b6-3917-11ea-88b0-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b09611b6-3917-11ea-88b0-12813bfff9fa; Fri, 17 Jan 2020 10:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258449; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NAP4QIGGLf6V9gS58Y3cZrTscYqqhFfgGTi2FgdQPnM=; b=TOR63abdUUZJEwYUsLf7f9i7xxFymt1V9EJmNa5MQIDANd686Dr3zOPn G9AUIU2kYX0JBG4ZZxuRfI8L0UwnSuQ2KqJabpB+avYWFKPeivf5Y/n7+ XqDqvM9VOVL+hNysfXrZnC4Y8WBhS2tGBf0o84C2cH+qDKKnnmp6wobkX w=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Rs6S7nG5noNAalwlnrqiRrFvKGSweGb4fWchfa5+DbSqEBkWi6P5p+hQTBnupfHNBgTRCv+srr nT5vpyVf8gxVmhFwv+6Fu0TmErr2S2WcxS0zopiZLDnHCbyjiszITikArUrKg6ApbQR8gRgjUJ N6FNfzeMhgCXySZQxwL2d5bpFY6/e5Oap1KIyJQH6n+gVBeRUO2XGDIh9cL4pBZEgLugkjPXVe 9OE/wG3tedrJwNvbzqHpTLUHsrgD0hpKeM/3ounrv6mOFlKEM5W5FOgAzafOE4G3vTnQtzNRih itk= X-SBRS: 2.7 X-MesageID: 11432452 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432452" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:53 +0000 Message-ID: <20200117105358.607910-8-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 07/12] xen/build: run targets csopes, tags, .. without Rules.mk 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" Those targets make use of $(all_sources) which depends on TARGET_ARCH, so we just need to set TARGET_ARCH earlier and once. XEN_TARGET_ARCH isn't expected to change during the build, so TARGET_SUBARCH and TARGET_ARCH aren't going to change either. Set them once and for all in the Xen root Makefile. This allow to run more targets without Rules.mk. Signed-off-by: Anthony PERARD --- xen/Makefile | 25 +++++++++++++++---------- xen/Rules.mk | 5 ----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 814011175fd8..0e589de7755e 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -35,6 +35,11 @@ SRCARCH=$(shell echo $(ARCH) | sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g') # we need XEN_TARGET_ARCH to generate the proper config include $(XEN_ROOT)/Config.mk +# Set ARCH/SUBARCH appropriately. +export TARGET_SUBARCH := $(XEN_TARGET_ARCH) +export TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \ + sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g') + # Allow someone to change their config file export KCONFIG_CONFIG ?= .config @@ -46,8 +51,8 @@ dist: install build install:: include/config/auto.conf -.PHONY: build install uninstall clean distclean cscope TAGS tags MAP gtags tests -build install uninstall debug clean distclean cscope TAGS tags MAP gtags tests:: +.PHONY: build install uninstall clean distclean MAP tests +build install uninstall debug clean distclean MAP tests:: ifneq ($(XEN_TARGET_ARCH),x86_32) $(MAKE) -f Rules.mk _$@ else @@ -220,25 +225,25 @@ endef xenversion: @echo $(XEN_FULLVERSION) -.PHONY: _TAGS -_TAGS: +.PHONY: TAGS +TAGS: set -e; rm -f TAGS; \ $(call set_exuberant_flags,etags); \ $(all_sources) | xargs etags $$exuberant_flags -a -.PHONY: _tags -_tags: +.PHONY: tags +tags: set -e; rm -f tags; \ $(call set_exuberant_flags,ctags); \ $(all_sources) | xargs ctags $$exuberant_flags -a -.PHONY: _gtags -_gtags: +.PHONY: gtags +gtags: set -e; rm -f GTAGS GSYMS GPATH GRTAGS $(all_sources) | gtags -f - -.PHONY: _cscope -_cscope: +.PHONY: cscope +cscope: $(all_sources) > cscope.files cscope -k -b -q diff --git a/xen/Rules.mk b/xen/Rules.mk index deab0abd63e1..d20521cc9ec1 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -27,11 +27,6 @@ ifneq ($(origin verbose),undefined) $(error "You must use 'make menuconfig' to enable/disable verbose now.") endif -# Set ARCH/SUBARCH appropriately. -override TARGET_SUBARCH := $(XEN_TARGET_ARCH) -override TARGET_ARCH := $(shell echo $(XEN_TARGET_ARCH) | \ - sed -e 's/x86.*/x86/' -e s'/arm\(32\|64\)/arm/g') - TARGET := $(BASEDIR)/xen # Note that link order matters! From patchwork Fri Jan 17 10:53:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338771 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 A51EF184C for ; Fri, 17 Jan 2020 10:55:29 +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 81A7A2072B for ; Fri, 17 Jan 2020 10:55:29 +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="O9pLZaTU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81A7A2072B 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 1isPGm-00050g-WD; Fri, 17 Jan 2020 10:54:28 +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 1isPGl-0004zn-UK for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:27 +0000 X-Inumbo-ID: b09611b7-3917-11ea-88b0-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b09611b7-3917-11ea-88b0-12813bfff9fa; Fri, 17 Jan 2020 10:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258449; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iAmpS5V60ZZUaAl6culBzBWtbpVPoDXsvk/RdPpBmE4=; b=O9pLZaTU9qzpkFNz/Ur/lK5GTcDQHyMJR9qpGstarpbR+IRq9uIn3BgL Jjmjnywq9wzOpTaJzOv1urMI2nFC7JCbJHRAzEnw8sM3G/2vBU/ta+Y60 RJvSMV+/YSxRSFRrvHrVhLmVlCZuc6oSHg1LRGF7HEnAFeATYlkFe9C+t Q=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: VBXbmtHhuZOneTPoDPRc7PI4q+ogSKIZgjO3H7y6UtN40xfBWcPs6o+5bihbycwezqQ2XRPk3I gylLNUQvzM+rfhtHJArvZLcwJ5ho+JF189lLs/B4oO8cOI511KEPaLPgXuBri9BxwwlfbZr/jx 3oXbiwRgzrPr3j/r2MS3DSjYyrUZz87dXswBLZFh1WNxumbXReX7aync/2rF8TZWpUj2JcOYhP HbGT63CHG5sbur/a3tIjAAWk4HD6/q8oZuCOwViVNiUVBUbbHPhZYqGCvnbT/rzwGLz9R1IdVa +l0= X-SBRS: 2.7 X-MesageID: 11432453 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432453" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:54 +0000 Message-ID: <20200117105358.607910-9-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 08/12] xen/build: make tests in test/ directly 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" It is unnecessary to make _tests via Rules.mk because the target use Rules.mk as well. Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- xen/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 0e589de7755e..5d72d82be260 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -51,8 +51,8 @@ dist: install build install:: include/config/auto.conf -.PHONY: build install uninstall clean distclean MAP tests -build install uninstall debug clean distclean MAP tests:: +.PHONY: build install uninstall clean distclean MAP +build install uninstall debug clean distclean MAP:: ifneq ($(XEN_TARGET_ARCH),x86_32) $(MAKE) -f Rules.mk _$@ else @@ -92,8 +92,8 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX) fi; \ fi -.PHONY: _tests -_tests: +.PHONY: tests +tests: $(MAKE) -f $(BASEDIR)/Rules.mk -C test tests .PHONY: _uninstall From patchwork Fri Jan 17 10:53:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338775 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 A56D513A0 for ; Fri, 17 Jan 2020 10:55:44 +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 8239220684 for ; Fri, 17 Jan 2020 10:55:44 +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="LpYsv/EQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8239220684 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 1isPGw-00059Q-VH; Fri, 17 Jan 2020 10:54:38 +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 1isPGv-00058Y-Uc for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 10:54:37 +0000 X-Inumbo-ID: b09611ba-3917-11ea-88b0-12813bfff9fa Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b09611ba-3917-11ea-88b0-12813bfff9fa; Fri, 17 Jan 2020 10:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579258450; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LaphY/Wb0DAuUkTPlnnMYYpiHVvbGwNvxFTaKuuzcKQ=; b=LpYsv/EQeCyOaCUz5ejyNYhKqn1k1m0EOpUxsZ9EJaZvUSo6OV5+zpza k9+X3GN42PUvTzs7AAlClkW1F8/q444g8oVlCYaw3GqHoWZc8+eNuGvYS +sGLiLL0kv+XodjCN25NtCLeOinz7U7yBgPYSEJvysIPNsAWpjMjMnewv 4=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: mZ/axXkLv4mosDufcIu1sg15iqUY+GdsZPTCs6XS7F1+Ne3oGSs75wp7FDvCTqvNUSXtz6/bQ7 Zbl/RVEshULPx5XX2VXrAmESyQCEmnhVM1TtCUTkKwzcIUp36VTwzk2t8vVxQhtrQGRonyGrzZ mR0uMFXopOkDb6EQOlw3KSqrW519diKuVNhlFiPgdTth9ug3qOXpaDqy9BR5WetPuMSZYqQnRU Fg7uey6ioK8lQdayIAq7hOzozMLl9XvyC+ft40JxfQIDhj3WIimfBSgI6WBeK+FPlJDLGR7g+g sco= X-SBRS: 2.7 X-MesageID: 11432454 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432454" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:55 +0000 Message-ID: <20200117105358.607910-10-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 09/12] xen/build: include include/config/auto.conf in main Makefile 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" We are going to generate the CFLAGS early from "xen/Makefile" instead of in "Rules.mk", but we need to include "config/auto.conf", so include it in "Makefile". Before including "config/auto.conf" we check which make target a user is calling, as some targets don't need "auto.conf". For targets that needs auto.conf, make will generate it (and a default .config if missing). root-make-done is to avoid doing the calculation again once Rules.mk takes over and is been executed with the root Makefile. When Rules.mk is including xen/Makefile, `config-build' and `need-config' are undefined so auto.conf will not be included again (it is already included by Rules.mk) and kconfig target are out of reach of Rules.mk. The way targets are filtered is inspireds by Kbuild, with some code imported from Linux. That's why there is PHONY variable that isn't used yet, for example. Signed-off-by: Anthony PERARD --- xen/Makefile | 96 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 73 insertions(+), 23 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 5d72d82be260..80679b4a6b17 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -49,7 +49,71 @@ default: build .PHONY: dist dist: install -build install:: include/config/auto.conf + +ifndef root-make-done +# section to run before calling Rules.mk, but only once. +# +# To make sure we do not include .config for any of the *config targets +# catch them early, and hand them over to tools/kconfig/Makefile + +clean-targets := %clean +no-dot-config-targets := $(clean-targets) \ + uninstall debug cloc \ + cscope TAGS tags MAP gtags \ + xenversion + +config-build := +need-config := 1 + +ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) + ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),) + need-config := + endif +endif + +ifneq ($(filter config %config,$(MAKECMDGOALS)),) + config-build := 1 +endif + +export root-make-done := 1 +endif # root-make-done + +ifdef config-build +# =========================================================================== +# *config targets only - make sure prerequisites are updated, and descend +# in tools/kconfig to make the *config target + +config: FORCE + $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" $@ + +# Config.mk tries to include .config file, don't try to remake it +%/.config: ; + +%config: FORCE + $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" $@ + +else # !config-build + +ifdef need-config +include include/config/auto.conf +# Read in dependencies to all Kconfig* files, make sure to run syncconfig if +# changes are detected. +include include/config/auto.conf.cmd + +# Allow people to just run `make` as before and not force them to configure +$(KCONFIG_CONFIG): + $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" defconfig + +# The actual configuration files used during the build are stored in +# include/generated/ and include/config/. Update them if .config is newer than +# include/config/auto.conf (which mirrors .config). +# +# This exploits the 'multi-target pattern rule' trick. +# The syncconfig should be executed only once to make all the targets. +%/auto.conf %/auto.conf.cmd: $(KCONFIG_CONFIG) + $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" syncconfig + +endif # need-config .PHONY: build install uninstall clean distclean MAP build install uninstall debug clean distclean MAP:: @@ -251,9 +315,6 @@ cscope: _MAP: $(NM) -n $(TARGET)-syms | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' > System.map -.PHONY: FORCE -FORCE: - %.o %.i %.s: %.c FORCE $(MAKE) -f $(BASEDIR)/Rules.mk -C $(*D) $(@F) @@ -274,25 +335,6 @@ $(foreach base,arch/x86/mm/guest_walk_% \ arch/x86/mm/shadow/guest_%, \ $(foreach ext,o i s,$(call build-intermediate,$(base).$(ext)))) -kconfig := oldconfig config menuconfig defconfig \ - nconfig xconfig gconfig savedefconfig listnewconfig olddefconfig \ - randconfig $(notdir $(wildcard arch/$(SRCARCH)/configs/*_defconfig)) -.PHONY: $(kconfig) -$(kconfig): - $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" $@ - -include/config/%.conf: include/config/auto.conf.cmd $(KCONFIG_CONFIG) - $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" syncconfig - -# Allow people to just run `make` as before and not force them to configure -$(KCONFIG_CONFIG): - $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" defconfig - -# Break the dependency chain for the first run -include/config/auto.conf.cmd: ; - --include $(BASEDIR)/include/config/auto.conf.cmd - .PHONY: cloc cloc: $(eval tmpfile := $(shell mktemp)) @@ -304,3 +346,11 @@ cloc: cloc --list-file=$(tmpfile) rm $(tmpfile) +endif #config-build + +PHONY += FORCE +FORCE: + +# Declare the contents of the PHONY variable as phony. We keep that +# information in a variable so we can use it in if_changed and friends. +.PHONY: $(PHONY) From patchwork Fri Jan 17 10:53:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338801 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 9E3DC138D for ; Fri, 17 Jan 2020 11:12:10 +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 6F75A20730 for ; Fri, 17 Jan 2020 11:12:10 +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="IjqBY+6A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F75A20730 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 1isPWi-0007u6-VQ; Fri, 17 Jan 2020 11:10:56 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1isPWg-0007tk-SY for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 11:10:54 +0000 X-Inumbo-ID: 01e37674-391a-11ea-9fd7-bc764e2007e4 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 01e37674-391a-11ea-9fd7-bc764e2007e4; Fri, 17 Jan 2020 11:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579259445; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WMMxf261yZFm98J72ZI4r5ZfmwhU0um+ejkqtC3XHBc=; b=IjqBY+6AkM7JhbKKdTwrVyGDYPMmk3QuzgzOXEx1p2oO/KalQ0hS+kpr HIo1K2hxPGlmEM+ykTGp5bExAMRcQx3JZpIBUMl0u+X1WDZYWGiQBA6ZV v9FvoP+ctg2/NN6cShDU1JnSndhjGSsERAZAyfaP17+5KAe1ZOmUZWMY+ w=; Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: LVVs/Owpvn3TI4Uy0zuUaNdqNqBJkLHoDNxhwzhYM2wYQqiVrX64NbioyfTY9NxtQQUS6rWY5S BU4z+7jm06iQ3Fd398ONsoTw3cVUBlDQ7jXS13Q7OXJdxq/pxKsZGcce+7nHyq8fve0gS/fheH 6H5JUbEHj2U9XiAE+qGY/ghzwbms2PxzRUirIqLWmVxdjylCVMh0wvTOJo3k6bALz3mVdZOr6I EJ9EkzFXaQ9CCw7zunWxZb3XEYkJW01JJT9W0rWTgqmYWzt8GaHR4GGAEVeUg0AiVOPK1ZbBCQ jkI= X-SBRS: 2.7 X-MesageID: 11432982 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11432982" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:56 +0000 Message-ID: <20200117105358.607910-11-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 10/12] xen/build: use new $(c_flags) and $(a_flags) instead of $(CFLAGS) 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 , Tim Deegan , Anthony PERARD , Jan Beulich , Anthony PERARD , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Anthony PERARD We would like to calculate CFLAGS once and before calling Rules.mk, so the variable CFLAGS needs to have the same value across the whole build. Thus we need a new variable where some flags can change depending on the target name. Both the dependency and __OBJECT_FILE__ are such flags that change depending on the target, so there are move out of $(CFLAGS). __OBJECT_FILE__ is only used by arch/x86/mm/*.c files, so having it in $(c_flags) is enough, we don't need it in $(a_flags). This is inspired by the way Kbuild generates CFLAGS for each targets. Signed-off-by: Anthony PERARD --- xen/Rules.mk | 27 +++++++++++++++------------ xen/arch/arm/Makefile | 4 ++-- xen/arch/x86/Makefile | 6 +++--- xen/arch/x86/mm/Makefile | 6 +++--- xen/arch/x86/mm/hap/Makefile | 6 +++--- xen/arch/x86/mm/shadow/Makefile | 6 +++--- xen/include/Makefile | 2 +- 7 files changed, 30 insertions(+), 27 deletions(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index d20521cc9ec1..c98d5372f3db 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -57,7 +57,6 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith $(call cc-option-add,CFLAGS,CC,-Wvla) CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS-$(CONFIG_DEBUG_INFO) += -g -CFLAGS += '-D__OBJECT_FILE__="$@"' ifneq ($(CONFIG_CC_IS_CLANG),y) # Clang doesn't understand this command line argument, and doesn't appear to @@ -70,9 +69,6 @@ AFLAGS-y += -D__ASSEMBLY__ ALL_OBJS := $(ALL_OBJS-y) -# Get gcc to generate the dependencies for us. -CFLAGS-y += -MMD -MF $(@D)/.$(@F).d - CFLAGS += $(CFLAGS-y) # allow extra CFLAGS externally via EXTRA_CFLAGS_XEN_CORE CFLAGS += $(EXTRA_CFLAGS_XEN_CORE) @@ -141,9 +137,16 @@ endif # Always build obj-bin files as binary even if they come from C source. $(obj-bin-y): CFLAGS := $(filter-out -flto,$(CFLAGS)) +c_flags = -MMD -MF $(@D)/.$(@F).d \ + $(CFLAGS) \ + '-D__OBJECT_FILE__="$@"' + +a_flags = -MMD -MF $(@D)/.$(@F).d \ + $(AFLAGS) + built_in.o: $(obj-y) $(extra-y) ifeq ($(obj-y),) - $(CC) $(CFLAGS) -c -x c /dev/null -o $@ + $(CC) $(c_flags) -c -x c /dev/null -o $@ else ifeq ($(CONFIG_LTO),y) $(LD_LTO) -r -o $@ $(filter-out $(extra-y),$^) @@ -154,7 +157,7 @@ endif built_in_bin.o: $(obj-bin-y) $(extra-y) ifeq ($(obj-bin-y),) - $(CC) $(AFLAGS) -c -x assembler /dev/null -o $@ + $(CC) $(a_flags) -c -x assembler /dev/null -o $@ else $(LD) $(LDFLAGS) -r -o $@ $(filter-out $(extra-y),$^) endif @@ -173,7 +176,7 @@ SRCPATH := $(patsubst $(BASEDIR)/%,%,$(CURDIR)) %.o: %.c Makefile ifeq ($(CONFIG_ENFORCE_UNIQUE_SYMBOLS),y) - $(CC) $(CFLAGS) -c $< -o $(@D)/.$(@F).tmp + $(CC) $(c_flags) -c $< -o $(@D)/.$(@F).tmp ifeq ($(CONFIG_CC_IS_CLANG),y) $(OBJCOPY) --redefine-sym $<=$(SRCPATH)/$< $(@D)/.$(@F).tmp $@ else @@ -181,11 +184,11 @@ else endif rm -f $(@D)/.$(@F).tmp else - $(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(c_flags) -c $< -o $@ endif %.o: %.S Makefile - $(CC) $(AFLAGS) -c $< -o $@ + $(CC) $(a_flags) -c $< -o $@ SPECIAL_DATA_SECTIONS := rodata $(foreach a,1 2 4 8 16, \ $(foreach w,1 2 4, \ @@ -206,13 +209,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): %.init.o: %.o Makefile $(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@ %.i: %.c Makefile - $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) $< -o $@ + $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) $< -o $@ %.s: %.c Makefile - $(CC) $(filter-out -Wa$(comma)%,$(CFLAGS)) -S $< -o $@ + $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@ # -std=gnu{89,99} gets confused by # as an end-of-line comment marker %.s: %.S Makefile - $(CPP) $(filter-out -Wa$(comma)%,$(AFLAGS)) $< -o $@ + $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) $< -o $@ -include $(DEPS_INCLUDE) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 1044c2298a05..7f1427630b96 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -121,10 +121,10 @@ $(TARGET)-syms: prelink.o xen.lds rm -f $(@D)/.$(@F).[0-9]* asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c - $(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $< + $(CC) $(filter-out -flto,$(c_flags)) -S -o $@ $< xen.lds: xen.lds.S - $(CC) -P -E -Ui386 $(AFLAGS) -o $@ $< + $(CC) -P -E -Ui386 $(a_flags) -o $@ $< sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new mv -f .xen.lds.d.new .xen.lds.d diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 461d1f3dc2a6..472e3fadb719 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -225,7 +225,7 @@ efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o efi/relocs-dummy.o: $(B efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o efi/relocs-dummy.o: ; asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(BASEDIR)/include/asm-x86/asm-macros.h - $(CC) $(filter-out -Wa$(comma)% -flto,$(CFLAGS)) -S -o $@ $< + $(CC) $(filter-out -Wa$(comma)% -flto,$(c_flags)) -S -o $@ $< asm-macros.i: CFLAGS += -D__ASSEMBLY__ -P @@ -241,12 +241,12 @@ $(BASEDIR)/include/asm-x86/asm-macros.h: asm-macros.i Makefile $(call move-if-changed,$@.new,$@) xen.lds: xen.lds.S - $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $< + $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(a_flags)) -o $@ $< sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new mv -f .$(@F).d.new .$(@F).d efi.lds: xen.lds.S - $(CC) -P -E -Ui386 -DEFI $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $< + $(CC) -P -E -Ui386 -DEFI $(filter-out -Wa$(comma)%,$(a_flags)) -o $@ $< sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new mv -f .$(@F).d.new .$(@F).d diff --git a/xen/arch/x86/mm/Makefile b/xen/arch/x86/mm/Makefile index d87dc0aa6eeb..a2431fde6bb4 100644 --- a/xen/arch/x86/mm/Makefile +++ b/xen/arch/x86/mm/Makefile @@ -12,10 +12,10 @@ obj-$(CONFIG_HVM) += p2m-ept.o p2m-pod.o obj-y += paging.o guest_walk_%.o: guest_walk.c Makefile - $(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ + $(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ guest_walk_%.i: guest_walk.c Makefile - $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ + $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ guest_walk_%.s: guest_walk.c Makefile - $(CC) $(filter-out -Wa$(comma)%,$(CFLAGS)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@ + $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@ diff --git a/xen/arch/x86/mm/hap/Makefile b/xen/arch/x86/mm/hap/Makefile index b14a9aff93d2..22e7ad54bd33 100644 --- a/xen/arch/x86/mm/hap/Makefile +++ b/xen/arch/x86/mm/hap/Makefile @@ -6,10 +6,10 @@ obj-y += nested_hap.o obj-y += nested_ept.o guest_walk_%level.o: guest_walk.c Makefile - $(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ + $(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ guest_walk_%level.i: guest_walk.c Makefile - $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ + $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ guest_walk_%level.s: guest_walk.c Makefile - $(CC) $(filter-out -Wa$(comma)%,$(CFLAGS)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@ + $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@ diff --git a/xen/arch/x86/mm/shadow/Makefile b/xen/arch/x86/mm/shadow/Makefile index ff03a9937f9b..23d3ff10802c 100644 --- a/xen/arch/x86/mm/shadow/Makefile +++ b/xen/arch/x86/mm/shadow/Makefile @@ -7,10 +7,10 @@ obj-y += none.o endif guest_%.o: multi.c Makefile - $(CC) $(CFLAGS) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ + $(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ guest_%.i: multi.c Makefile - $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ + $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@ guest_%.s: multi.c Makefile - $(CC) $(filter-out -Wa$(comma)%,$(CFLAGS)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@ + $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@ diff --git a/xen/include/Makefile b/xen/include/Makefile index 433bad9055b2..83131c2472f5 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -64,7 +64,7 @@ compat/%.h: compat/%.i Makefile $(BASEDIR)/tools/compat-build-header.py mv -f $@.new $@ compat/%.i: compat/%.c Makefile - $(CPP) $(filter-out -Wa$(comma)% -M% %.d -include %/include/xen/config.h,$(CFLAGS)) $(cppflags-y) -o $@ $< + $(CPP) $(filter-out -Wa$(comma)% -M% %.d -include %/include/xen/config.h,$(c_flags)) $(cppflags-y) -o $@ $< compat/%.c: public/%.h xlat.lst Makefile $(BASEDIR)/tools/compat-build-source.py mkdir -p $(@D) From patchwork Fri Jan 17 10:53:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338803 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 14730109A for ; Fri, 17 Jan 2020 11:12:18 +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 E4AE820730 for ; Fri, 17 Jan 2020 11:12:17 +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="TT5NBwrR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4AE820730 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 1isPWn-0007vj-8w; Fri, 17 Jan 2020 11:11:01 +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 1isPWm-0007v0-2X for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 11:11:00 +0000 X-Inumbo-ID: 07a1dba0-391a-11ea-b4d2-12813bfff9fa Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 07a1dba0-391a-11ea-b4d2-12813bfff9fa; Fri, 17 Jan 2020 11:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579259456; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FhooL5xAplE5fDlGtrpx8Y+IwHbT9MVN3wLm0Emh++M=; b=TT5NBwrROT1gK+F3L6EozHuQgMY2iOaNoOmpk8qizp+DyXz6cwcCbcM8 g+xxBBNa58/VU66aO/TLc3hPlViGUqUnLSFP0+jFg/4yu2t+coSG4MDbh Vtde8X1KzS3sv5I1dLIyia2gaCwyndJPBODVSJvO2jJ4Vc1HA95lbD7jz A=; 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: D6nNOFmv4egWRSuxL/+krWAaQz1d9vkZSEiDOG1lpoiBfhY9kpLKz1bNHRsY9wGDo5HpQSkr4n DXg8Z0VPMnraGETxYNyvsWLj0Cm+pbNptTV23eTr8KUVGnzwH/z7c6jqtoe8yjf2nmUpW+B3JR 0M++j92CKUpz/hRGFobXUduEbWl8DdAw8rMD0+RnCqZ2z+BDSEWWs/F9osgDcz9IDW+TM7e9Nc tzDG13T6iRQAlhNAOqNqFwYdcnxaa2E8fAnTv32+uWytLgj/NndJFSAjDQx5C8EV9Z0OZkeBpR c6o= X-SBRS: 2.7 X-MesageID: 11080930 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,330,1574139600"; d="scan'208";a="11080930" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:57 +0000 Message-ID: <20200117105358.607910-12-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 11/12] xen/build: introduce ccflags-y and CFLAGS_$@ 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 , Daniel De Graaf , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" We are going to want $(CFLAGS) to be static and never change during the build, so introduce new variables that can be use to change the flags of a single target or of a whole directory. Those two variables are taken from Kbuild, in Linux v5.4. Signed-off-by: Anthony PERARD --- xen/Rules.mk | 7 ++++++- xen/arch/arm/efi/Makefile | 2 +- xen/arch/x86/Makefile | 6 +++--- xen/arch/x86/efi/Makefile | 2 +- xen/common/libelf/Makefile | 2 +- xen/common/libfdt/Makefile | 2 +- xen/xsm/flask/Makefile | 2 +- xen/xsm/flask/ss/Makefile | 2 +- 8 files changed, 15 insertions(+), 10 deletions(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index c98d5372f3db..f0111f2bc1b4 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -39,6 +39,7 @@ ALL_OBJS-$(CONFIG_CRYPTO) += $(BASEDIR)/crypto/built_in.o # Initialise some variables CFLAGS_UBSAN := +ccflags-y := ifeq ($(CONFIG_DEBUG),y) CFLAGS += -O1 @@ -137,9 +138,13 @@ endif # Always build obj-bin files as binary even if they come from C source. $(obj-bin-y): CFLAGS := $(filter-out -flto,$(CFLAGS)) +# target with its suffix stripped +target-stem = $(basename $@) + c_flags = -MMD -MF $(@D)/.$(@F).d \ $(CFLAGS) \ - '-D__OBJECT_FILE__="$@"' + '-D__OBJECT_FILE__="$@"' \ + $(ccflags-y) $(CFLAGS_$(target-stem).o) a_flags = -MMD -MF $(@D)/.$(@F).d \ $(AFLAGS) diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile index d34c9168914a..e4aaba3e074b 100644 --- a/xen/arch/arm/efi/Makefile +++ b/xen/arch/arm/efi/Makefile @@ -1,4 +1,4 @@ -CFLAGS += -fshort-wchar +ccflags-y += -fshort-wchar obj-y += boot.init.o runtime.o obj-$(CONFIG_ACPI) += efi-dom0.init.o diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 472e3fadb719..acf4c145c896 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -174,14 +174,14 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0 export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y) # Check if the linker supports PE. XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y)) -CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI +ccflags-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p') $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A ALT_START$$,,p') ifneq ($(build_id_linker),) ifeq ($(call ld-ver-build-id,$(LD) $(filter -m%,$(EFI_LDFLAGS))),y) -CFLAGS += -DBUILD_ID_EFI +ccflags-y += -DBUILD_ID_EFI EFI_LDFLAGS += $(build_id_linker) note_file := efi/buildid.o # NB: this must be the last input in the linker call, because inputs following @@ -227,7 +227,7 @@ efi/boot.init.o efi/runtime.o efi/compat.o efi/buildid.o efi/relocs-dummy.o: ; asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(BASEDIR)/include/asm-x86/asm-macros.h $(CC) $(filter-out -Wa$(comma)% -flto,$(c_flags)) -S -o $@ $< -asm-macros.i: CFLAGS += -D__ASSEMBLY__ -P +CFLAGS_asm-macros.o += -D__ASSEMBLY__ -P $(BASEDIR)/include/asm-x86/asm-macros.h: asm-macros.i Makefile echo '#if 0' >$@.new diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile index 4bc0a196e9ca..2cbb3de3a8ab 100644 --- a/xen/arch/x86/efi/Makefile +++ b/xen/arch/x86/efi/Makefile @@ -1,4 +1,4 @@ -CFLAGS += -fshort-wchar +ccflags-y += -fshort-wchar %.o: %.ihex $(OBJCOPY) -I ihex -O binary $< $@ diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile index 3d9e38f27e65..9a433f01fbd4 100644 --- a/xen/common/libelf/Makefile +++ b/xen/common/libelf/Makefile @@ -3,7 +3,7 @@ nocov-y += libelf.o SECTIONS := text data $(SPECIAL_DATA_SECTIONS) -CFLAGS += -Wno-pointer-sign +ccflags-y += -Wno-pointer-sign libelf.o: libelf-temp.o Makefile $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@ diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile index c075bbf5462a..9ea5c696d52a 100644 --- a/xen/common/libfdt/Makefile +++ b/xen/common/libfdt/Makefile @@ -5,7 +5,7 @@ SECTIONS := text data $(SPECIAL_DATA_SECTIONS) obj-y += libfdt.o nocov-y += libfdt.o -CFLAGS += -I$(BASEDIR)/include/xen/libfdt/ +ccflags-y += -I$(BASEDIR)/include/xen/libfdt/ libfdt.o: libfdt-temp.o Makefile $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@ diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile index b1fd45421993..3bf0a6fa0456 100644 --- a/xen/xsm/flask/Makefile +++ b/xen/xsm/flask/Makefile @@ -4,7 +4,7 @@ obj-y += flask_op.o obj-y += ss/ -CFLAGS += -I./include +ccflags-y += -I./include AWK = awk diff --git a/xen/xsm/flask/ss/Makefile b/xen/xsm/flask/ss/Makefile index 046ce8f53326..30f910a9c9c1 100644 --- a/xen/xsm/flask/ss/Makefile +++ b/xen/xsm/flask/ss/Makefile @@ -8,4 +8,4 @@ obj-y += services.o obj-y += conditional.o obj-y += mls.o -CFLAGS += -I../include +ccflags-y += -I../include From patchwork Fri Jan 17 10:53:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11338805 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 712F3184C for ; Fri, 17 Jan 2020 11:12:18 +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 376C320730 for ; Fri, 17 Jan 2020 11:12:18 +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="UDzM/8vg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 376C320730 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 1isPWe-0007sx-Fu; Fri, 17 Jan 2020 11:10:52 +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 1isPWd-0007ss-2y for xen-devel@lists.xenproject.org; Fri, 17 Jan 2020 11:10:51 +0000 X-Inumbo-ID: 02c105fd-391a-11ea-b4d2-12813bfff9fa Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 02c105fd-391a-11ea-b4d2-12813bfff9fa; Fri, 17 Jan 2020 11:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579259446; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wn7Ss2pa9Hk1UFN+LeTRRwICRl7+9D3CuFTJ6p2nF3s=; b=UDzM/8vgrlgEa6bM08FGrqS9ivpVh8GAfTsp8drlozExqxp25IKcIL/0 iDgboiKBNWbKi/uNtpRQ5rj2SjjybfZz2gAohg74FsMkjgP5BMusCpnPf pqjKJoH0Hg81x/xBFICayNp27VSkLPnnCvDktJ11NPzQ3O6eLogblKUT1 s=; Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: tyEHTKZAvsglgD6q+NufYUhofc+NqL3XVD0xrq9uZyXhKMwNk7/bP+Zchv5DODnnMCrfu3RdBB aZtBFod28eQCASx6wVMf/xP0ZT2dYoMMw/9C6Pxm7kGiImEj0QGwFy8nvGpxywluCIYpI3uSUe oZZkNZNO+cTOKxPth+HWNBeJsNuXCYUDcrWvWUb1KPhYAZ/dFQdD2B8KN9DyogcWgLMp9dz2Rx +C1InQbycHfH9d2111VCpSILkdxygu0/ijqOxFelYG8Cyw6FXxUX0/haDbFZMvg4HzAFf1A44B FyM= X-SBRS: 2.7 X-MesageID: 11661073 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,329,1574139600"; d="scan'208";a="11661073" From: Anthony PERARD To: Date: Fri, 17 Jan 2020 10:53:58 +0000 Message-ID: <20200117105358.607910-13-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2 12/12] xen/build: have the root Makefile generates the CFLAGS 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 , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Instead of generating the CFLAGS in Rules.mk everytime we enter a new subdirectory, we are going to generate most of them a single time, and export the result in the environment so that Rules.mk can use it. The only flags left to generates are the one that depends on the targets, but the variable $(c_flags) takes care of that. Arch specific CFLAGS are generated by a new file "arch/*/arch.mk" which is included by the root Makefile. In order to allow some variable that are specific to one arch and needs to be regenerated for each target, there's a new variable $(arch_ccflags). When running Rules.mk in the root directory (xen/), the variable `root-make-done' is set, so `need-config' will remain undef and so the root Makefile will not generate the cflags again. There is on FIXME added about LTO build, but since LTO is marked as BROKEN, this commit doesn't attempt to filter -flto flags out of the CFLAGS. Signed-off-by: Anthony PERARD --- xen/Makefile | 70 ++++++++++++++++++++++++++++ xen/Rules.mk | 70 +++++----------------------- xen/arch/arm/Makefile | 10 ++-- xen/arch/arm/Rules.mk | 93 -------------------------------------- xen/arch/arm/arch.mk | 88 ++++++++++++++++++++++++++++++++++++ xen/arch/x86/Makefile | 16 +++---- xen/arch/x86/Rules.mk | 91 +++---------------------------------- xen/arch/x86/arch.mk | 87 +++++++++++++++++++++++++++++++++++ xen/common/libelf/Makefile | 2 +- xen/common/libfdt/Makefile | 2 +- 10 files changed, 278 insertions(+), 251 deletions(-) create mode 100644 xen/arch/arm/arch.mk create mode 100644 xen/arch/x86/arch.mk diff --git a/xen/Makefile b/xen/Makefile index 80679b4a6b17..22ca963994c8 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -113,6 +113,76 @@ $(KCONFIG_CONFIG): %/auto.conf %/auto.conf.cmd: $(KCONFIG_CONFIG) $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" syncconfig +ifeq ($(CONFIG_DEBUG),y) +CFLAGS += -O1 +else +CFLAGS += -O2 +endif + +ifeq ($(CONFIG_FRAME_POINTER),y) +CFLAGS += -fno-omit-frame-pointer +else +CFLAGS += -fomit-frame-pointer +endif + +CFLAGS += -nostdinc -fno-builtin -fno-common +CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith +$(call cc-option-add,CFLAGS,CC,-Wvla) +CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h +CFLAGS-$(CONFIG_DEBUG_INFO) += -g + +ifneq ($(CONFIG_CC_IS_CLANG),y) +# Clang doesn't understand this command line argument, and doesn't appear to +# have an suitable alternative. The resulting compiled binary does function, +# but has an excessively large symbol table. +CFLAGS += -Wa,--strip-local-absolute +endif + +AFLAGS-y += -D__ASSEMBLY__ + +CFLAGS += $(CFLAGS-y) +# allow extra CFLAGS externally via EXTRA_CFLAGS_XEN_CORE +CFLAGS += $(EXTRA_CFLAGS_XEN_CORE) + +# Most CFLAGS are safe for assembly files: +# -std=gnu{89,99} gets confused by #-prefixed end-of-line comments +# -flto makes no sense and annoys clang +AFLAGS += $(AFLAGS-y) $(filter-out -std=gnu% -flto,$(CFLAGS)) + +# LDFLAGS are only passed directly to $(LD) +LDFLAGS += $(LDFLAGS_DIRECT) + +LDFLAGS += $(LDFLAGS-y) + +ifeq ($(CONFIG_COVERAGE),y) +ifeq ($(CONFIG_CC_IS_CLANG),y) + COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping +else + COV_FLAGS := -fprofile-arcs -ftest-coverage +endif +else +COV_FLAGS := +endif + +ifeq ($(CONFIG_UBSAN),y) +CFLAGS_UBSAN := -fsanitize=undefined +else +CFLAGS_UBSAN := +endif + +ifeq ($(CONFIG_LTO),y) +CFLAGS += -flto +LDFLAGS-$(CONFIG_CC_IS_CLANG) += -plugin LLVMgold.so +endif + +include $(BASEDIR)/arch/$(TARGET_ARCH)/arch.mk + +# define new variables to avoid the ones defines in Config.mk +export XEN_CFLAGS := $(CFLAGS) +export XEN_AFLAGS := $(AFLAGS) +export XEN_LDFLAGS := $(LDFLAGS) +export COV_FLAGS CFLAGS_UBSAN + endif # need-config .PHONY: build install uninstall clean distclean MAP diff --git a/xen/Rules.mk b/xen/Rules.mk index f0111f2bc1b4..faf462a0178a 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -38,52 +38,12 @@ ALL_OBJS-y += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o ALL_OBJS-$(CONFIG_CRYPTO) += $(BASEDIR)/crypto/built_in.o # Initialise some variables -CFLAGS_UBSAN := ccflags-y := - -ifeq ($(CONFIG_DEBUG),y) -CFLAGS += -O1 -else -CFLAGS += -O2 -endif - -ifeq ($(CONFIG_FRAME_POINTER),y) -CFLAGS += -fno-omit-frame-pointer -else -CFLAGS += -fomit-frame-pointer -endif - -CFLAGS += -nostdinc -fno-builtin -fno-common -CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -$(call cc-option-add,CFLAGS,CC,-Wvla) -CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h -CFLAGS-$(CONFIG_DEBUG_INFO) += -g - -ifneq ($(CONFIG_CC_IS_CLANG),y) -# Clang doesn't understand this command line argument, and doesn't appear to -# have an suitable alternative. The resulting compiled binary does function, -# but has an excessively large symbol table. -CFLAGS += -Wa,--strip-local-absolute -endif - -AFLAGS-y += -D__ASSEMBLY__ +# Allow arch specific cflags, to be calculated for each objects. +arch_ccflags = ALL_OBJS := $(ALL_OBJS-y) -CFLAGS += $(CFLAGS-y) -# allow extra CFLAGS externally via EXTRA_CFLAGS_XEN_CORE -CFLAGS += $(EXTRA_CFLAGS_XEN_CORE) - -# Most CFLAGS are safe for assembly files: -# -std=gnu{89,99} gets confused by #-prefixed end-of-line comments -# -flto makes no sense and annoys clang -AFLAGS += $(AFLAGS-y) $(filter-out -std=gnu% -flto,$(CFLAGS)) - -# LDFLAGS are only passed directly to $(LD) -LDFLAGS += $(LDFLAGS_DIRECT) - -LDFLAGS += $(LDFLAGS-y) - include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk include Makefile @@ -103,27 +63,19 @@ __subdir-y := $(filter %/, $(obj-y)) subdir-y += $(__subdir-y) obj-y := $(patsubst %/, %/built_in.o, $(obj-y)) -$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -DINIT_SECTIONS_ONLY +$(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): ccflags-y += -DINIT_SECTIONS_ONLY ifeq ($(CONFIG_COVERAGE),y) -ifeq ($(CONFIG_CC_IS_CLANG),y) - COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping -else - COV_FLAGS := -fprofile-arcs -ftest-coverage -endif -$(filter-out %.init.o $(nocov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += $(COV_FLAGS) +$(filter-out %.init.o $(nocov-y),$(obj-y) $(obj-bin-y) $(extra-y)): ccflags-y += $(COV_FLAGS) endif ifeq ($(CONFIG_UBSAN),y) -CFLAGS_UBSAN += -fsanitize=undefined # Any -fno-sanitize= options need to come after any -fsanitize= options $(filter-out %.init.o $(noubsan-y),$(obj-y) $(obj-bin-y) $(extra-y)): \ -CFLAGS += $(filter-out -fno-%,$(CFLAGS_UBSAN)) $(filter -fno-%,$(CFLAGS_UBSAN)) +ccflags-y += $(filter-out -fno-%,$(CFLAGS_UBSAN)) $(filter -fno-%,$(CFLAGS_UBSAN)) endif ifeq ($(CONFIG_LTO),y) -CFLAGS += -flto -LDFLAGS-$(CONFIG_CC_IS_CLANG) += -plugin LLVMgold.so # Would like to handle all object files as bitcode, but objects made from # pure asm are in a different format and have to be collected separately. # Mirror the directory tree, collecting them as built_in_bin.o. @@ -136,18 +88,20 @@ obj-bin-y := endif # Always build obj-bin files as binary even if they come from C source. -$(obj-bin-y): CFLAGS := $(filter-out -flto,$(CFLAGS)) +# FIXME LTO broken, but we would need a different way to filter -flto out +# $(obj-bin-y): CFLAGS := $(filter-out -flto,$(CFLAGS)) # target with its suffix stripped target-stem = $(basename $@) c_flags = -MMD -MF $(@D)/.$(@F).d \ - $(CFLAGS) \ + $(XEN_CFLAGS) \ + $(arch_ccflags) \ '-D__OBJECT_FILE__="$@"' \ $(ccflags-y) $(CFLAGS_$(target-stem).o) a_flags = -MMD -MF $(@D)/.$(@F).d \ - $(AFLAGS) + $(XEN_AFLAGS) built_in.o: $(obj-y) $(extra-y) ifeq ($(obj-y),) @@ -156,7 +110,7 @@ else ifeq ($(CONFIG_LTO),y) $(LD_LTO) -r -o $@ $(filter-out $(extra-y),$^) else - $(LD) $(LDFLAGS) -r -o $@ $(filter-out $(extra-y),$^) + $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter-out $(extra-y),$^) endif endif @@ -164,7 +118,7 @@ built_in_bin.o: $(obj-bin-y) $(extra-y) ifeq ($(obj-bin-y),) $(CC) $(a_flags) -c -x assembler /dev/null -o $@ else - $(LD) $(LDFLAGS) -r -o $@ $(filter-out $(extra-y),$^) + $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter-out $(extra-y),$^) endif # Force execution of pattern rules (for which PHONY cannot be directly used). diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 7f1427630b96..1599e2ba4058 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -96,24 +96,24 @@ prelink_lto.o: $(ALL_OBJS) # Link it with all the binary objects prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o - $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(XEN_LDFLAGS) -r -o $@ $^ else prelink.o: $(ALL_OBJS) - $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(XEN_LDFLAGS) -r -o $@ $^ endif $(TARGET)-syms: prelink.o xen.lds - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \ + $(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o \ $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0 $(NM) -pa --format=sysv $(@D)/.$(@F).0 \ | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort >$(@D)/.$(@F).0.S $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \ + $(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o \ $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1 $(NM) -pa --format=sysv $(@D)/.$(@F).1 \ | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort >$(@D)/.$(@F).1.S $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ + $(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ $(@D)/.$(@F).1.o -o $@ $(NM) -pa --format=sysv $(@D)/$(@F) \ | $(BASEDIR)/tools/symbols --xensyms --sysv --sort \ diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index 022a3a6f82ba..e69de29bb2d1 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -1,93 +0,0 @@ -######################################## -# arm-specific definitions - -# -# If you change any of these configuration options then you must -# 'make clean' before rebuilding. -# - -CFLAGS += -I$(BASEDIR)/include - -$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) -$(call cc-option-add,CFLAGS,CC,-Wnested-externs) - -# Prevent floating-point variables from creeping into Xen. -CFLAGS-$(CONFIG_ARM_32) += -msoft-float -CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15 - -CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic -CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc - -EARLY_PRINTK := n - -ifeq ($(CONFIG_DEBUG),y) - -# See docs/misc/arm/early-printk.txt for syntax - -EARLY_PRINTK_brcm := 8250,0xF040AB00,2 -EARLY_PRINTK_dra7 := 8250,0x4806A000,2 -EARLY_PRINTK_fastmodel := pl011,0x1c090000,115200 -EARLY_PRINTK_exynos5250 := exynos4210,0x12c20000 -EARLY_PRINTK_hikey960 := pl011,0xfff32000 -EARLY_PRINTK_juno := pl011,0x7ff80000 -EARLY_PRINTK_lager := scif,0xe6e60000 -EARLY_PRINTK_midway := pl011,0xfff36000 -EARLY_PRINTK_mvebu := mvebu,0xd0012000 -EARLY_PRINTK_omap5432 := 8250,0x48020000,2 -EARLY_PRINTK_rcar3 := scif,0xe6e88000 -EARLY_PRINTK_seattle := pl011,0xe1010000 -EARLY_PRINTK_sun6i := 8250,0x01c28000,2 -EARLY_PRINTK_sun7i := 8250,0x01c28000,2 -EARLY_PRINTK_thunderx := pl011,0x87e024000000 -EARLY_PRINTK_vexpress := pl011,0x1c090000 -EARLY_PRINTK_xgene-mcdivitt := 8250,0x1c021000,2 -EARLY_PRINTK_xgene-storm := 8250,0x1c020000,2 -EARLY_PRINTK_zynqmp := cadence,0xff000000 - -ifneq ($(EARLY_PRINTK_$(CONFIG_EARLY_PRINTK)),) -EARLY_PRINTK_CFG := $(subst $(comma), ,$(EARLY_PRINTK_$(CONFIG_EARLY_PRINTK))) -else -EARLY_PRINTK_CFG := $(subst $(comma), ,$(CONFIG_EARLY_PRINTK)) -endif - -# Extract configuration from string -EARLY_PRINTK_INC := $(word 1,$(EARLY_PRINTK_CFG)) -EARLY_UART_BASE_ADDRESS := $(word 2,$(EARLY_PRINTK_CFG)) - -# UART specific options -ifeq ($(EARLY_PRINTK_INC),8250) -EARLY_UART_REG_SHIFT := $(word 3,$(EARLY_PRINTK_CFG)) -endif -ifeq ($(EARLY_PRINTK_INC),pl011) -ifneq ($(word 3,$(EARLY_PRINTK_CFG)),) -EARLY_PRINTK_INIT_UART := y -EARLY_PRINTK_BAUD := $(word 3,$(EARLY_PRINTK_CFG)) -endif -endif -ifeq ($(EARLY_PRINTK_INC),scif) -ifneq ($(word 3,$(EARLY_PRINTK_CFG)),) -CFLAGS-y += -DEARLY_PRINTK_VERSION_$(word 3,$(EARLY_PRINTK_CFG)) -else -CFLAGS-y += -DEARLY_PRINTK_VERSION_NONE -endif -endif - -ifneq ($(EARLY_PRINTK_INC),) -EARLY_PRINTK := y -endif - -CFLAGS-$(EARLY_PRINTK) += -DCONFIG_EARLY_PRINTK -CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART -CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\" -CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD) -CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS) -CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_REG_SHIFT=$(EARLY_UART_REG_SHIFT) - -else # !CONFIG_DEBUG - -ifneq ($(CONFIG_EARLY_PRINTK),) -# Early printk is dependant on a debug build. -$(error CONFIG_EARLY_PRINTK enabled for non-debug build) -endif - -endif diff --git a/xen/arch/arm/arch.mk b/xen/arch/arm/arch.mk new file mode 100644 index 000000000000..296d6c6cf526 --- /dev/null +++ b/xen/arch/arm/arch.mk @@ -0,0 +1,88 @@ +######################################## +# arm-specific definitions + +CFLAGS += -I$(BASEDIR)/include + +$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) +$(call cc-option-add,CFLAGS,CC,-Wnested-externs) + +# Prevent floating-point variables from creeping into Xen. +CFLAGS-$(CONFIG_ARM_32) += -msoft-float +CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15 + +CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic +CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc + +EARLY_PRINTK := n + +ifeq ($(CONFIG_DEBUG),y) + +# See docs/misc/arm/early-printk.txt for syntax + +EARLY_PRINTK_brcm := 8250,0xF040AB00,2 +EARLY_PRINTK_dra7 := 8250,0x4806A000,2 +EARLY_PRINTK_fastmodel := pl011,0x1c090000,115200 +EARLY_PRINTK_exynos5250 := exynos4210,0x12c20000 +EARLY_PRINTK_hikey960 := pl011,0xfff32000 +EARLY_PRINTK_juno := pl011,0x7ff80000 +EARLY_PRINTK_lager := scif,0xe6e60000 +EARLY_PRINTK_midway := pl011,0xfff36000 +EARLY_PRINTK_mvebu := mvebu,0xd0012000 +EARLY_PRINTK_omap5432 := 8250,0x48020000,2 +EARLY_PRINTK_rcar3 := scif,0xe6e88000 +EARLY_PRINTK_seattle := pl011,0xe1010000 +EARLY_PRINTK_sun6i := 8250,0x01c28000,2 +EARLY_PRINTK_sun7i := 8250,0x01c28000,2 +EARLY_PRINTK_thunderx := pl011,0x87e024000000 +EARLY_PRINTK_vexpress := pl011,0x1c090000 +EARLY_PRINTK_xgene-mcdivitt := 8250,0x1c021000,2 +EARLY_PRINTK_xgene-storm := 8250,0x1c020000,2 +EARLY_PRINTK_zynqmp := cadence,0xff000000 + +ifneq ($(EARLY_PRINTK_$(CONFIG_EARLY_PRINTK)),) +EARLY_PRINTK_CFG := $(subst $(comma), ,$(EARLY_PRINTK_$(CONFIG_EARLY_PRINTK))) +else +EARLY_PRINTK_CFG := $(subst $(comma), ,$(CONFIG_EARLY_PRINTK)) +endif + +# Extract configuration from string +EARLY_PRINTK_INC := $(word 1,$(EARLY_PRINTK_CFG)) +EARLY_UART_BASE_ADDRESS := $(word 2,$(EARLY_PRINTK_CFG)) + +# UART specific options +ifeq ($(EARLY_PRINTK_INC),8250) +EARLY_UART_REG_SHIFT := $(word 3,$(EARLY_PRINTK_CFG)) +endif +ifeq ($(EARLY_PRINTK_INC),pl011) +ifneq ($(word 3,$(EARLY_PRINTK_CFG)),) +EARLY_PRINTK_INIT_UART := y +EARLY_PRINTK_BAUD := $(word 3,$(EARLY_PRINTK_CFG)) +endif +endif +ifeq ($(EARLY_PRINTK_INC),scif) +ifneq ($(word 3,$(EARLY_PRINTK_CFG)),) +CFLAGS-y += -DEARLY_PRINTK_VERSION_$(word 3,$(EARLY_PRINTK_CFG)) +else +CFLAGS-y += -DEARLY_PRINTK_VERSION_NONE +endif +endif + +ifneq ($(EARLY_PRINTK_INC),) +EARLY_PRINTK := y +endif + +CFLAGS-$(EARLY_PRINTK) += -DCONFIG_EARLY_PRINTK +CFLAGS-$(EARLY_PRINTK_INIT_UART) += -DEARLY_PRINTK_INIT_UART +CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_INC=\"debug-$(EARLY_PRINTK_INC).inc\" +CFLAGS-$(EARLY_PRINTK) += -DEARLY_PRINTK_BAUD=$(EARLY_PRINTK_BAUD) +CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_BASE_ADDRESS=$(EARLY_UART_BASE_ADDRESS) +CFLAGS-$(EARLY_PRINTK) += -DEARLY_UART_REG_SHIFT=$(EARLY_UART_REG_SHIFT) + +else # !CONFIG_DEBUG + +ifneq ($(CONFIG_EARLY_PRINTK),) +# Early printk is dependant on a debug build. +$(error CONFIG_EARLY_PRINTK enabled for non-debug build) +endif + +endif diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index acf4c145c896..6724572eb84b 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -124,32 +124,32 @@ prelink-efi_lto.o: $(ALL_OBJS) efi/runtime.o efi/compat.o # Link it with all the binary objects prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o - $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(XEN_LDFLAGS) -r -o $@ $^ prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink-efi_lto.o efi/boot.init.o - $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(XEN_LDFLAGS) -r -o $@ $^ else prelink.o: $(ALL_OBJS) - $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(XEN_LDFLAGS) -r -o $@ $^ prelink-efi.o: $(ALL_OBJS) efi/boot.init.o efi/runtime.o efi/compat.o - $(LD) $(LDFLAGS) -r -o $@ $(filter-out %/efi/built_in.o,$^) + $(LD) $(XEN_LDFLAGS) -r -o $@ $(filter-out %/efi/built_in.o,$^) endif $(TARGET)-syms: prelink.o xen.lds - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ + $(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0 $(NM) -pa --format=sysv $(@D)/.$(@F).0 \ | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort \ >$(@D)/.$(@F).0.S $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ + $(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1 $(NM) -pa --format=sysv $(@D)/.$(@F).1 \ | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \ >$(@D)/.$(@F).1.S $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ + $(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \ $(@D)/.$(@F).1.o -o $@ $(NM) -pa --format=sysv $(@D)/$(@F) \ | $(BASEDIR)/tools/symbols --xensyms --sysv --sort \ @@ -162,7 +162,7 @@ note.o: $(TARGET)-syms --rename-section=.data=.note.gnu.build-id -S $@.bin $@ rm -f $@.bin -EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10 +EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(XEN_LDFLAGS)) --subsystem=10 EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug EFI_LDFLAGS += --section-alignment=0x200000 --file-alignment=0x20 EFI_LDFLAGS += --major-image-version=$(XEN_VERSION) diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index e69b8e697cc0..7867f9ccef83 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -1,89 +1,10 @@ ######################################## # x86-specific definitions -XEN_IMG_OFFSET := 0x200000 - -CFLAGS += -I$(BASEDIR)/include -CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic -CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default -CFLAGS += -DXEN_IMG_OFFSET=$(XEN_IMG_OFFSET) -CFLAGS += '-D__OBJECT_LABEL__=$(subst /,$$,$(subst -,_,$(subst $(BASEDIR)/,,$(CURDIR))/$@))' - -# Prevent floating-point variables from creeping into Xen. -CFLAGS += -msoft-float - -ifeq ($(CONFIG_CC_IS_CLANG),y) -# Note: Any test which adds -no-integrated-as will cause subsequent tests to -# succeed, and not trigger further additions. -# -# The tests to select whether the integrated assembler is usable need to happen -# before testing any assembler features, or else the result of the tests would -# be stale if the integrated assembler is not used. - -# Older clang's built-in assembler doesn't understand .skip with labels: -# https://bugs.llvm.org/show_bug.cgi?id=27369 -$(call as-option-add,CFLAGS,CC,".L0: .L1: .skip (.L1 - .L0)",,\ - -no-integrated-as) - -# Check whether clang asm()-s support .include. -$(call as-option-add,CFLAGS,CC,".include \"asm/indirect_thunk_asm.h\"",,\ - -no-integrated-as) - -# Check whether clang keeps .macro-s between asm()-s: -# https://bugs.llvm.org/show_bug.cgi?id=36110 -$(call as-option-add,CFLAGS,CC,\ - ".macro FOO;.endm"$$(close); asm volatile $$(open)".macro FOO;.endm",\ - -no-integrated-as) -endif - -$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) -$(call cc-option-add,CFLAGS,CC,-Wnested-externs) -$(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_AS_VMX) -$(call as-option-add,CFLAGS,CC,"crc32 %eax$$(comma)%eax",-DHAVE_AS_SSE4_2) -$(call as-option-add,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_AS_EPT) -$(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND) -$(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE) -$(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT) -$(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED) -$(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB) -$(call as-option-add,CFLAGS,CC,".equ \"x\"$$(comma)1", \ - -U__OBJECT_LABEL__ -DHAVE_AS_QUOTED_SYM \ - '-D__OBJECT_LABEL__=$(subst $(BASEDIR)/,,$(CURDIR))/$$@') -$(call as-option-add,CFLAGS,CC,"invpcid (%rax)$$(comma)%rax",-DHAVE_AS_INVPCID) - -# GAS's idea of true is -1. Clang's idea is 1 -$(call as-option-add,CFLAGS,CC,\ - ".if ((1 > 0) < 0); .error \"\";.endif",,-DHAVE_AS_NEGATIVE_TRUE) - -# Check to see whether the assmbler supports the .nop directive. -$(call as-option-add,CFLAGS,CC,\ - ".L1: .L2: .nops (.L2 - .L1)$$(comma)9",-DHAVE_AS_NOPS_DIRECTIVE) - -CFLAGS += -mno-red-zone -fpic -fno-asynchronous-unwind-tables - -# Xen doesn't use SSE interally. If the compiler supports it, also skip the -# SSE setup for variadic function calls. -CFLAGS += -mno-sse $(call cc-option,$(CC),-mskip-rax-setup) - -# Compile with thunk-extern, indirect-branch-register if avaiable. -ifeq ($(CONFIG_INDIRECT_THUNK),y) -CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register -CFLAGS += -fno-jump-tables +ifdef HAVE_AS_QUOTED_SYM +arch_ccflags += -DHAVE_AS_QUOTED_SYM \ + '-D__OBJECT_LABEL__=$(subst $(BASEDIR)/,,$(CURDIR))/$@' +else +arch_ccflags += '-D__OBJECT_LABEL__=$(subst /,$$,$(subst -,_,$(subst $(BASEDIR)/,,$(CURDIR))/$@))' endif - -# If supported by the compiler, reduce stack alignment to 8 bytes. But allow -# this to be overridden elsewhere. -$(call cc-option-add,CFLAGS-stack-boundary,CC,-mpreferred-stack-boundary=3) -CFLAGS += $(CFLAGS-stack-boundary) - -ifeq ($(CONFIG_UBSAN),y) -# Don't enable alignment sanitisation. x86 has efficient unaligned accesses, -# and various things (ACPI tables, hypercall pages, stubs, etc) are wont-fix. -# It also causes an as-yet-unidentified crash on native boot before the -# console starts. -$(call cc-option-add,CFLAGS_UBSAN,CC,-fno-sanitize=alignment) -endif - -# Set up the assembler include path properly for older toolchains. -CFLAGS += -Wa,-I$(BASEDIR)/include - +arch_ccflags += $(CFLAGS-stack-boundary) diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk new file mode 100644 index 000000000000..1073f6cc99e9 --- /dev/null +++ b/xen/arch/x86/arch.mk @@ -0,0 +1,87 @@ +######################################## +# x86-specific definitions + +export XEN_IMG_OFFSET := 0x200000 + +CFLAGS += -I$(BASEDIR)/include +CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic +CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default +CFLAGS += -DXEN_IMG_OFFSET=$(XEN_IMG_OFFSET) + +# Prevent floating-point variables from creeping into Xen. +CFLAGS += -msoft-float + +ifeq ($(CONFIG_CC_IS_CLANG),y) +# Note: Any test which adds -no-integrated-as will cause subsequent tests to +# succeed, and not trigger further additions. +# +# The tests to select whether the integrated assembler is usable need to happen +# before testing any assembler features, or else the result of the tests would +# be stale if the integrated assembler is not used. + +# Older clang's built-in assembler doesn't understand .skip with labels: +# https://bugs.llvm.org/show_bug.cgi?id=27369 +$(call as-option-add,CFLAGS,CC,".L0: .L1: .skip (.L1 - .L0)",,\ + -no-integrated-as) + +# Check whether clang asm()-s support .include. +$(call as-option-add,CFLAGS,CC,".include \"asm/indirect_thunk_asm.h\"",,\ + -no-integrated-as) + +# Check whether clang keeps .macro-s between asm()-s: +# https://bugs.llvm.org/show_bug.cgi?id=36110 +$(call as-option-add,CFLAGS,CC,\ + ".macro FOO;.endm"$$(close); asm volatile $$(open)".macro FOO;.endm",\ + -no-integrated-as) +endif + +$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) +$(call cc-option-add,CFLAGS,CC,-Wnested-externs) +$(call as-option-add,CFLAGS,CC,"vmcall",-DHAVE_AS_VMX) +$(call as-option-add,CFLAGS,CC,"crc32 %eax$$(comma)%eax",-DHAVE_AS_SSE4_2) +$(call as-option-add,CFLAGS,CC,"invept (%rax)$$(comma)%rax",-DHAVE_AS_EPT) +$(call as-option-add,CFLAGS,CC,"rdrand %eax",-DHAVE_AS_RDRAND) +$(call as-option-add,CFLAGS,CC,"rdfsbase %rax",-DHAVE_AS_FSGSBASE) +$(call as-option-add,CFLAGS,CC,"xsaveopt (%rax)",-DHAVE_AS_XSAVEOPT) +$(call as-option-add,CFLAGS,CC,"rdseed %eax",-DHAVE_AS_RDSEED) +$(call as-option-add,CFLAGS,CC,"clwb (%rax)",-DHAVE_AS_CLWB) +ifeq ($(call as-insn,$(CC) $(CFLAGS),".equ \"x\"$(comma)1",y),y) + export HAVE_AS_QUOTED_SYM := y +endif +$(call as-option-add,CFLAGS,CC,"invpcid (%rax)$$(comma)%rax",-DHAVE_AS_INVPCID) + +# GAS's idea of true is -1. Clang's idea is 1 +$(call as-option-add,CFLAGS,CC,\ + ".if ((1 > 0) < 0); .error \"\";.endif",,-DHAVE_AS_NEGATIVE_TRUE) + +# Check to see whether the assmbler supports the .nop directive. +$(call as-option-add,CFLAGS,CC,\ + ".L1: .L2: .nops (.L2 - .L1)$$(comma)9",-DHAVE_AS_NOPS_DIRECTIVE) + +CFLAGS += -mno-red-zone -fpic -fno-asynchronous-unwind-tables + +# Xen doesn't use SSE interally. If the compiler supports it, also skip the +# SSE setup for variadic function calls. +CFLAGS += -mno-sse $(call cc-option,$(CC),-mskip-rax-setup) + +# Compile with thunk-extern, indirect-branch-register if avaiable. +ifeq ($(CONFIG_INDIRECT_THUNK),y) +CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register +CFLAGS += -fno-jump-tables +endif + +# If supported by the compiler, reduce stack alignment to 8 bytes. But allow +# this to be overridden elsewhere. +$(call cc-option-add,CFLAGS-stack-boundary,CC,-mpreferred-stack-boundary=3) +export CFLAGS-stack-boundary + +ifeq ($(CONFIG_UBSAN),y) +# Don't enable alignment sanitisation. x86 has efficient unaligned accesses, +# and various things (ACPI tables, hypercall pages, stubs, etc) are wont-fix. +# It also causes an as-yet-unidentified crash on native boot before the +# console starts. +$(call cc-option-add,CFLAGS_UBSAN,CC,-fno-sanitize=alignment) +endif + +# Set up the assembler include path properly for older toolchains. +CFLAGS += -Wa,-I$(BASEDIR)/include diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile index 9a433f01fbd4..8f8508dd842e 100644 --- a/xen/common/libelf/Makefile +++ b/xen/common/libelf/Makefile @@ -9,4 +9,4 @@ libelf.o: libelf-temp.o Makefile $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@ libelf-temp.o: libelf-tools.o libelf-loader.o libelf-dominfo.o #libelf-relocate.o - $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(XEN_LDFLAGS) -r -o $@ $^ diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile index 9ea5c696d52a..42986e118ebf 100644 --- a/xen/common/libfdt/Makefile +++ b/xen/common/libfdt/Makefile @@ -11,4 +11,4 @@ libfdt.o: libfdt-temp.o Makefile $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@ libfdt-temp.o: $(LIBFDT_OBJS) - $(LD) $(LDFLAGS) -r -o $@ $^ + $(LD) $(XEN_LDFLAGS) -r -o $@ $^ From patchwork Tue Jan 21 13:59:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11343991 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 674411398 for ; Tue, 21 Jan 2020 14:01:31 +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 4355122314 for ; Tue, 21 Jan 2020 14:01:31 +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="GW31KdtR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4355122314 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 1itu4G-000871-Ml; Tue, 21 Jan 2020 13:59:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1itu4F-00086w-4d for xen-devel@lists.xenproject.org; Tue, 21 Jan 2020 13:59:43 +0000 X-Inumbo-ID: 40d4f972-3c56-11ea-b833-bc764e2007e4 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 40d4f972-3c56-11ea-b833-bc764e2007e4; Tue, 21 Jan 2020 13:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579615174; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=q81O0NQnXh4Nf3/E92q2P+Njy9Qpi8zaniekHshzOHQ=; b=GW31KdtRxFXl6L05NfTyy2HuR79svSPv87yPJrd3X1B7WuHHHKL1MlBv pYtWV+Sxy6y8mu3eYWxFknmDoeZYmRu8y5PSZp+BXQgnuZ4kLVve4WD0X /lzSm4I41RwcZUBf1NvTq6rOgZPsUlVVpY7X6WK2JyJ9WLc2WFVKxk9Pg E=; 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: QhGb9cH6s4v0JACVyroKyoqsIdwRmS490XB/NZ8kCr5pn0vi5eBMNLzfOX+eHl7Et7QfZL/zk7 oVo+tD2vg/27dq34wDlId4oDSrEhjGJaU/qvYEY+nQIRkKKfZ7IyT4RojER1gS9asHmCVyV1aZ rkZsnYCHqdD6AO4lvQslB/d5+7dyum38qnJflO1VesHSAo97qE9l8EwnaBQtqS+H861ELrVA7T 1RH6dAphEr8H4U2lUUJqjdoXTdGuM5bfE5n87w+1faHGhcHqmwiLm+6SIeuAKJ2wpf3oqrj57O EjQ= X-SBRS: 2.7 X-MesageID: 11636294 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.70,346,1574139600"; d="scan'208";a="11636294" From: Anthony PERARD To: Date: Tue, 21 Jan 2020 13:59:14 +0000 Message-ID: <20200121135916.1140483-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2.1 13/12] Makefile: Fix install-tests 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 , Anthony PERARD Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The top-level makefile make uses of internal implementation detail of the xen build system. Avoid that by creating a new target "install-tests" in xen/Makefile, and by fixing the top-level Makefile to not call xen/Rules.mk anymore. Signed-off-by: Anthony PERARD Reviewed-by: Jan Beulich --- Makefile | 6 ++---- xen/Makefile | 3 +++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 512d6b73c898..9ad2602f63f0 100644 --- a/Makefile +++ b/Makefile @@ -155,13 +155,11 @@ install-docs: # We only have build-tests install-tests, not uninstall-tests etc. .PHONY: build-tests build-tests: build-xen - export BASEDIR=$(XEN_ROOT)/xen; \ - $(MAKE) -f $$BASEDIR/Rules.mk -C xen/test build + $(MAKE) -C xen tests .PHONY: install-tests install-tests: install-xen - export BASEDIR=$(XEN_ROOT)/xen; \ - $(MAKE) -f $$BASEDIR/Rules.mk -C xen/test install + $(MAKE) -C xen $@ # build xen and the tools and place them in the install # directory. 'make install' should then copy them to the normal system diff --git a/xen/Makefile b/xen/Makefile index c326fee5880e..72bc89924622 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -90,6 +90,9 @@ _install: $(TARGET)$(CONFIG_XEN_INSTALL_SUFFIX) .PHONY: _tests _tests: $(MAKE) -f $(BASEDIR)/Rules.mk -C test tests +.PHONY: install-tests +install-tests: + $(MAKE) -f $(BASEDIR)/Rules.mk -C test install .PHONY: _uninstall _uninstall: D=$(DESTDIR) From patchwork Tue Jan 21 13:59:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11343995 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 E7A16109A for ; Tue, 21 Jan 2020 14:01:43 +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 C40FF24125 for ; Tue, 21 Jan 2020 14:01:43 +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="ZXqiqpu5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C40FF24125 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 1itu4e-0000Ll-BP; Tue, 21 Jan 2020 14:00:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1itu4d-0000Jo-NM for xen-devel@lists.xenproject.org; Tue, 21 Jan 2020 14:00:07 +0000 X-Inumbo-ID: 51da8afc-3c56-11ea-b833-bc764e2007e4 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 51da8afc-3c56-11ea-b833-bc764e2007e4; Tue, 21 Jan 2020 14:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579615202; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wtpMBqUjXBTNLQWEki1dXGxzADeRYoZdTCRuseAfv5M=; b=ZXqiqpu5SA3EVVdwZ0xndneVSReEYv6DUlPGOUAuQd7MkTmZuIIvoNro SEwqweFQHKLKMx7O2hejq65tJH4mX5T+8MyWKZzQshPIXI9eyqZUBof9N Dr/52esA0BmOBzgjXEdduPRK0GgVvZOb7hJIJ/PmQLi6Mu9VSace59fgD c=; Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: aVtWtStx+qP04iNIVTxFBVcA8lCw/u8yFObJMIqJCzsPzjDgy6udw3hn8IR9trw9magpuOTBhD umTU0DxigKFvnfxQP6qwVnagEVWDAzxDIxSwdQiuUA0KY/4WKg4MsZhWD0cm4FpuRjVTUPzAWf UmMWR+JOX3Zcc++U5nkgRE3xkisIzChdjfWDhjZB0ZrSP4/WrEitu8WnANRbppKZ5Q9/f5GffU 4e4b6QF6D60ssdzvV9Kpoo40LYU6221aSMyW7xFJ3AI2RuoMOAdjuVyqZU9Qcos50Bftywlvkv ki0= X-SBRS: 2.7 X-MesageID: 11799417 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,346,1574139600"; d="scan'208";a="11799417" From: Anthony PERARD To: Date: Tue, 21 Jan 2020 13:59:15 +0000 Message-ID: <20200121135916.1140483-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2.1 14/12] squash! xen/build: introduce ccflags-y and CFLAGS_$@ 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 , Anthony PERARD , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" -DXEN_BUILD_EFI and -DBUILD_ID_EFI seems to only be used in xen.lds.S which is build using the AFLAGS, so add those flags only to asflags-y. Signed-off-by: Anthony PERARD --- That fix build of xen.efi. Should add asflags-y into the patch title. --- xen/Rules.mk | 4 +++- xen/arch/x86/Makefile | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index 4051d60addb5..add7cad93e4e 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -39,6 +39,7 @@ ALL_OBJS-$(CONFIG_CRYPTO) += $(BASEDIR)/crypto/built_in.o # Initialise some variables ccflags-y := +asflags-y := # Allow arch specific cflags, to be calculated for each objects. arch_ccflags = @@ -101,7 +102,8 @@ c_flags = -MMD -MF $(@D)/.$(@F).d \ $(ccflags-y) $(CFLAGS_$(target-stem).o) a_flags = -MMD -MF $(@D)/.$(@F).d \ - $(XEN_AFLAGS) + $(XEN_AFLAGS) \ + $(asflags-y) built_in.o: $(obj-y) $(extra-y) ifeq ($(obj-y),) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 191e2173315a..1e013ee31131 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -174,14 +174,14 @@ EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0 export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y) # Check if the linker supports PE. XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y)) -ccflags-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI +asflags-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI $(TARGET).efi: VIRT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A VIRT_START$$,,p') $(TARGET).efi: ALT_BASE = 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's, A ALT_START$$,,p') ifneq ($(build_id_linker),) ifeq ($(call ld-ver-build-id,$(LD) $(filter -m%,$(EFI_LDFLAGS))),y) -ccflags-y += -DBUILD_ID_EFI +asflags-y += -DBUILD_ID_EFI EFI_LDFLAGS += $(build_id_linker) note_file := efi/buildid.o # NB: this must be the last input in the linker call, because inputs following From patchwork Tue Jan 21 13:59:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11343993 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 71D78109A for ; Tue, 21 Jan 2020 14:01:33 +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 4E5CA22314 for ; Tue, 21 Jan 2020 14:01:33 +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="AMrmuOQ+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E5CA22314 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 1itu4a-0008PZ-0f; Tue, 21 Jan 2020 14:00:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1itu4Y-0008KW-M9 for xen-devel@lists.xenproject.org; Tue, 21 Jan 2020 14:00:02 +0000 X-Inumbo-ID: 4c48d60c-3c56-11ea-b833-bc764e2007e4 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4c48d60c-3c56-11ea-b833-bc764e2007e4; Tue, 21 Jan 2020 13:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579615193; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AWPHd+gFksQ+RfViBKMLTOw1lLSHpXqkV5OJYt/ukw8=; b=AMrmuOQ+6iWFsPQhS7zjFKcU1i54HlQ6AHqjQZFhvWsc5dsD23ohwbRA JafJRJpv7HKg8Ow9eiAtwU922XESBbajUdvDEwJiEPPgzY2prQsUtP44Y tzdErCFi0hxmH8eSDkOBwUYL3pFYVikj2sSKznmYy4rjMup3D4kX+1AIT g=; Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: lDgqW8EO3HL3Hjktz3xwyd1Ybo+f7BEP5nKGLkVTp3m7rfR6QPJxVSwNWpbLNjlw00cNvT+b+a uytkCW4yQcQEULPXLuEy+xRx4yGbBDObyHJkmm8S/QIgFFxrxdjgMG5LPO5K2EfqEMTJHlTt4h KggGPmS0f5/fOoy7RJxlJgU0Mo9YkXzc32YvSPf0aIPT5PDbbJ4ZNoQAwc+Q1ctpWSWv33i28Z 0hkC+qogf7XjyAUTzVzTWG5KjPKdCxi6A2zPhM8f809uffpYLU6JoKv4iZ1a6A4JU4HezB0VU/ E3U= X-SBRS: 2.7 X-MesageID: 11799415 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,346,1574139600"; d="scan'208";a="11799415" From: Anthony PERARD To: Date: Tue, 21 Jan 2020 13:59:16 +0000 Message-ID: <20200121135916.1140483-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117105358.607910-1-anthony.perard@citrix.com> References: <20200117105358.607910-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH v2.1 15/12] squash! xen/build: have the root Makefile generates the CFLAGS 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: Anthony PERARD , Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The XEN_BUILD_EFI tests in arch/x86/Makefile was filtering out CFLAGS-y, but according to dd40177c1bc8 ("x86-64/EFI: add CFLAGS to check compile"), it was done to filter out -MF. XEN_CFLAGS doesn't have those flags anymore, so no filtering is needed. Signed-off-by: Anthony PERARD --- xen/arch/x86/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 1e013ee31131..3f7702f42a9d 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -171,7 +171,7 @@ EFI_LDFLAGS += --major-os-version=2 --minor-os-version=0 EFI_LDFLAGS += --major-subsystem-version=2 --minor-subsystem-version=0 # Check if the compiler supports the MS ABI. -export XEN_BUILD_EFI := $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y) +export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 2>/dev/null && echo y) # Check if the linker supports PE. XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y)) asflags-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI