summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Gautier <yann.gautier@st.com>2023-03-15 16:18:16 +0100
committerYann Gautier <yann.gautier@st.com>2023-10-16 13:47:59 +0200
commitcfe6767f7dd483f1bd76b2ba88a75809e013c5bd (patch)
treef18def5eaf52aa3a4350ea36776f48bcba9d91e4
parentad4e978774176a2b0dc6e94c7f63c7e90e031b1e (diff)
fix(build): allow gcc linker on Aarch32 platforms
When trying to compile and link with gcc on an Aarch32 platform, there is the following error: arm-none-eabi-gcc: error: unrecognized command-line option '-mno-fix-cortex-a53-843419'; did you mean '-mno-fix-cortex-m3-ldrd'? This option seems specific to Aarch64 version of GCC. Enclose it with a check on ARCH=aarch64. Signed-off-by: Yann Gautier <yann.gautier@st.com> Change-Id: I8c8cb784ce2f2938c4c6999745dda09ee9a5669d
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 907ae21d4..6a2eeca1a 100644
--- a/Makefile
+++ b/Makefile
@@ -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)))