Index: compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake =================================================================== --- compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake +++ compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake @@ -8,11 +8,17 @@ # that need to be exported from sanitizer runtime "". Function # interceptors are exported automatically, user can also provide files with # symbol names that should be exported as well. -# add_sanitizer_rt_symbols( ) +# add_sanitizer_rt_symbols( +# EXTRA ) macro(add_sanitizer_rt_symbols name) + cmake_parse_arguments(ARG + "" + "" + "EXTRA" + ${ARGN}) set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${name}.syms-stamp) set(extra_args) - foreach(arg ${ARGN}) + foreach(arg ${ARG_EXTRA}) list(APPEND extra_args "--extra" ${arg}) endforeach() add_custom_command(OUTPUT ${stamp} @@ -20,13 +26,13 @@ ${SANITIZER_GEN_DYNAMIC_LIST} ${extra_args} $ > $.syms COMMAND ${CMAKE_COMMAND} -E touch ${stamp} - DEPENDS ${name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN} + DEPENDS ${name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating exported symbols for ${name}" VERBATIM) add_custom_target(${name}-symbols ALL DEPENDS ${stamp} - SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN}) + SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA}) if(NOT CMAKE_VERSION VERSION_LESS 3.0) install(FILES $.syms Index: compiler-rt/trunk/lib/asan/CMakeLists.txt =================================================================== --- compiler-rt/trunk/lib/asan/CMakeLists.txt +++ compiler-rt/trunk/lib/asan/CMakeLists.txt @@ -191,7 +191,8 @@ if (UNIX AND NOT ${arch} MATCHES "i386|i686") add_sanitizer_rt_symbols(clang_rt.asan_cxx-${arch}) add_dependencies(asan clang_rt.asan_cxx-${arch}-symbols) - add_sanitizer_rt_symbols(clang_rt.asan-${arch} asan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.asan-${arch} + EXTRA asan.syms.extra) add_dependencies(asan clang_rt.asan-${arch}-symbols) endif() Index: compiler-rt/trunk/lib/dfsan/CMakeLists.txt =================================================================== --- compiler-rt/trunk/lib/dfsan/CMakeLists.txt +++ compiler-rt/trunk/lib/dfsan/CMakeLists.txt @@ -24,7 +24,8 @@ $ CFLAGS ${DFSAN_CFLAGS} PARENT_TARGET dfsan) - add_sanitizer_rt_symbols(clang_rt.dfsan-${arch} dfsan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.dfsan-${arch} + EXTRA dfsan.syms.extra) add_dependencies(dfsan clang_rt.dfsan-${arch}-symbols) endforeach() Index: compiler-rt/trunk/lib/msan/CMakeLists.txt =================================================================== --- compiler-rt/trunk/lib/msan/CMakeLists.txt +++ compiler-rt/trunk/lib/msan/CMakeLists.txt @@ -47,8 +47,10 @@ list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch} clang_rt.msan_cxx-${arch}) if(UNIX) - add_sanitizer_rt_symbols(clang_rt.msan-${arch} msan.syms.extra) - add_sanitizer_rt_symbols(clang_rt.msan_cxx-${arch} msan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.msan-${arch} + EXTRA msan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.msan_cxx-${arch} + EXTRA msan.syms.extra) add_dependencies(msan clang_rt.msan-${arch}-symbols clang_rt.msan_cxx-${arch}-symbols) endif() Index: compiler-rt/trunk/lib/tsan/CMakeLists.txt =================================================================== --- compiler-rt/trunk/lib/tsan/CMakeLists.txt +++ compiler-rt/trunk/lib/tsan/CMakeLists.txt @@ -118,8 +118,10 @@ CFLAGS ${TSAN_RTL_CFLAGS}) list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch} clang_rt.tsan_cxx-${arch}) - add_sanitizer_rt_symbols(clang_rt.tsan-${arch} rtl/tsan.syms.extra) - add_sanitizer_rt_symbols(clang_rt.tsan_cxx-${arch} rtl/tsan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.tsan-${arch} + EXTRA rtl/tsan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.tsan_cxx-${arch} + EXTRA rtl/tsan.syms.extra) add_dependencies(tsan clang_rt.tsan-${arch} clang_rt.tsan_cxx-${arch} clang_rt.tsan-${arch}-symbols Index: compiler-rt/trunk/lib/ubsan/CMakeLists.txt =================================================================== --- compiler-rt/trunk/lib/ubsan/CMakeLists.txt +++ compiler-rt/trunk/lib/ubsan/CMakeLists.txt @@ -96,8 +96,10 @@ foreach(arch ${UBSAN_SUPPORTED_ARCH}) if (UNIX AND NOT ${arch} MATCHES "i386|i686") - add_sanitizer_rt_symbols(clang_rt.ubsan_standalone-${arch} ubsan.syms.extra) - add_sanitizer_rt_symbols(clang_rt.ubsan_standalone_cxx-${arch} ubsan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.ubsan_standalone-${arch} + EXTRA ubsan.syms.extra) + add_sanitizer_rt_symbols(clang_rt.ubsan_standalone_cxx-${arch} + EXTRA ubsan.syms.extra) add_dependencies(ubsan clang_rt.ubsan_standalone-${arch}-symbols clang_rt.ubsan_standalone_cxx-${arch}-symbols)