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>
This commit is contained in:
Arthur Heymans 2022-11-29 19:12:07 +01:00 committed by Felix Held
parent 5a70f8a092
commit 0edab62a28

View File

@ -26,6 +26,7 @@ omap-header-generic-ccopts += -D__COREBOOT_ARM_ARCH__=7
real-target: $(obj)/MLO real-target: $(obj)/MLO
omap-header-y += header.ld
header_ld := $(call src-to-obj,omap-header,$(dir)/header.ld) header_ld := $(call src-to-obj,omap-header,$(dir)/header.ld)
get_header_size= \ get_header_size= \
@ -33,11 +34,10 @@ get_header_size= \
$(obj)/omap-header.bin: $$(omap-header-objs) $(objcbfs)/bootblock.bin $(obj)/omap-header.bin: $$(omap-header-objs) $(objcbfs)/bootblock.bin
@printf " CC $(subst $(obj)/,,$(@))\n" @printf " CC $(subst $(obj)/,,$(@))\n"
$(CC_omap-header) -nostdlib -nostartfiles -static -include $(obj)/config.h \ $(LD_omap-header) --defsym header_load_size=$(strip \
-Wl,--defsym,header_load_size=$(strip \
$(call get_header_size,$(obj)/coreboot.rom) \ $(call get_header_size,$(obj)/coreboot.rom) \
) \ ) -L$(obj) --whole-archive --start-group $(filter-out %.ld,$(omap-header-objs)) --end-group \
-o $@.tmp $< -T $(header_ld) -o $@.tmp -T $(header_ld)
$(OBJCOPY_omap-header) --only-section=".header" -O binary $@.tmp $@ $(OBJCOPY_omap-header) --only-section=".header" -O binary $@.tmp $@
$(obj)/MLO: $(obj)/coreboot.rom $(obj)/omap-header.bin $(obj)/MLO: $(obj)/coreboot.rom $(obj)/omap-header.bin