summaryrefslogtreecommitdiff
path: root/src/soc/ti/am335x/Makefile.mk
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2022-11-29 19:12:07 +0100
committerFelix Held <felix-coreboot@felixheld.de>2024-08-02 14:45:03 +0000
commit0edab62a2827ed2b1faa19bba93662d7cb1fdea2 (patch)
treeb6fce23ddee6e23e07d973386325415c6c2684ea /src/soc/ti/am335x/Makefile.mk
parent5a70f8a09239415a612191d241354f9d223a7232 (diff)
soc/ti/am335x: Use Linker instead of compiler to link
Clang does not work that well as a linker for the header as it will default to other linkers which do not work well here. Instead just use the linker directly. Change-Id: Id6ba42b470349a4b138a65b2a037f16a65982ef7 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70161 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/soc/ti/am335x/Makefile.mk')
-rw-r--r--src/soc/ti/am335x/Makefile.mk8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/soc/ti/am335x/Makefile.mk b/src/soc/ti/am335x/Makefile.mk
index e09a0f7e37..66192f3bc9 100644
--- a/src/soc/ti/am335x/Makefile.mk
+++ b/src/soc/ti/am335x/Makefile.mk
@@ -26,6 +26,7 @@ omap-header-generic-ccopts += -D__COREBOOT_ARM_ARCH__=7
real-target: $(obj)/MLO
+omap-header-y += header.ld
header_ld := $(call src-to-obj,omap-header,$(dir)/header.ld)
get_header_size= \
@@ -33,11 +34,10 @@ get_header_size= \
$(obj)/omap-header.bin: $$(omap-header-objs) $(objcbfs)/bootblock.bin
@printf " CC $(subst $(obj)/,,$(@))\n"
- $(CC_omap-header) -nostdlib -nostartfiles -static -include $(obj)/config.h \
- -Wl,--defsym,header_load_size=$(strip \
+ $(LD_omap-header) --defsym header_load_size=$(strip \
$(call get_header_size,$(obj)/coreboot.rom) \
- ) \
- -o $@.tmp $< -T $(header_ld)
+ ) -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(omap-header-objs)) --end-group \
+ -o $@.tmp -T $(header_ld)
$(OBJCOPY_omap-header) --only-section=".header" -O binary $@.tmp $@
$(obj)/MLO: $(obj)/coreboot.rom $(obj)/omap-header.bin