Skip to content

Commit

Permalink
Pass linker when sanitizing as flag to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
rollbear committed Jul 25, 2017
1 parent 0553c95 commit 613a00f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ matrix:
- libelf-dev
- libdw-dev
env:
- COMPILER="clang++-3.7"
- COMPILER="clang++-3.7" LINKER="-fuse-ld=gold"
before_script:
# The clang runtime for the address sanitizer is missing from the
# apt, hence the downloaded tarballs.
Expand All @@ -29,7 +29,7 @@ matrix:
- sudo cp -n clang+llvm-3.7.1-x86_64-linux-gnu-ubuntu-14.04/lib/clang/3.7.1/lib/linux/*.a /usr/lib/llvm-3.7/lib/clang/3.7.1/lib/linux/
- CXX=${COMPILER} ./check_errors.sh
- mkdir build && cd build
- CXX=${COMPILER} cmake -DCMAKE_BUILD_TYPE=Debug -DTRAVIS_JOB_ID='${TRAVIS_JOB_ID}' -DSANITIZE=true ..
- CXX=${COMPILER} cmake -DCMAKE_BUILD_TYPE=Debug -DTRAVIS_JOB_ID='${TRAVIS_JOB_ID}' -DSAN_LINKER=${LINKER} -DSANITIZE=true ..
- make VERBOSE=1 self_test kcov

- os: linux
Expand All @@ -45,7 +45,7 @@ matrix:
- libelf-dev
- libdw-dev
env:
- COMPILER="clang++-3.8"
- COMPILER="clang++-3.8" LINKER="-fuse-ld=gold"

- os: linux
addons:
Expand All @@ -60,7 +60,7 @@ matrix:
- libelf-dev
- libdw-dev
env:
- COMPILER="clang++-3.9"
- COMPILER="clang++-3.9" LINKER="-fuse-ld=gold"
before_script:
# Unlike with clang++-3.7, the runtime libraries exists with 3.9,
# but still doesn't work because of gold linker version incompatibility.
Expand All @@ -71,7 +71,7 @@ matrix:
- sudo cp clang+llvm-3.9.1-x86_64-linux-gnu-ubuntu-14.04/lib/clang/3.9.1/lib/linux/*.a /usr/lib/llvm-3.9/lib/clang/3.9.1/lib/linux/
- CXX=${COMPILER} ./check_errors.sh
- mkdir build && cd build
- CXX=${COMPILER} cmake -DCMAKE_BUILD_TYPE=Debug -DTRAVIS_JOB_ID='${TRAVIS_JOB_ID}' -DSANITIZE=true ..
- CXX=${COMPILER} cmake -DCMAKE_BUILD_TYPE=Debug -DTRAVIS_JOB_ID='${TRAVIS_JOB_ID}' -DSAN_LINKER=${LINKER} -DSANITIZE=true ..
- make VERBOSE=1 self_test kcov

- os: linux
Expand All @@ -87,7 +87,7 @@ matrix:
- libelf-dev
- libdw-dev
env:
- COMPILER="clang++-4.0"
- COMPILER="clang++-4.0" LINKER="-fuse-ld=gold"

- os: linux
addons:
Expand All @@ -100,7 +100,7 @@ matrix:
- libelf-dev
- libdw-dev
env:
- COMPILER="g++-4.9"
- COMPILER="g++-4.9" LINKER="-fuse-ld=gold"

- os: linux
addons:
Expand All @@ -113,7 +113,7 @@ matrix:
- libelf-dev
- libdw-dev
env:
- COMPILER="g++-5"
- COMPILER="g++-5" LINKER="-fuse-ld=gold"

- os: linux
addons:
Expand All @@ -126,7 +126,7 @@ matrix:
- libelf-dev
- libdw-dev
env:
- COMPILER="g++-6"
- COMPILER="g++-6" LINKER="-fuse-ld=gold"

- os: linux
addons:
Expand All @@ -139,7 +139,7 @@ matrix:
- libelf-dev
- libdw-dev
env:
- COMPILER="g++-7"
- COMPILER="g++-7" LINKER="-fuse-ld=gold"

- os: osx
osx_image: xcode8
Expand All @@ -150,7 +150,7 @@ matrix:
before_script:
- CXX=${COMPILER} ./check_errors.sh
- mkdir build && cd build
- CXX=${COMPILER} cmake -DCMAKE_BUILD_TYPE=Debug -DTRAVIS_JOB_ID='${TRAVIS_JOB_ID}' -DSANITIZE=true ..
- CXX=${COMPILER} cmake -DCMAKE_BUILD_TYPE=Debug -DTRAVIS_JOB_ID='${TRAVIS_JOB_ID}' -DSAN_LINKER=${LINKER} -DSANITIZE=true ..
- make VERBOSE=1 self_test

script:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ if (MASTER_PROJECT AND CMAKE_BUILD_TYPE MATCHES Debug)
self_test
PROPERTIES
LINK_FLAGS
"${SSAN} -fuse-ld=gold"
"${SSAN} ${SAN_LINKER}"
COMPILE_FLAGS
${SSAN}
)
Expand Down

0 comments on commit 613a00f

Please sign in to comment.