[llvm-commits] [compiler-rt] r170670 - /compiler-rt/trunk/lib/asan/tests/CMakeLists.txt

Alexey Samsonov samsonov at google.com
Wed Dec 19 22:16:50 PST 2012


Author: samsonov
Date: Thu Dec 20 00:16:50 2012
New Revision: 170670

URL: http://llvm.org/viewvc/llvm-project?rev=170670&view=rev
Log:
[ASan] don't use -fsanitize=address linker flag for unit tests on Android

Modified:
    compiler-rt/trunk/lib/asan/tests/CMakeLists.txt

Modified: compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/CMakeLists.txt?rev=170670&r1=170669&r2=170670&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Thu Dec 20 00:16:50 2012
@@ -51,11 +51,17 @@
   )
 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++.





More information about the llvm-commits mailing list