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 <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82189
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Yidi Lin
2024-05-04 17:25:33 +08:00
committed by Yu-Ping Wu
parent 904c09bb9c
commit 3d807d262f

View File

@@ -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)" \