From 7bb8de184338453cde924c816e027af5eae40d32 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Fri, 19 Jul 2024 09:41:30 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/83574 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- src/arch/ppc64/Makefile.mk | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/arch/ppc64/Makefile.mk') diff --git a/src/arch/ppc64/Makefile.mk b/src/arch/ppc64/Makefile.mk index 92b1e399d6..4299e7409c 100644 --- a/src/arch/ppc64/Makefile.mk +++ b/src/arch/ppc64/Makefile.mk @@ -21,11 +21,7 @@ bootblock-y += \ bootblock-generic-ccopts += $(ppc64_flags) -$(objcbfs)/bootblock.debug: $$(bootblock-objs) - @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) \ - -T $(call src-to-obj,bootblock,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(bootblock-objs)) \ - $(LIBGCC_FILE_NAME_bootblock) --end-group $(COMPILER_RT_bootblock) +$(eval $(call link_stage,bootblock)) endif @@ -48,9 +44,7 @@ romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c # Build the romstage -$(objcbfs)/romstage.debug: $$(romstage-objs) - @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_romstage) $(LDFLAGS_romstage) -o $@ -L$(obj) -T $(call src-to-obj,romstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(romstage-objs)) --end-group $(COMPILER_RT_romstage) +$(eval $(call link_stage,romstage)) romstage-c-ccopts += $(ppc64_flags) romstage-S-ccopts += $(ppc64_asm_flags) @@ -81,9 +75,7 @@ ramstage-srcs += 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) -T $(call src-to-obj,ramstage,$(CONFIG_MEMLAYOUT_LD_FILE)) --whole-archive --start-group $(filter-out %.ld,$(ramstage-objs)) --end-group $(COMPILER_RT_ramstage) +$(eval $(call link_stage,ramstage)) ramstage-c-ccopts += $(ppc64_flags) ramstage-S-ccopts += $(ppc64_asm_flags) -- cgit v1.2.3