Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/70161 )
Change subject: soc/ti/am335x: Fix building omap header with clang ......................................................................
soc/ti/am335x: Fix building omap header with clang
Clang needs the target and the linker defined explicitly.
Change-Id: Id6ba42b470349a4b138a65b2a037f16a65982ef7 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/ti/am335x/Makefile.inc 1 file changed, 18 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/70161/1
diff --git a/src/soc/ti/am335x/Makefile.inc b/src/soc/ti/am335x/Makefile.inc index e09a0f7..ec70802 100644 --- a/src/soc/ti/am335x/Makefile.inc +++ b/src/soc/ti/am335x/Makefile.inc @@ -24,6 +24,10 @@
omap-header-generic-ccopts += -D__COREBOOT_ARM_ARCH__=7
+ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y) +CFLAGS_omap-header += -fuse-ld=$(LD_omap-header) +endif + real-target: $(obj)/MLO
header_ld := $(call src-to-obj,omap-header,$(dir)/header.ld) @@ -31,9 +35,10 @@ get_header_size= \ $(shell echo $$(wc -c < $(objcbfs)/bootblock.bin))
+# This does not work well with clang so explicitly use GCC $(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 \ + $(CC_omap-header) $(CFLAGS_omap-header) -nostdlib -nostartfiles -static -include $(obj)/config.h \ -Wl,--defsym,header_load_size=$(strip \ $(call get_header_size,$(obj)/coreboot.rom) \ ) \