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

[Minios-devel] [UNIKRAFT PATCH] build: Preprocess linker script as a source



The build system supports preprocessing of linker script. But in the
current implementation its direct call to definition 'buildrule'. With
this patch, we can add the linker script as source file and don't have
to call the internal buildrule definition.

Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
 plat/kvm/Linker.uk           | 4 +---
 plat/kvm/Makefile.uk         | 2 ++
 support/build/Makefile.rules | 5 ++++-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker.uk
index 4587daf..f696e25 100644
--- a/plat/kvm/Linker.uk
+++ b/plat/kvm/Linker.uk
@@ -2,10 +2,8 @@ ifeq (x86_64,$(CONFIG_UK_ARCH))
 KVM_LDSCRIPT  := $(CONFIG_UK_BASE)/plat/kvm/x86/link64.lds
 KVM_LDFLAGS-y += -Wl,-m,elf_x86_64
 else ifeq (arm64,$(CONFIG_UK_ARCH))
-KVM_LDSCRIPT_SRC := $(CONFIG_UK_BASE)/plat/kvm/arm/link64.lds.S
-KVM_LDSCRIPT     := $(call src2lds,libkvmplat,$(KVM_LDSCRIPT_SRC))
 KVM_LDFLAGS-y   += -Wl,-m,aarch64elf
-$(eval $(call buildrule,libkvmplat,$(KVM_LDSCRIPT_SRC),$(KVM_LDSCRIPT)))
+KVM_LDSCRIPT     := $(call src2lds,libkvmplat,$(KVM_LDSCRIPT_SRC))
 endif
 
 ##
diff --git a/plat/kvm/Makefile.uk b/plat/kvm/Makefile.uk
index 620c626..ad611d3 100644
--- a/plat/kvm/Makefile.uk
+++ b/plat/kvm/Makefile.uk
@@ -54,9 +54,11 @@ endif
 ##
 ## Architecture library definitions for arm64
 ##
+KVM_LDSCRIPT_SRC := $(CONFIG_UK_BASE)/plat/kvm/arm/link64.lds.S
 ifeq ($(findstring y,$(CONFIG_KVM_KERNEL_SERIAL_CONSOLE) 
$(CONFIG_KVM_DEBUG_SERIAL_CONSOLE)),y)
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(UK_PLAT_COMMON_BASE)/arm/pl011.c|common
 endif
+LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(KVM_LDSCRIPT_SRC)
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(UK_PLAT_COMMON_BASE)/arm/cpu_native.c|common
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(UK_PLAT_COMMON_BASE)/arm/cache64.S|common
 LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += 
$(UK_PLAT_COMMON_BASE)/arm/psci_arm64.S|common
diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules
index 809def0..04f2f0d 100644
--- a/support/build/Makefile.rules
+++ b/support/build/Makefile.rules
@@ -464,7 +464,10 @@ endef
 #
 # buildrule_libobj $libname,$source,$variant(optional)
 define buildrule_libobj =
-$(eval $(call buildrule,$(1),$(2),$(call src2obj,$(1),$(2),$(3)),\
+$(if $(filter %.lds.S,$(2)),\
+                  $(eval target=$(call src2lds,$(1),$(2))),\
+                  $(eval target=$(call src2obj,$(1),$(2),$(3))))
+$(eval $(call buildrule,$(1),$(2),$(target),\
   $($(call vprefix_src,$(1),$(2),INCLUDES))\
   $($(call vprefix_src,$(1),$(2),INCLUDES-y))\
   $($(call vprefix_src,$(1),$(2),FLAGS))\
-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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