Skip to content

Commit bb9cf76

Browse files
authored
make march=cooperlake option conditional on gcc >= 10.1
1 parent e740c48 commit bb9cf76

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Makefile.x86_64

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ endif
3030
ifeq ($(CORE), COOPERLAKE)
3131
ifndef DYNAMIC_ARCH
3232
ifndef NO_AVX512
33+
ifeq ($(C_COMPILER), GCC)
34+
# cooperlake support was added in 10.1
35+
GCCVERSIONGTEQ10 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 10)
36+
GCCMINORVERSIONGTEQ1 := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 1)
37+
ifeq ($(GCCVERSIONGTEQ10)$(GCCMINORVERSIONGTEQ1), 11)
3338
CCOMMON_OPT += -march=cooperlake
3439
FCOMMON_OPT += -march=cooperlake
40+
endif
41+
endif
3542
ifeq ($(OSNAME), CYGWIN_NT)
3643
CCOMMON_OPT += -fno-asynchronous-unwind-tables
3744
FCOMMON_OPT += -fno-asynchronous-unwind-tables

0 commit comments

Comments
 (0)