From 81fbe8d08858ae0f1dd4de1bc5dfad864d8358f5 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 19 Aug 2020 16:10:15 +0200 Subject: [PATCH] -march=cooperlake only available in gcc >= 10 --- kernel/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/Makefile b/kernel/Makefile index 0c883cd96..d5078c5ba 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -8,6 +8,7 @@ include $(TOPDIR)/Makefile.system ifeq ($(C_COMPILER), GCC) GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9) +GCCVERSIONGTEQ10 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 10) endif ifeq ($(ARCH), power) @@ -38,7 +39,12 @@ endif ifdef TARGET_CORE ifeq ($(TARGET_CORE), COOPERLAKE) - override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE) -march=cooperlake + override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE) + ifeq ($(GCCVERSIONGTEQ10, 1) + override CFLAGS += -march=cooperlake + else + override CFLAGS += -march=skylake-avx512 + endif ifeq ($(OSNAME), CYGWIN_NT) override CFLAGS += -fno-asynchronous-unwind-tables endif