From 366279e09e2fc411cdae797b058df55997d1d6fb Mon Sep 17 00:00:00 2001 From: Julia Longtin Date: Tue, 12 Mar 2024 21:40:46 +0000 Subject: [PATCH] try to detect the PHI cross compiler in make. --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 7a69ad1b3..a01718eff 100644 --- a/Makefile +++ b/Makefile @@ -93,6 +93,8 @@ CC := riscv64-unknown-linux-gnu-gcc CXX := riscv64-unknown-linux-gnu-g++ endif +K1OM := $( shell echo | $CC -dM -E - | grep __k1om__ ) + # # Compile flags # @@ -279,6 +281,9 @@ endif ifndef RISCV ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64)) + +ifeq "$(K1OM)" "" + # Use all CPU extensions that are available: MK_CFLAGS += -march=native -mtune=native HOST_CXXFLAGS += -march=native -mtune=native @@ -292,6 +297,8 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64)) #MK_CXXFLAGS += -mssse3 endif +endif + ifneq '' '$(findstring mingw,$(shell $(CC) -dumpmachine))' # The stack is only 16-byte aligned on Windows, so don't let gcc emit aligned moves. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412