[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH v7 42/51] build: grab common EFI source files in arch specific dir


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 24 Aug 2021 11:50:29 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Ian Jackson" <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 24 Aug 2021 11:02:35 +0000
  • Ironport-hdrordr: A9a23:zHusYqHDoOblToX6pLqFVJHXdLJyesId70hD6qkvc3Fom52j/f xGws5x6fatskd2ZJkh8erhBEDyewKkyXcV2/hbAV7MZniDhILFFu9fBOjZsnfd8k/Fh4lgPM 5bGsATZ+EYZmIK7voSlTPIdurIt+P3kpxA692+815dCSVRL41w5QZwDQiWVmdsQhNdOJY/HJ 2AouJaujuJYx0sH4iGL0hAe9KGi8zAlZrgbxJDLQUg8hOygTSh76O/OwSE3y0ZTyhEzd4ZgC f4ek3Cl+ueWsOAu1/hPlzontdrcRzau5l+7fm3+4kow/PX+0OVjcpaKvm/VXsO0ZmSAR4R4a LxSlEbTolOAjrqDxuIiAqo1A/63Dk07Xj+jVeenHv4uMT8ACk3EsxbmOtiA23kAmcbzaVBOZ hwrhWkXltsfGL9tTW448KNWwBhl0Kyr3ZnmekPj2ZHWY9bbLNKt4QQ8E5cDZ9FRUvBmcgaOf grCNuZ6OddcFucYXyctm5zwMa0VnB2GhudWEANtsGczjATlnFkyEkTwtAZgx47hdsAYogB4/ 6BPrVjlblIQMNTZaVhBP0ZSc/yEWDJSQKkChPmHb0mLtB0B5vpke+I3FwY3pDXRHU49upApH 2aaiIkiYcbQTOQNeSemIZM7g3ABH6gWDiF8LAv26RE
  • Ironport-sdr: sBd9LM/q+xd6T31KeR1NTNpwbKnsYI8CEIgHeVqYZUvX+P4xEF0szHPATeiBiwnZDdBC6UdAqq LsNqzL7J/Zgj/Eq0DX/z+wmM9zhdnKevPqh7Q8Bx9K2AnS+UFG9WnY/B+OqQFr2wENvaGmYm9I d/b/cMi0J+v8oZxcRBxHBzowIWWLG1H5y94HAkf1k5mu9SInwVVJA6DwC7TBnc98Av+Ve77IKT WYDPu0SdRjpaDHvtfyXXDIur3rUC+2nI3pMSSuGpuYYUJ3y0MVZSIdYC3mURJLPdlRcHW6iJiQ 0T/KDwrxSHPps9A1vM1emIoW
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Rather than preparing the efi source file, we will copy them as needed
from the build location.

Avoid the links as they seems fragile in out-of-tree builds. Also by
making a copy, we don't need to figure out the relative path or we
don't need to use absolute path.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 xen/Makefile              | 5 -----
 xen/arch/arm/efi/Makefile | 6 ++++++
 xen/arch/x86/efi/Makefile | 6 ++++++
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 950bee10ba38..4c1dd9ce2ea1 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -425,11 +425,6 @@ $(TARGET).gz: $(TARGET)
 $(TARGET): tools_fixdep FORCE
        $(MAKE) $(build)=tools
        $(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
        $(MAKE) $(build)=include all
        $(MAKE) $(build)=arch/$(TARGET_ARCH) include
        $(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..36e15ac280cd 100644
--- a/xen/arch/arm/efi/Makefile
+++ b/xen/arch/arm/efi/Makefile
@@ -1,4 +1,10 @@
 CFLAGS-y += -fshort-wchar
+CFLAGS-y += -I$(srctree)/common/efi
 
 obj-y += boot.init.o pe.init.o ebmalloc.o runtime.o
 obj-$(CONFIG_ACPI) +=  efi-dom0.init.o
+
+$(obj)/%.c: common/efi/%.c
+       $(Q)cp -f $< $@
+
+.PRECIOUS: $(obj)/%.c
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index ac815f02cb5e..da05935a9348 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -1,4 +1,5 @@
 CFLAGS-y += -fshort-wchar
+CFLAGS-y += -I$(srctree)/common/efi
 
 quiet_cmd_objcopy_o_ihex = OBJCOPY $@
 cmd_objcopy_o_ihex = $(OBJCOPY) -I ihex -O binary $< $@
@@ -19,3 +20,8 @@ obj-$(XEN_BUILD_EFI) := $(filter-out %.init.o,$(EFIOBJ-y))
 obj-bin-$(XEN_BUILD_EFI) := $(filter %.init.o,$(EFIOBJ-y))
 extra-$(XEN_BUILD_EFI) += buildid.o relocs-dummy.o
 nocov-$(XEN_BUILD_EFI) += stub.o
+
+$(obj)/%.c: common/efi/%.c
+       $(Q)cp -f $< $@
+
+.PRECIOUS: $(obj)/%.c
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.