[compiler-rt] r201417 - [ASan] Rename asan_runtime_libraries to asan. Re-enable tests on Android.

Alexey Samsonov samsonov at google.com
Fri Feb 14 06:45:13 PST 2014


Author: samsonov
Date: Fri Feb 14 08:45:13 2014
New Revision: 201417

URL: http://llvm.org/viewvc/llvm-project?rev=201417&view=rev
Log:
[ASan] Rename asan_runtime_libraries to asan. Re-enable tests on Android.

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

Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=201417&r1=201416&r2=201417&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Fri Feb 14 08:45:13 2014
@@ -69,7 +69,7 @@ else()
 endif()
 
 # Build ASan runtimes shipped with Clang.
-set(ASAN_RUNTIME_LIBRARIES)
+add_custom_target(asan)
 if(APPLE)
   foreach (os ${SANITIZER_COMMON_SUPPORTED_DARWIN_OS})
     # Dynamic lookup is needed because shadow scale and offset are
@@ -85,7 +85,7 @@ if(APPLE)
       CFLAGS ${ASAN_CFLAGS}
       DEFS ${ASAN_COMMON_DEFINITIONS}
       LINKFLAGS ${ASAN_RUNTIME_LDFLAGS})
-    list(APPEND ASAN_RUNTIME_LIBRARIES clang_rt.asan_${os}_dynamic)
+    add_dependencies(asan clang_rt.asan_${os}_dynamic)
   endforeach()
 
 elseif(ANDROID)
@@ -98,7 +98,7 @@ elseif(ANDROID)
   set_property(TARGET clang_rt.asan-arm-android APPEND PROPERTY
     COMPILE_DEFINITIONS ${ASAN_COMMON_DEFINITIONS})
   target_link_libraries(clang_rt.asan-arm-android dl log)
-  list(APPEND ASAN_RUNTIME_LIBRARIES clang_rt.asan-arm-android)
+  add_dependencies(asan clang_rt.asan-arm-android)
 else()
   # Build separate libraries for each target.
   foreach(arch ${ASAN_SUPPORTED_ARCH})
@@ -116,10 +116,10 @@ else()
       SOURCES ${ASAN_RUNTIME_OBJECTS}
       CFLAGS ${ASAN_CFLAGS}
       DEFS ${ASAN_COMMON_DEFINITIONS})
-    list(APPEND ASAN_RUNTIME_LIBRARIES clang_rt.asan-${arch})
+    add_dependencies(asan clang_rt.asan-${arch})
     if (UNIX AND NOT ${arch} STREQUAL "i386")
       add_sanitizer_rt_symbols(clang_rt.asan-${arch} asan.syms.extra)
-      list(APPEND ASAN_RUNTIME_LIBRARIES clang_rt.asan-${arch}-symbols)
+      add_dependencies(asan clang_rt.asan-${arch}-symbols)
     endif()
 
     if (WIN32)
@@ -127,16 +127,13 @@ else()
       SOURCES asan_dll_thunk.cc
       CFLAGS ${ASAN_CFLAGS} -DASAN_DLL_THUNK
       DEFS ${ASAN_COMMON_DEFINITIONS})
-      list(APPEND ASAN_RUNTIME_LIBRARIES clang_rt.asan_dll_thunk-${arch})
+      add_dependencies(asan clang_rt.asan_dll_thunk-${arch})
     endif()
   endforeach()
 endif()
 
 add_compiler_rt_resource_file(asan_blacklist asan_blacklist.txt)
