From patchwork Thu Nov 25 13:39:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 12639169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A98A6C433FE for ; Thu, 25 Nov 2021 13:47:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.231297.400282 (Exim 4.92) (envelope-from ) id 1mqF6E-0006fd-NH; Thu, 25 Nov 2021 13:47:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 231297.400282; Thu, 25 Nov 2021 13:47:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqF6E-0006dp-ET; Thu, 25 Nov 2021 13:47:42 +0000 Received: by outflank-mailman (input) for mailman id 231297; Thu, 25 Nov 2021 13:47:40 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mqF0I-0007NX-8u for xen-devel@lists.xenproject.org; Thu, 25 Nov 2021 13:41:34 +0000 Received: from esa6.hc3370-68.iphmx.com (esa6.hc3370-68.iphmx.com [216.71.155.175]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 66c97b81-4df5-11ec-9787-a32c541c8605; Thu, 25 Nov 2021 14:41:33 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 66c97b81-4df5-11ec-9787-a32c541c8605 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1637847693; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W9kLV8awBaqF9dybV3WIA0DVErlqsPPM8G6KoE90GX4=; b=B7u1uvrtUsuQn/Olb+NZaa5u8OIRxxTpYOCzXog+peH9mT7lv3amTZAX s84sV6CfFv4EqCox3gc6V+SyMI6pfC4LD0fjYtG/4UDsQ1zwCHyCtd5la Tn2119EGjUEYrNB7Eu+FfS5w/KTzTFAlou1bgcl/D75BhZuBAkouSxSRR Y=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 2AtnMImGH8SE5RsQYLyIPQrcbVa0haZAFKxzaTuB54LjHbjyaXQAKsX/+6hq+wdDnSxAn0uf3I WonahPf+b+KuZtcfXlwvPJwzM2Z6iEWghsksqcswrOibl45VUWRs2chcaWtTi46HdXQIeIgL7K 0UUr0105JH8vC1G7K+9/BUQBBqSoo0nqYtbStTNEfvVc7P6r1mSg5Q7ISi8B4SlAiyo5tpE7YV TSPeO2weMXlKyEUBQhU+UBzmP3VwFqZygDEaNdSDmvcsBO+KNAK1hp4QHf7WAsvxZdDHYky1Lq BLlI1BvCPmAHDheey55/9hjA X-SBRS: 5.1 X-MesageID: 58576698 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:edXt/azUmEmlv5R6z556t+ecwSrEfRIJ4+MujC+fZmUNrF6WrkUPm 2NJDWqAb/+NYTT3eNhyOt7npx8PvpPXmtVrG1NkpSAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnvopW1TYhSEUOZugH9IQM8aZfHAuLeNYYH1500s6wrRk2tQAbeWRWGthh /uj+6UzB3f9s9JEGjp8B3Wr8U4HUFza4Vv0j3R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rbav3nV+2uHEcnsN0XlfJfYYPKBm9rtAyJnyjlOIzLuENNQ7HmmmQ2 TGJDEpKvuLKuYI0roXE3PjWs4ezHuJiNUNGBG2Hv62uPCzX8zP7k49NWeqFZx7HU2bw9Pnwb OlZ1aikYvYGgExLo8x3FLMylfAy4N7mprl7yAV4HSqUMwT3W+04enTfhJtBrKxAwLNdqDCaY EPX94kII6iNNePkDEUVeFgvYNOc2KxGgTLV9/k0fhn3vXcl4LqdXExOFBCQkygBfqBtOYYoz Op96s4b7wuz1kgjPtqc130G8m2NKjoLUrk9t4FcC4ju01J5xlZHaJ3aKyn3/JDQNIkcbhh0e meZ1PjYmrBR5kveaH5iR3HC0N1UiYkKpB0XnkQJIE6Em4adi/I6tPGLHe/bkuiBIs177t9O IronPort-HdrOrdr: A9a23:FOlTQ6ivXU3U8GWEG0Uw5+Bjg3BQXuIji2hC6mlwRA09TySZ// rBoB19726TtN9xYgBZpTnuAsm9qB/nmaKdpLNhWItKPzOW31dATrsSjrcKqgeIc0aVm9K1l5 0QF5SWYOeAdGSS5vya3ODXKbkdKaG8gcKVuds= X-IronPort-AV: E=Sophos;i="5.87,263,1631592000"; d="scan'208";a="58576698" From: Anthony PERARD To: CC: Anthony PERARD , Andrew Cooper , George Dunlap , "Ian Jackson" , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu , Volodymyr Babchuk , "Bertrand Marquis" , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Subject: [XEN PATCH v8 27/47] build: grab common EFI source files in arch specific dir Date: Thu, 25 Nov 2021 13:39:46 +0000 Message-ID: <20211125134006.1076646-28-anthony.perard@citrix.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211125134006.1076646-1-anthony.perard@citrix.com> References: <20211125134006.1076646-1-anthony.perard@citrix.com> MIME-Version: 1.0 Rather than preparing the efi source file, we will make the symbolic link as needed from the build location. The `ln` command is run every time to allow to update the link in case the source tree change location. This patch also introduce "efi_common.mk" which allow to reuse the common make instructions without having to duplicate them into each arch. And now that we have a list of common source file, we can start to remove the links to the source files on clean. Signed-off-by: Anthony PERARD --- Notes: v8: - use symbolic link instead of making a copy of the source - introduce efi_common.mk - remove links to source file on clean - use -iquote for "efi.h" headers in common/efi xen/Makefile | 5 ----- xen/arch/arm/efi/Makefile | 4 ++-- xen/arch/x86/Makefile | 1 + xen/arch/x86/efi/Makefile | 5 +---- xen/common/efi/efi_common.mk | 12 ++++++++++++ 5 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 xen/common/efi/efi_common.mk diff --git a/xen/Makefile b/xen/Makefile index 90e8191f51ce..2a809d577fc3 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -447,11 +447,6 @@ $(TARGET).gz: $(TARGET) $(TARGET): FORCE $(Q)$(MAKE) $(build)=tools $(Q)$(MAKE) $(build)=. include/xen/compile.h - [ -e arch/$(TARGET_ARCH)/efi ] && for f in $$(cd common/efi; echo *.[ch]); \ - do test -r arch/$(TARGET_ARCH)/efi/$$f || \ - ln -nsf ../../../common/efi/$$f arch/$(TARGET_ARCH)/efi/; \ - done; \ - true $(Q)$(MAKE) $(build)=include all $(Q)$(MAKE) $(build)=arch/$(TARGET_ARCH) include $(Q)$(MAKE) $(build)=. arch/$(TARGET_ARCH)/include/asm/asm-offsets.h diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile index 1b1ed06feddc..57616a17cb03 100644 --- a/xen/arch/arm/efi/Makefile +++ b/xen/arch/arm/efi/Makefile @@ -1,4 +1,4 @@ -CFLAGS-y += -fshort-wchar +include $(srctree)/common/efi/efi_common.mk -obj-y += boot.init.o pe.init.o ebmalloc.o runtime.o +obj-y += $(EFIOBJ-y) obj-$(CONFIG_ACPI) += efi-dom0.init.o diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index e8151bf4b111..eabd8d3919a4 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -79,6 +79,7 @@ endif # Allows "clean" to descend into boot/ subdir- += boot +subdir- += efi extra-y += asm-macros.i extra-y += xen.lds diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile index ac815f02cb5e..81fda12a70ea 100644 --- a/xen/arch/x86/efi/Makefile +++ b/xen/arch/x86/efi/Makefile @@ -1,4 +1,4 @@ -CFLAGS-y += -fshort-wchar +include $(srctree)/common/efi/efi_common.mk quiet_cmd_objcopy_o_ihex = OBJCOPY $@ cmd_objcopy_o_ihex = $(OBJCOPY) -I ihex -O binary $< $@ @@ -8,9 +8,6 @@ $(obj)/%.o: $(src)/%.ihex FORCE $(obj)/boot.init.o: $(obj)/buildid.o -EFIOBJ-y := boot.init.o pe.init.o ebmalloc.o runtime.o -EFIOBJ-$(CONFIG_COMPAT) += compat.o - $(call cc-option-add,cflags-stack-boundary,CC,-mpreferred-stack-boundary=4) $(addprefix $(obj)/,$(EFIOBJ-y)): CFLAGS-stack-boundary := $(cflags-stack-boundary) diff --git a/xen/common/efi/efi_common.mk b/xen/common/efi/efi_common.mk new file mode 100644 index 000000000000..d2845fd6b3c8 --- /dev/null +++ b/xen/common/efi/efi_common.mk @@ -0,0 +1,12 @@ +EFIOBJ-y := boot.init.o pe.init.o ebmalloc.o runtime.o +EFIOBJ-$(CONFIG_COMPAT) += compat.o + +CFLAGS-y += -fshort-wchar +CFLAGS-y += -iquote $(srctree)/common/efi + +$(obj)/%.c: $(abs_srctree)/common/efi/%.c FORCE + $(Q)ln -nfs $< $@ + +clean-files += $(patsubst %.o,%.c, $(EFIOBJ-y:.init.o=.o) $(EFIOBJ-)) + +.PRECIOUS: $(obj)/%.c