From 3d807d262fbc20dad5262934712dcf27215ba5b8 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Sat, 4 May 2024 17:25:33 +0800 Subject: arch/arm64/Makefile.mk: Switch linker to GNU GCC TF-A migrates the default choice of linker to GCC in order to enable LTO. Change BL31_LDFLAGS from `--emit-relocs` to '-Wl,--emit-relocs', so that GCC is able to pass `--emit-relocs` to the linker. [1]: https://review.trustedfirmware.org/c/26703 BUG=b:338420310 TEST=emerge-geralt coreboot TEST=./util/abuild/abuild -t google/geralt -b geralt -a TEST=./util/abuild/abuild -t google/oak -b elm -a Change-Id: I65b96aaa052138592a0f57230e1140a1bb2f07ac Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/82189 Reviewed-by: Eric Lai Reviewed-by: Yu-Ping Wu Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) --- src/arch/arm64/Makefile.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/arch/arm64/Makefile.mk b/src/arch/arm64/Makefile.mk index 8ab41b627a..897dae525f 100644 --- a/src/arch/arm64/Makefile.mk +++ b/src/arch/arm64/Makefile.mk @@ -173,14 +173,13 @@ BL31_MAKEARGS += IS_ANYTHING_TO_BUILD=1 BL31_MAKEARGS += BUILD_MESSAGE_TIMESTAMP='"$(shell sed -n 's/^.define COREBOOT_BUILD\>.*"\(.*\)".*/\1/p' $(obj)/build.h)"' BL31_CFLAGS := -fno-pic -fno-stack-protector -Wno-deprecated-declarations -Wno-unused-function -BL31_LDFLAGS := --emit-relocs +BL31_LDFLAGS := -Wl,--emit-relocs BL31 := $(obj)/bl31.elf $(BL31): $(obj)/build.h printf " MAKE $(subst $(obj)/,,$(@))\n" - +unset AS AR CC CPP OC OD; \ - LD=$(word 1, $(LD_arm64)) \ + +unset AS AR CC CPP OC OD LD; \ CROSS_COMPILE="$(CROSS_COMPILE_arm64)" \ CFLAGS="$(BL31_CFLAGS)" \ LDFLAGS="$(BL31_LDFLAGS)" \ -- cgit v1.2.3