diff options
author | Manish Pandey <manish.pandey2@arm.com> | 2023-10-23 17:59:26 +0200 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2023-10-23 17:59:26 +0200 |
commit | 3018854b5f229939544ad09c93199ec7b66df358 (patch) | |
tree | 4a306110d9df1cc7ce6bb464d522658190d5b6f4 | |
parent | eab006e5910e831ef043ce7cfdc42aebfa36fd40 (diff) | |
parent | 7762531216a599d98dcf88aef8f8e980e0db90ed (diff) |
Merge changes from topic "gcc_linker_aarch32" into integration
* changes:
feat(st): support gcc as linker
fix(build): allow gcc linker on Aarch32 platforms
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | plat/st/common/common_rules.mk | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -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))) diff --git a/plat/st/common/common_rules.mk b/plat/st/common/common_rules.mk index fa48dfcff..d2d2fb13a 100644 --- a/plat/st/common/common_rules.mk +++ b/plat/st/common/common_rules.mk @@ -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 $< $@ |