From: Simon Kuenzer Date: Thu, 23 Feb 2023 20:47:59 +0000 (+0100) Subject: plat/*: Add linker scripts to link dependencies X-Git-Tag: RELEASE-0.13.0~60 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=910b9bef;p=unikraft%2Funikraft.git plat/*: Add linker scripts to link dependencies This commit adds needed linker scripts as dependency to the linking rule of the final image. This dependency was mostly indirectly covered via libraries. However, updates to platform linker scripts did not trigger relinking the final image. Additionally, pure API libraries (like `lib/ukfalloc`) would not even cause building a linker script that is shipped with the library or injected with an `EACHOLIB_SRCS` declaration. The library buildrule is generated but because no library object is generated, the linker script was never be part of a dependency list. Signed-off-by: Simon Kuenzer Reviewed-by: Delia Pavel Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #868 --- diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker.uk index 00768fcc5..b5afbe050 100644 --- a/plat/kvm/Linker.uk +++ b/plat/kvm/Linker.uk @@ -30,7 +30,9 @@ define build_bootinfo = endef $(KVM_DEBUG_IMAGE): $(KVM_ALIBS) $(KVM_ALIBS-y) $(KVM_OLIBS) $(KVM_OLIBS-y) \ - $(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y) + $(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y) \ + $(KVM_LD_SCRIPT-y) $(EXTRA_LD_SCRIPT-y) \ + $(UK_PLAT_KVM_DEF_LDS) $(call build_cmd,LD,,$(KVM_IMAGE).o,\ $(LD) -r $(LIBLDFLAGS) $(LIBLDFLAGS-y) \ $(KVM_LDFLAGS) $(KVM_LDFLAGS-y) \ diff --git a/plat/linuxu/Linker.uk b/plat/linuxu/Linker.uk index 6697ffa0e..be2563d48 100644 --- a/plat/linuxu/Linker.uk +++ b/plat/linuxu/Linker.uk @@ -10,7 +10,8 @@ LINUXU_LD_SCRIPT_FLAGS := $(addprefix -Wl$(comma)-T$(comma),\ $(LINUXU_DEBUG_IMAGE): $(LINUXU_ALIBS) $(LINUXU_ALIBS-y) \ $(LINUXU_OLIBS) $(LINUXU_OLIBS-y) \ - $(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y) + $(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y) \ + $(LINUXU_LD_SCRIPT-y) $(EXTRA_LD_SCRIPT-y) $(call build_cmd,LD,,$@,\ $(LD) $(LDFLAGS) $(LDFLAGS-y) \ $(LINUXU_LDFLAGS) $(LINUXU_LDFLAGS-y) \ diff --git a/plat/xen/Linker.uk b/plat/xen/Linker.uk index ef0efb423..c81602d98 100644 --- a/plat/xen/Linker.uk +++ b/plat/xen/Linker.uk @@ -19,7 +19,9 @@ XEN_LD_SCRIPT_FLAGS += $(addprefix -Wl$(comma)-T$(comma),\ $(XEN_LD_SCRIPT-y) $(EXTRA_LD_SCRIPT-y)) $(XEN_DEBUG_IMAGE): $(XEN_ALIBS) $(XEN_ALIBS-y) $(XEN_OLIBS) $(XEN_OLIBS-y) \ - $(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y) + $(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y) \ + $(XEN_LD_SCRIPT-y) $(EXTRA_LD_SCRIPT-y) \ + $(UK_PLAT_XEN_DEF_LDS) $(call build_cmd,LD,,$(XEN_IMAGE).ld.o,\ $(LD) -r $(LIBLDFLAGS) $(LIBLDFLAGS-y) \ $(XEN_LDFLAGS) $(XEN_LDFLAGS-y) \