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

[xen staging] build: avoid building arm/arm/*/head.o twice



commit e5ba9f79ef4517321e80e0eb6e4aafc3a978e689
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Tue Oct 12 11:53:47 2021 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Oct 12 11:53:47 2021 +0200

    build: avoid building arm/arm/*/head.o twice
    
    head.o is been built twice, once because it is in $(ALL_OBJS) and a
    second time because it is in $(extra-y) and thus it is rebuilt when
    building "arch/arm/built_in.o".
    
    Fix this by adding a dependency of "head.o" on the directory
    "arch/arm/".
    
    Also, we should avoid building object that are in subdirectories, so
    move the declaration in there. This doesn't change anything as
    "arch/arm/built_in.o" depends on "arch/arm/$subarch/built_in.o" which
    depends on $(extra-y), so we still need to depend on
    "arch/arm/built_in.o".
    
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 xen/arch/arm/Makefile       | 7 ++++++-
 xen/arch/arm/arm32/Makefile | 1 +
 xen/arch/arm/arm64/Makefile | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7dd3ee981a..64518848b2 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -65,7 +65,6 @@ obj-$(CONFIG_SBSA_VUART_CONSOLE) += vpl011.o
 obj-y += vsmc.o
 obj-y += vpsci.o
 obj-y += vuart.o
-extra-y += $(TARGET_SUBARCH)/head.o
 
 #obj-bin-y += ....o
 
@@ -75,6 +74,12 @@ endif
 
 ALL_OBJS := $(TARGET_SUBARCH)/head.o $(ALL_OBJS)
 
+# head.o is built by descending into the sub-directory, depends on the part of
+# $(ALL_OBJS) that will eventually recurse into $(TARGET_SUBARCH)/ and build
+# head.o
+$(TARGET_SUBARCH)/head.o: $(BASEDIR)/arch/arm/built_in.o
+$(TARGET_SUBARCH)/head.o: ;
+
 ifdef CONFIG_LIVEPATCH
 all_symbols = --all-symbols
 ifdef CONFIG_FAST_SYMBOL_LOOKUP
diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile
index 96105d2383..3040eabce3 100644
--- a/xen/arch/arm/arm32/Makefile
+++ b/xen/arch/arm/arm32/Makefile
@@ -11,3 +11,4 @@ obj-y += smpboot.o
 obj-y += traps.o
 obj-y += vfp.o
 
+extra-y += head.o
diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile
index 701d66883d..baa87655fa 100644
--- a/xen/arch/arm/arm64/Makefile
+++ b/xen/arch/arm/arm64/Makefile
@@ -14,3 +14,5 @@ obj-y += smpboot.o
 obj-y += traps.o
 obj-y += vfp.o
 obj-y += vsysreg.o
+
+extra-y += head.o
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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