From e1c5fa9720751716f40f3fead1cb2d5665c3caba Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 22 Aug 2017 22:34:55 -0400 Subject: [PATCH] Test remove -march=native Also see "Random crashes on different computers because option -march=native is active 'by default'", https://github.com/weidai11/cryptopp/issues/380 --- .travis.yml | 4 ++++ GNUmakefile | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) mode change 100644 => 100755 GNUmakefile diff --git a/.travis.yml b/.travis.yml index 1ef8d774..e29d99b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ env: matrix: - BUILD_MODE="all" + - BUILD_MODE="native" - BUILD_MODE="no-asm" - BUILD_MODE="debug" - BUILD_MODE="asan" @@ -55,6 +56,9 @@ matrix: env: BUILD_MODE="ios-watch" - os: linux env: BUILD_MODE="ios-tv" + # No Native builds on iOS + - os: osx + env: BUILD_MODE="native" allow_failures: - os: osx diff --git a/GNUmakefile b/GNUmakefile old mode 100644 new mode 100755 index ebfdfcba..c14d540a --- a/GNUmakefile +++ b/GNUmakefile @@ -123,7 +123,7 @@ endif ifneq ($(HAS_NEWLIB),0) ifeq ($(findstring -D_XOPEN_SOURCE,$(CXXFLAGS)),) - CXXFLAGS += -D_XOPEN_SOURCE=700 + CXXFLAGS += -D_XOPEN_SOURCE=600 endif endif @@ -403,6 +403,13 @@ CXXFLAGS += -DCRYPTOPP_DISABLE_ASM endif # CXXFLAGS endif # No ASM +# Native build testing. Issue 'make native'. +ifeq ($(findstring native,$(MAKECMDGOALS)),native) +ifeq ($(findstring -march=native,$(CXXFLAGS)),) +CXXFLAGS += -march=native +endif # CXXFLAGS +endif # Native + # Undefined Behavior Sanitizer (UBsan) testing. Issue 'make ubsan'. ifeq ($(findstring ubsan,$(MAKECMDGOALS)),ubsan) CXXFLAGS := $(CXXFLAGS:-g%=-g3) @@ -593,8 +600,8 @@ dep deps depend GNUmakefile.deps: $(CXX) $(strip $(CXXFLAGS)) -MM *.cpp > GNUmakefile.deps # CXXFLAGS are tuned earlier. -.PHONY: asan ubsan no-asm -no-asm asan ubsan: libcryptopp.a cryptest.exe +.PHONY: native no-asm asan ubsan +native no-asm asan ubsan: libcryptopp.a cryptest.exe # CXXFLAGS are tuned earlier. Applications must use linker flags # -Wl,--gc-sections (Linux and Unix) or -Wl,-dead_strip (OS X)