diff --git a/Makefile b/Makefile index c8fd3f5c5..6146d406d 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,8 @@ CC := riscv64-unknown-linux-gnu-gcc CXX := riscv64-unknown-linux-gnu-g++ endif +K1OM := $( shell echo | $CC -dM -E - | grep __k1om__ ) + # # Compile flags # @@ -274,6 +276,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 @@ -287,6 +292,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