summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/asan/tests/CMakeLists.txt12
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++.
OpenPOWER on IntegriCloud