Skip to content

Commit

Permalink
Improvements to run_spec_clang_asan.sh. Patch by Yuri Gribov!
Browse files Browse the repository at this point in the history
git-svn-id: http://address-sanitizer.googlecode.com/svn/trunk@2313 3c3640eb-14a6-2bb8-0b94-e9e73afe33f5
  • Loading branch information
[email protected] committed Feb 11, 2015
1 parent b4812f6 commit 2583719
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions spec/run_spec_clang_asan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ ulimit -s 8092 # stack

SPEC_J=${SPEC_J:-20}
NUM_RUNS=${NUM_RUNS:-1}
CLANG=${CLANG:-clang}
CC=${CC:-clang}
BIT=${BIT:-64}
OPT_LEVEL=${OPT_LEVEL:-"-O2"}
if $CLANG --version 2>&1 | grep -q clang; then
if $CC --version 2>&1 | grep -q clang; then
F_ASAN=-fsanitize=address
CLANGXX=${CLANGXX:-$CLANG++}
CXX=${CXX:-$(echo $CC | sed -e 's/clang$/clang++/')}
else
F_ASAN='-fsanitize=address -static-libasan'
CLANGXX=${CLANGXX:-$(echo $CLANG | sed -e 's/gcc$/g++/')}
CXX=${CXX:-$(echo $CC | sed -e 's/gcc$/g++/')}
export LD_LIBRARY_PATH=$($CC -print-search-dirs | sed -ne 's/^libraries: =//p')${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
fi
rm -rf config/$name.*

Expand All @@ -62,12 +63,13 @@ if test -z "$FC"; then
fi

COMMON_FLAGS="$F_ASAN -m$BIT -g"
CC="$CLANG -std=gnu89 $COMMON_FLAGS"
CXX="$CLANGXX $COMMON_FLAGS"
CC="$CC -std=gnu89 $COMMON_FLAGS"
CXX="$CXX $COMMON_FLAGS"
FC="$FC $COMMON_FLAGS"

cat << EOF > config/$name.cfg
monitor_wrapper = $SPEC_WRAPPER \$command
monitor_specrun_wrapper = $SPECRUN_WRAPPER \$command
ignore_errors = yes
tune = base
ext = $name
Expand Down

0 comments on commit 2583719

Please sign in to comment.