From 2ea9ba1bc13b3fda9b13e2930743fbdec73562b9 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 30 Dec 2016 01:59:18 +0100 Subject: [PATCH] makefile: Don't apply '-march=native' if DISABLE_CXX_OPTIMIZATIONS is specified. This brings it in line with CmakeLists.txt. --- GNUmakefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index a1977b6c..18328d82 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -49,8 +49,6 @@ IS_X86 := $(shell isainfo -k 2>/dev/null | grep -i -c "i386") IS_X64 := $(shell isainfo -k 2>/dev/null | grep -i -c "amd64") endif -DISABLE_CXXFLAGS_OPTIMIZATIONS := 0 - ########################################################### ##### General Variables ##### ########################################################### @@ -130,6 +128,8 @@ endif # BEGIN MARCH_CXXFLAGS # Guard use of -march=native (or -m{32|64} on some platforms) # Don't add anything if -march=XXX or -mtune=XXX is specified +# or DISABLE_CXXFLAGS_OPTIMIZATIONS is set. +ifeq ($(DISABLE_CXXFLAGS_OPTIMIZATIONS),) ifeq ($(findstring -march,$(CXXFLAGS)),) ifeq ($(findstring -mtune,$(CXXFLAGS)),) ifeq ($(GCC42_OR_LATER)$(IS_NETBSD),10) @@ -149,6 +149,7 @@ ifeq ($(findstring -mtune,$(CXXFLAGS)),) endif endif # -mtune endif # -march +endif # DISABLE_CXXFLAGS_OPTIMIZATIONS # END MARCH_CXXFLAGS # Aligned access required for -O3 and above due to vectorization