[compiler-rt] r182380 - [ASan] create default (empty) ASan blacklist file in resource directory
Alexey Samsonov
samsonov at google.com
Tue May 21 06:48:27 PDT 2013
Author: samsonov
Date: Tue May 21 08:48:27 2013
New Revision: 182380
URL: http://llvm.org/viewvc/llvm-project?rev=182380&view=rev
Log:
[ASan] create default (empty) ASan blacklist file in resource directory
Added:
compiler-rt/trunk/lib/asan/asan_blacklist.txt
compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc
Modified:
compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
compiler-rt/trunk/lib/asan/CMakeLists.txt
compiler-rt/trunk/lib/asan/lit_tests/CMakeLists.txt
Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=182380&r1=182379&r2=182380&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Tue May 21 08:48:27 2013
@@ -129,3 +129,13 @@ macro(add_compiler_rt_test test_suite te
# Make the test suite depend on the binary.
add_dependencies(${test_suite} ${test_name})
endmacro()
+
+macro(add_compiler_rt_resource_file target_name file_name)
+ set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}")
+ set(dst_file "${CLANG_RESOURCE_DIR}/${file_name}")
+ add_custom_target(${target_name}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file}
+ DEPENDS ${file_name})
+ # Install in Clang resource directory.
+ install(FILES ${file_name} DESTINATION ${LIBCLANG_INSTALL_PATH})
+endmacro()
Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=182380&r1=182379&r2=182380&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Tue May 21 08:48:27 2013
@@ -92,6 +92,8 @@ else()
endforeach()
endif()
+add_compiler_rt_resource_file(asan_blacklist asan_blacklist.txt)
+
if(LLVM_INCLUDE_TESTS)
add_subdirectory(tests)
endif()
Added: compiler-rt/trunk/lib/asan/asan_blacklist.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_blacklist.txt?rev=182380&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_blacklist.txt (added)
+++ compiler-rt/trunk/lib/asan/asan_blacklist.txt Tue May 21 08:48:27 2013
@@ -0,0 +1,10 @@
+# Blacklist for AddressSanitizer. Turns off instrumentation of particular
+# functions or sources. Use with care. You may set location of blacklist
+# at compile-time using -fsanitize-blacklist=<path> flag.
+
+# Example usage:
+# fun:*_ZN4base6subtle*
+# src:file_with_tricky_code.cc
+# global:*global_with_bad_access_or_initialization*
+# global-init:*global_with_initialization_issues*
+# global-init-type:*Namespace::ClassName*
Modified: compiler-rt/trunk/lib/asan/lit_tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/CMakeLists.txt?rev=182380&r1=182379&r2=182380&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/CMakeLists.txt Tue May 21 08:48:27 2013
@@ -15,7 +15,8 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS)
# 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_RUNTIME_LIBRARIES}
+ asan_blacklist)
set(ASAN_TEST_PARAMS
asan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
)
Added: compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc?rev=182380&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc (added)
+++ compiler-rt/trunk/lib/asan/lit_tests/default_blacklist.cc Tue May 21 08:48:27 2013
@@ -0,0 +1,3 @@
+// Test that ASan uses the default blacklist from resource directory.
+// RUN: %clangxx_asan -### %s 2>&1 | FileCheck %s
+// CHECK: fsanitize-blacklist={{.*}}asan_blacklist.txt
More information about the llvm-commits
mailing list