[ASan] don't use -fsanitize=address linker flag for unit tests on Android

llvm-svn: 170670
This commit is contained in:
Alexey Samsonov 2012-12-20 06:16:50 +00:00
parent 7bff8f1d7a
commit 74cbc4ccd7
1 changed files with 9 additions and 3 deletions

View File

@ -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++.