Skip to content

Commit 81fbe8d

Browse files
authored
-march=cooperlake only available in gcc >= 10
1 parent bb9cf76 commit 81fbe8d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

kernel/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ include $(TOPDIR)/Makefile.system
88

99
ifeq ($(C_COMPILER), GCC)
1010
GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
11+
GCCVERSIONGTEQ10 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 10)
1112
endif
1213

1314
ifeq ($(ARCH), power)
@@ -38,7 +39,12 @@ endif
3839

3940
ifdef TARGET_CORE
4041
ifeq ($(TARGET_CORE), COOPERLAKE)
41-
override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE) -march=cooperlake
42+
override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE)
43+
ifeq ($(GCCVERSIONGTEQ10, 1)
44+
override CFLAGS += -march=cooperlake
45+
else
46+
override CFLAGS += -march=skylake-avx512
47+
endif
4248
ifeq ($(OSNAME), CYGWIN_NT)
4349
override CFLAGS += -fno-asynchronous-unwind-tables
4450
endif

0 commit comments

Comments
 (0)