Merge changes from topic "gcc_linker_aarch32" into integration

* changes:
  feat(st): support gcc as linker
  fix(build): allow gcc linker on Aarch32 platforms
This commit is contained in:
Manish Pandey 2023-10-23 17:59:26 +02:00 committed by TrustedFirmware Code Review
commit 3018854b5f
2 changed files with 8 additions and 2 deletions

View file

@ -370,8 +370,10 @@ else ifneq ($(findstring gcc,$(notdir $(LD))),)
# GCC automatically adds fix-cortex-a53-843419 flag when used to link
# which breaks some builds, so disable if errata fix is not explicitly enabled
ifneq (${ERRATA_A53_843419},1)
TF_LDFLAGS += -mno-fix-cortex-a53-843419
ifeq (${ARCH},aarch64)
ifneq (${ERRATA_A53_843419},1)
TF_LDFLAGS += -mno-fix-cortex-a53-843419
endif
endif
TF_LDFLAGS += -nostdlib
TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH)))

View file

@ -57,7 +57,11 @@ $(eval $(call MAKE_LD,${STM32_TF_LINKERFILE},$(STM32_LD_FILE),bl2))
tf-a-%.elf: $(PLAT)-%.o ${STM32_TF_LINKERFILE}
@echo " LDS $<"
ifneq ($(findstring gcc,$(notdir $(LD))),)
${Q}${LD} -o $@ $(subst --,-Wl$(comma)--,${STM32_TF_ELF_LDFLAGS}) -nostartfiles -Wl,-Map=$(@:.elf=.map) -Wl,-dT ${STM32_TF_LINKERFILE} $<
else
${Q}${LD} -o $@ ${STM32_TF_ELF_LDFLAGS} -Map=$(@:.elf=.map) --script ${STM32_TF_LINKERFILE} $<
endif
tf-a-%.bin: tf-a-%.elf
${Q}${OC} -O binary $< $@