Skip to content

Commit cc9713a

Browse files
authored
Merge pull request #4548 from martin-frbg/issue4547
Fix compiler options for Cortex-X1,X2,A710 in gmake builds
2 parents bc21464 + a141764 commit cc9713a

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

Makefile.arm64

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,17 @@ endif
270270

271271
ifeq (1, $(filter 1,$(GCCVERSIONGTEQ11) $(ISCLANG)))
272272
ifeq ($(CORE), CORTEXX1)
273-
CCOMMON_OPT += -march=armv8.2-a -mtune=cortexa72
273+
CCOMMON_OPT += -march=armv8.2-a
274+
ifeq (1, $(filter 1,$(GCCMINORVERSIONGTEQ4) $(GCCVERSIONGTEQ12) $(ISCLANG)))
275+
CCOMMON_OPT += -mtune=cortex-x1
276+
ifneq ($(F_COMPILER), NAG)
277+
FCOMMON_OPT += -march=armv8.2-a -mtune=cortex-x1
278+
endif
279+
else
280+
CCOMMON_OPT += -mtune=cortex-a72
274281
ifneq ($(F_COMPILER), NAG)
275-
FCOMMON_OPT += -march=armv8.2-a -mtune=cortexa72
282+
FCOMMON_OPT += -march=armv8.2-a -mtune=cortex-a72
283+
endif
276284
endif
277285
endif
278286
endif
@@ -283,6 +291,12 @@ CCOMMON_OPT += -march=armv8.4-a+sve
283291
ifneq ($(F_COMPILER), NAG)
284292
FCOMMON_OPT += -march=armv8.4-a+sve
285293
endif
294+
ifeq (1, $(filter 1,$(GCCVERSIONGTEQ12) $(ISCLANG)))
295+
CCOMMON_OPT += -mtune=cortex-x2
296+
ifneq ($(F_COMPILER), NAG)
297+
FCOMMON_OPT += -mtune=cortex-x2
298+
endif
299+
endif
286300
endif
287301
endif
288302

@@ -302,6 +316,12 @@ CCOMMON_OPT += -march=armv8.4-a+sve
302316
ifneq ($(F_COMPILER), NAG)
303317
FCOMMON_OPT += -march=armv8.4-a+sve
304318
endif
319+
ifeq (1, $(filter 1,$(GCCVERSIONGTEQ12) $(ISCLANG)))
320+
CCOMMON_OPT += -mtune=cortex-a710
321+
ifneq ($(F_COMPILER), NAG)
322+
FCOMMON_OPT += -mtune=cortex-a710
323+
endif
324+
endif
305325
endif
306326
endif
307327

Makefile.system

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,9 @@ GCCVERSIONGT5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 5)
365365
GCCVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 7)
366366
GCCVERSIONGTEQ8 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 8)
367367
GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
368-
GCCVERSIONGTEQ11 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 11)
369368
GCCVERSIONGTEQ10 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 10)
369+
GCCVERSIONGTEQ11 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 11)
370+
GCCVERSIONGTEQ12 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 12)
370371
# Note that the behavior of -dumpversion is compile-time-configurable for
371372
# gcc-7.x and newer. Use -dumpfullversion there
372373
ifeq ($(GCCVERSIONGTEQ7),1)

0 commit comments

Comments
 (0)