-
-# All ASan runtime dependencies.
-add_custom_target(asan_runtime_libraries
-  DEPENDS asan_blacklist ${ASAN_RUNTIME_LIBRARIES})
+add_dependencies(asan asan_blacklist)
 
 if(LLVM_INCLUDE_TESTS)
   add_subdirectory(tests)

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=201417&r1=201416&r2=201417&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Fri Feb 14 08:45:13 2014
@@ -87,9 +87,9 @@ macro(asan_compile obj_list source arch)
   get_target_flags_for_arch(${arch} TARGET_CFLAGS)
   clang_compile(${output_obj} ${source}
                 CFLAGS ${ARGN} ${TARGET_CFLAGS}
-                DEPS gtest asan_runtime_libraries
-                           ${ASAN_UNITTEST_HEADERS}
-                           ${ASAN_BLACKLIST_FILE})
+                DEPS gtest asan
+                     ${ASAN_UNITTEST_HEADERS}
+                     ${ASAN_BLACKLIST_FILE})
   list(APPEND ${obj_list} ${output_obj})
 endmacro()
 
@@ -98,7 +98,7 @@ endmacro()
 macro(add_asan_test test_suite test_name arch)
   parse_arguments(TEST "OBJECTS;LINKFLAGS" "WITH_TEST_RUNTIME" ${ARGN})
   get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
-  set(TEST_DEPS asan_runtime_libraries ${TEST_OBJECTS})
+  set(TEST_DEPS asan ${TEST_OBJECTS})
   if(TEST_WITH_TEST_RUNTIME)
     list(APPEND TEST_DEPS ${ASAN_TEST_RUNTIME})
     list(APPEND TEST_OBJECTS lib${ASAN_TEST_RUNTIME}.a)

Modified: compiler-rt/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/CMakeLists.txt?rev=201417&r1=201416&r2=201417&view=diff
==============================================================================
--- compiler-rt/trunk/test/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/CMakeLists.txt Fri Feb 14 08:45:13 2014
@@ -9,7 +9,7 @@ configure_lit_site_cfg(
 # Run sanitizer tests only if we're sure that clang would produce
 # working binaries.
 if(COMPILER_RT_CAN_EXECUTE_TESTS)
-  if(ASAN_SUPPORTED_ARCH)
+  if(ASAN_SUPPORTED_ARCH OR ANDROID)
     add_subdirectory(asan)
   endif()
   if(DFSAN_SUPPORTED_ARCH)

Modified: compiler-rt/trunk/test/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/CMakeLists.txt?rev=201417&r1=201416&r2=201417&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/asan/CMakeLists.txt Fri Feb 14 08:45:13 2014
@@ -49,7 +49,7 @@ endif()
 # Run ASan tests only if we're sure we may produce working binaries.
 set(ASAN_TEST_DEPS
   ${SANITIZER_COMMON_LIT_TEST_DEPS}
-  asan_runtime_libraries)
+  asan)
 set(ASAN_TEST_PARAMS
   asan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
 # FIXME: support unit test in the android test runner

Modified: compiler-rt/trunk/test/lsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lsan/CMakeLists.txt?rev=201417&r1=201416&r2=201417&view=diff
==============================================================================
--- compiler-rt/trunk/test/lsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/lsan/CMakeLists.txt Fri Feb 14 08:45:13 2014
@@ -14,7 +14,7 @@ if(NOT APPLE AND NOT ANDROID)
   set(LSAN_TEST_DEPS
     ${SANITIZER_COMMON_LIT_TEST_DEPS}
     lsan
-    asan_runtime_libraries)
+    asan)
   add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
     ${CMAKE_CURRENT_BINARY_DIR}/LsanConfig
     ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig

Modified: compiler-rt/trunk/test/ubsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/CMakeLists.txt?rev=201417&r1=201416&r2=201417&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/test/ubsan/CMakeLists.txt Fri Feb 14 08:45:13 2014
@@ -11,7 +11,7 @@ configure_lit_site_cfg(
 set(UBSAN_TEST_DEPS
   ${SANITIZER_COMMON_LIT_TEST_DEPS}
   ubsan
-  asan_runtime_libraries)
+  asan)
 add_lit_testsuite(check-ubsan "Running UndefinedBehaviorSanitizer tests"
   ${CMAKE_CURRENT_BINARY_DIR}/UbsanConfig
   ${CMAKE_CURRENT_BINARY_DIR}/AsanConfig





More information about the llvm-commits mailing list