diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt --- a/compiler-rt/lib/asan/CMakeLists.txt +++ b/compiler-rt/lib/asan/CMakeLists.txt @@ -149,13 +149,6 @@ DEFS ${ASAN_COMMON_DEFINITIONS} DEPS ${ASAN_DEPS}) - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "") - add_compiler_rt_object_libraries(RTAsan_dynamic_version_script_dummy - ARCHS ${ASAN_SUPPORTED_ARCH} - SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp - CFLAGS ${ASAN_DYNAMIC_CFLAGS} - DEFS ${ASAN_DYNAMIC_DEFINITIONS} - DEPS ${ASAN_DEPS}) endif() # Build ASan runtimes shipped with Clang. @@ -225,6 +218,9 @@ foreach(arch ${ASAN_SUPPORTED_ARCH}) if (COMPILER_RT_HAS_VERSION_SCRIPT) + # adds a custom target clang_rt.asan-dynamic-${arch}-version-list + # which depends on vers = ${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers + # and runs python to generate it. add_sanitizer_rt_version_list(clang_rt.asan-dynamic-${arch} LIBS clang_rt.asan-${arch} clang_rt.asan_cxx-${arch} EXTRA asan.syms.extra) @@ -235,10 +231,6 @@ if (COMPILER_RT_HAS_GNU_VERSION_SCRIPT_COMPAT) list(APPEND VERSION_SCRIPT_FLAG -Wl,-z,gnu-version-script-compat) endif() - set_property(SOURCE - ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp - APPEND PROPERTY - OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers) else() set(VERSION_SCRIPT_FLAG) endif() @@ -264,12 +256,6 @@ ARCHS ${arch} OBJECT_LIBS ${ASAN_COMMON_RUNTIME_OBJECT_LIBS} RTAsan_dynamic - # The only purpose of RTAsan_dynamic_version_script_dummy is to - # carry a dependency of the shared runtime on the version script. - # Replacing it with a straightforward - # add_dependencies(clang_rt.asan-dynamic-${arch} clang_rt.asan-dynamic-${arch}-version-list) - # generates an order-only dependency in ninja. - RTAsan_dynamic_version_script_dummy RTUbsan_cxx ${ASAN_DYNAMIC_WEAK_INTERCEPTION} CFLAGS ${ASAN_DYNAMIC_CFLAGS} @@ -278,6 +264,7 @@ LINK_LIBS ${ASAN_DYNAMIC_LIBS} DEFS ${ASAN_DYNAMIC_DEFINITIONS} PARENT_TARGET asan) + add_dependencies(clang_rt.asan-dynamic-${arch} clang_rt.asan-dynamic-${arch}-version-list) if (SANITIZER_USE_SYMBOLS AND NOT ${arch} STREQUAL "i386") add_sanitizer_rt_symbols(clang_rt.asan_cxx