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

llvm-svn: 201417
This commit is contained in:
Alexey Samsonov 2014-02-14 14:45:13 +00:00
parent cbb2d5eee4
commit 9a70077b47
6 changed files with 15 additions and 18 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

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

View File

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

View File

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