mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-25 14:25:44 +00:00
build(fpga): correctly handle gcc as linker for LTO
When LTO is enabled and gcc is used as a linker, then option for a linker have to be provided with a -Wl prefix to gcc. To build PLAT=arm_fpga with LTO enabled extra '-nostdlib' has to be supplied to the linker at least, otherwise build fails with an error about many undefined references in libc. Since this option is defined as part of common TF_LDFLAGS already, just use that variable with couple extra options. Change-Id: Iaab72d894317c91af5b7d770652e4353b32aae88 Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
This commit is contained in:
parent
31f80efeef
commit
acf0076ae2
1 changed files with 7 additions and 1 deletions
|
@ -127,8 +127,14 @@ $(eval $(call MAKE_S,$(BUILD_PLAT),plat/arm/board/arm_fpga/rom_trampoline.S,bl31
|
|||
$(eval $(call MAKE_S,$(BUILD_PLAT),plat/arm/board/arm_fpga/kernel_trampoline.S,bl31))
|
||||
$(eval $(call MAKE_LD,$(BUILD_PLAT)/build_axf.ld,plat/arm/board/arm_fpga/build_axf.ld.S,bl31))
|
||||
|
||||
ifeq ($($(ARCH)-ld-id),gnu-gcc)
|
||||
PLAT_LDFLAGS += -Wl,--strip-debug
|
||||
else
|
||||
PLAT_LDFLAGS += --strip-debug
|
||||
endif
|
||||
|
||||
bl31.axf: bl31 dtbs ${BUILD_PLAT}/rom_trampoline.o ${BUILD_PLAT}/kernel_trampoline.o ${BUILD_PLAT}/build_axf.ld
|
||||
$(ECHO) " LD $@"
|
||||
$(Q)$($(ARCH)-ld) -T ${BUILD_PLAT}/build_axf.ld -L ${BUILD_PLAT} --strip-debug -s -n -o ${BUILD_PLAT}/bl31.axf
|
||||
$(Q)$($(ARCH)-ld) -T ${BUILD_PLAT}/build_axf.ld -L ${BUILD_PLAT} $(TF_LDFLAGS) $(PLAT_LDFLAGS) -s -n -o ${BUILD_PLAT}/bl31.axf
|
||||
|
||||
all: bl31.axf
|
||||
|
|
Loading…
Add table
Reference in a new issue