From nobody Mon Feb 9 17:36:17 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1579259511; cv=none; d=zohomail.com; s=zohoarc; b=Rtz47dTDbwzztVwXYD7jpof7Zwy5kEMv6bIpxQQGC/nBWXFEyVG2CGhB1DvfTvrqNIaLAJCSTlsZs9QdeNqRnoawyybGlPtNuxXsDRghUlhN3TxY7Snp9pJnmNmJOjbVeeO+oSbRm4IYdoc28i2lrc+Q22YV32g5cfkNSzzjgHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579259511; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vsi4+PqRgVZ9pIJHpYCuXbfHxQo0HGM/rxy68lbGYJU=; b=OZcnxI3oQI84hSEtmywBbLzuv+mXWIjUJV8koI4iWN7/aSG6uw+NnrGKXevTc/BssCS3qdYFcVsOpmXbRW4JYyHq4gXWZHVjbgcirzYIdPsZDFm7eoITCt95OZU3wwYXp2XSQVnU/SKX9K/AVD3KqwYo0uljrpjD42kFGZuTocU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579259511787951.6037403229273; Fri, 17 Jan 2020 03:11:51 -0800 (PST) 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 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) X-Inumbo-ID: 07a1dba0-391a-11ea-b4d2-12813bfff9fa 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 (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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) +=3D $(BASEDIR)/crypto/built_= in.o =20 # Initialise some variables CFLAGS_UBSAN :=3D +ccflags-y :=3D =20 ifeq ($(CONFIG_DEBUG),y) CFLAGS +=3D -O1 @@ -137,9 +138,13 @@ endif # Always build obj-bin files as binary even if they come from C source.=20 $(obj-bin-y): CFLAGS :=3D $(filter-out -flto,$(CFLAGS)) =20 +# target with its suffix stripped +target-stem =3D $(basename $@) + c_flags =3D -MMD -MF $(@D)/.$(@F).d \ $(CFLAGS) \ - '-D__OBJECT_FILE__=3D"$@"' + '-D__OBJECT_FILE__=3D"$@"' \ + $(ccflags-y) $(CFLAGS_$(target-stem).o) =20 a_flags =3D -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 +=3D -fshort-wchar +ccflags-y +=3D -fshort-wchar =20 obj-y +=3D boot.init.o runtime.o obj-$(CONFIG_ACPI) +=3D 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 +=3D --major-subsystem-version=3D2 --mino= r-subsystem-version=3D0 export XEN_BUILD_EFI :=3D $(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CF= LAGS)) -c efi/check.c -o efi/check.o 2>/dev/null && echo y) # Check if the linker supports PE. XEN_BUILD_PE :=3D $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsyste= m=3D10 -o efi/check.efi efi/check.o 2>/dev/null && echo y)) -CFLAGS-$(XEN_BUILD_EFI) +=3D -DXEN_BUILD_EFI +ccflags-$(XEN_BUILD_EFI) +=3D -DXEN_BUILD_EFI =20 $(TARGET).efi: VIRT_BASE =3D 0x$(shell $(NM) efi/relocs-dummy.o | sed -n '= s, A VIRT_START$$,,p') $(TARGET).efi: ALT_BASE =3D 0x$(shell $(NM) efi/relocs-dummy.o | sed -n 's= , A ALT_START$$,,p') =20 ifneq ($(build_id_linker),) ifeq ($(call ld-ver-build-id,$(LD) $(filter -m%,$(EFI_LDFLAGS))),y) -CFLAGS +=3D -DBUILD_ID_EFI +ccflags-y +=3D -DBUILD_ID_EFI EFI_LDFLAGS +=3D $(build_id_linker) note_file :=3D efi/buildid.o # NB: this must be the last input in the linker call, because inputs follo= wing @@ -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 $@ $< =20 -asm-macros.i: CFLAGS +=3D -D__ASSEMBLY__ -P +CFLAGS_asm-macros.o +=3D -D__ASSEMBLY__ -P =20 $(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 +=3D -fshort-wchar +ccflags-y +=3D -fshort-wchar =20 %.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 +=3D libelf.o =20 SECTIONS :=3D text data $(SPECIAL_DATA_SECTIONS) =20 -CFLAGS +=3D -Wno-pointer-sign +ccflags-y +=3D -Wno-pointer-sign =20 libelf.o: libelf-temp.o Makefile $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=3D.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 :=3D text data $(SPECIAL_DATA_SECTIONS) obj-y +=3D libfdt.o nocov-y +=3D libfdt.o =20 -CFLAGS +=3D -I$(BASEDIR)/include/xen/libfdt/ +ccflags-y +=3D -I$(BASEDIR)/include/xen/libfdt/ =20 libfdt.o: libfdt-temp.o Makefile $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=3D.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 +=3D flask_op.o =20 obj-y +=3D ss/ =20 -CFLAGS +=3D -I./include +ccflags-y +=3D -I./include =20 AWK =3D awk =20 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 +=3D services.o obj-y +=3D conditional.o obj-y +=3D mls.o =20 -CFLAGS +=3D -I../include +ccflags-y +=3D -I../include --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel