diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2024-07-19 09:41:30 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-08-22 13:57:47 +0000 |
commit | 7bb8de184338453cde924c816e027af5eae40d32 (patch) | |
tree | 3d62385704091171df525629f2061351466dbe49 /src/arch/arm64 | |
parent | cb26ed489c67b58bc981a57d032969355850cbd6 (diff) |
Makefile.mk: Add a common link_stage function and use it
A few differences with the original link targets:
- 'libs' is now supported on all arch even though only x86 uses it
- compiler_rt is included on arch that previously did not (arm). This
however has no impact as there compiler_rt is not defined for those
arch in xcompile
- LIBGCC_FILE_NAME_bootblock is not included, but this was not defined
anywhere so this is a noop
Change-Id: I64f7686894c99732d06972e7ba327061db6d7c44
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83574
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch/arm64')
-rw-r--r-- | src/arch/arm64/Makefile.mk | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/arch/arm64/Makefile.mk b/src/arch/arm64/Makefile.mk index cb43897efd..f4ca29b980 100644 --- a/src/arch/arm64/Makefile.mk +++ b/src/arch/arm64/Makefile.mk @@ -43,13 +43,8 @@ bootblock-y += memmove.S # Build the bootblock -$(objcbfs)/bootblock.debug: $$(bootblock-objs) $(obj)/config.h - @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) --end-group -T $(call src-to-obj,bootblock,$(CONFIG_MEMLAYOUT_LD_FILE)) - -$(objcbfs)/decompressor.debug: $$(decompressor-objs) $(obj)/config.h - @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(decompressor-objs)) --end-group -T $(call src-to-obj,decompressor,$(CONFIG_MEMLAYOUT_LD_FILE)) +$(eval $(call link_stage,bootblock)) +$(eval $(call link_stage,decompressor)) endif # CONFIG_ARCH_BOOTBLOCK_ARM64 @@ -59,9 +54,7 @@ endif # CONFIG_ARCH_BOOTBLOCK_ARM64 ifeq ($(CONFIG_ARCH_VERSTAGE_ARM64),y) -$(objcbfs)/verstage.debug: $$(verstage-objs) - @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_verstage) $(LDFLAGS_verstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(verstage-objs)) --end-group -T $(call src-to-obj,verstage,$(CONFIG_MEMLAYOUT_LD_FILE)) +$(eval $(call link_stage,verstage)) verstage-y += boot.c verstage-y += div0.c @@ -103,9 +96,7 @@ rmodules_arm64-y += memcpy.S rmodules_arm64-y += memmove.S rmodules_arm64-y += eabi_compat.c -$(objcbfs)/romstage.debug: $$(romstage-objs) - @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group -T $(call src-to-obj,romstage,$(CONFIG_MEMLAYOUT_LD_FILE)) +$(eval $(call link_stage,romstage)) endif # CONFIG_ARCH_ROMSTAGE_ARM64 @@ -144,9 +135,7 @@ ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) # Build the ramstage -$(objcbfs)/ramstage.debug: $$(ramstage-objs) - @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) $(LDFLAGS_ramstage) -o $@ -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) +$(eval $(call link_stage,ramstage)) # Build ARM Trusted Firmware (BL31) |