From deaa1f2824dda2e304225d803b02ec56b6b19f5a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 29 May 2014 16:40:07 -0700 Subject: [PATCH] [travis][build] run clang's address sanitizer + fixup cxxflags on linux --- .travis.yml | 3 ++- common.gypi | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00b80fe5e..8662afde1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,8 @@ install: before_script: - if [[ ${CXX} == "g++" ]]; then export CXX="g++-4.8" ; fi -- if [[ ${BUILDTYPE} == "Debug" ]]; then export CXXFLAGS="-fsanitize=address";export LDFLAGS="-fsanitize=address" ; fi +- if [[ ${BUILDTYPE} == "Debug" ]] && [[ ${CXX} == "g++" ]]; then export CXXFLAGS="-fsanitize=address";export LDFLAGS="-fsanitize=address" ; fi +- if [[ ${BUILDTYPE} == "Debug" ]] && [[ ${CXX} == "clang++" ]]; then export CXXFLAGS="-fsanitize=thread -fPIC";export LDFLAGS="-fsanitize=thread -pie" ; fi script: - make llmr BUILDTYPE=${BUILDTYPE} diff --git a/common.gypi b/common.gypi index 8e6919a10..ba2347090 100644 --- a/common.gypi +++ b/common.gypi @@ -11,10 +11,10 @@ 'GCC_WARN_PEDANTIC': 'YES', 'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE' }, - 'cflags_cc': ['-std=c++11'], + 'cflags_cc': ['-std=c++11', '-Wall', '-Wextra'], 'configurations': { 'Debug': { - 'cflags': [ '-g', '-O0' ], + 'cflags_cc': [ '-g', '-O1', '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common' ], 'defines': [ 'DEBUG' ], 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '1', @@ -25,7 +25,7 @@ } }, 'Release': { - 'cflags': [ '-O3' ], + 'cflags_cc': [ '-O3' ], 'defines': [ 'NDEBUG' ], 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '3',