diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-12-20 06:16:50 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-12-20 06:16:50 +0000 |
commit | 74cbc4ccd74789f99e4fd2c9d12912e91d779f2d (patch) | |
tree | a940d6018082ff30bae74543c7b248aaf2dadbd5 | |
parent | 7bff8f1d7adfaa5d6de77100445eab0d3676de27 (diff) | |
download | bcm5719-llvm-74cbc4ccd74789f99e4fd2c9d12912e91d779f2d.tar.gz bcm5719-llvm-74cbc4ccd74789f99e4fd2c9d12912e91d779f2d.zip |
[ASan] don't use -fsanitize=address linker flag for unit tests on Android
llvm-svn: 170670
-rw-r--r-- | compiler-rt/lib/asan/tests/CMakeLists.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt index 75e4f08cd43..bd089968d9b 100644 --- a/compiler-rt/lib/asan/tests/CMakeLists.txt +++ b/compiler-rt/lib/asan/tests/CMakeLists.txt @@ -51,11 +51,17 @@ else() ) endif() -set(ASAN_LINK_FLAGS -fsanitize=address) +set(ASAN_LINK_FLAGS) if(ANDROID) + # On Android, we link with ASan runtime manually list(APPEND ASAN_LINK_FLAGS -pie) -elseif(APPLE) - # Unit tests on Mac depend on Foundation. +else() + # On other platforms, we depend on Clang driver behavior, + # passing -fsanitize=address flag. + list(APPEND ASAN_LINK_FLAGS -fsanitize=address) +endif() +# Unit tests on Mac depend on Foundation. +if(APPLE) list(APPEND ASAN_LINK_FLAGS -framework Foundation) endif() # Unit tests require libstdc++. |