]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/*: Add linker scripts to link dependencies
authorSimon Kuenzer <simon@unikraft.io>
Thu, 23 Feb 2023 20:47:59 +0000 (21:47 +0100)
committerUnikraft <monkey@unikraft.io>
Sun, 7 May 2023 16:44:41 +0000 (16:44 +0000)
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 <simon@unikraft.io>
Reviewed-by: Delia Pavel <delia_maria.pavel@stud.acs.upb.ro>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #868

plat/kvm/Linker.uk
plat/linuxu/Linker.uk
plat/xen/Linker.uk

index 00768fcc544996990243d2359f5ef51b62db0b76..b5afbe0508bcfc204f904a258d80756d7fb32e4c 100644 (file)
@@ -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) \
index 6697ffa0e4a3ce36f347c901dd125154c38fae06..be2563d48e078e2227a49dd616db3bbd0adc1a94 100644 (file)
@@ -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) \
index ef0efb4232f4f26b9eb2ff123a4d02454e32cc34..c81602d98dd81439a66ee6825feaf5d9b7f82ea1 100644 (file)
@@ -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) \