Index: cmake/Modules/SanitizerUtils.cmake =================================================================== --- cmake/Modules/SanitizerUtils.cmake +++ cmake/Modules/SanitizerUtils.cmake @@ -9,11 +9,12 @@ # interceptors are exported automatically, user can also provide files with # symbol names that should be exported as well. # add_sanitizer_rt_symbols( +# PARENT_TARGET # EXTRA ) macro(add_sanitizer_rt_symbols name) cmake_parse_arguments(ARG "" - "" + "PARENT_TARGET" "EXTRA" ${ARGN}) set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${name}.syms-stamp) @@ -50,6 +51,9 @@ install(FILES ${libfile}.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) endif() endif() + if(ARG_PARENT_TARGET) + add_dependencies(${ARG_PARENT_TARGET} ${name}-symbols) + endif() endmacro() macro(add_sanitizer_rt_version_list name) Index: lib/ubsan/CMakeLists.txt =================================================================== --- lib/ubsan/CMakeLists.txt +++ lib/ubsan/CMakeLists.txt @@ -97,12 +97,11 @@ foreach(arch ${UBSAN_SUPPORTED_ARCH}) if (UNIX AND NOT ${arch} MATCHES "i386|i686") add_sanitizer_rt_symbols(clang_rt.ubsan_standalone-${arch} + PARENT_TARGET ubsan EXTRA ubsan.syms.extra) add_sanitizer_rt_symbols(clang_rt.ubsan_standalone_cxx-${arch} + PARENT_TARGET ubsan EXTRA ubsan.syms.extra) - add_dependencies(ubsan - clang_rt.ubsan_standalone-${arch}-symbols - clang_rt.ubsan_standalone_cxx-${arch}-symbols) endif() endforeach() endif()