Index: llvm-toolchain-snapshot_14~++20210815095329+44d0a99a12ec/compiler-rt/lib/hwasan/CMakeLists.txt =================================================================== --- llvm-toolchain-snapshot_14~++20210815095329+44d0a99a12ec.orig/compiler-rt/lib/hwasan/CMakeLists.txt +++ llvm-toolchain-snapshot_14~++20210815095329+44d0a99a12ec/compiler-rt/lib/hwasan/CMakeLists.txt @@ -52,9 +52,9 @@ endif() set(HWASAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(OFF HWASAN_RTL_CFLAGS) -append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC HWASAN_RTL_CFLAGS) +append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC -fuse-ld=gold HWASAN_RTL_CFLAGS) # Prevent clang from generating libc calls. -append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding HWASAN_RTL_CFLAGS) +append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding -fuse-ld=gold HWASAN_RTL_CFLAGS) # Too many existing bugs, needs cleanup. append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format HWASAN_RTL_CFLAGS) @@ -69,7 +69,7 @@ if(ANDROID) endif() endif() -set(HWASAN_DYNAMIC_CFLAGS ${HWASAN_RTL_CFLAGS}) +set(HWASAN_DYNAMIC_CFLAGS ${HWASAN_RTL_CFLAGS} -fuse-ld=gold) append_list_if(COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC -ftls-model=initial-exec HWASAN_DYNAMIC_CFLAGS) append_list_if(MSVC /DEBUG HWASAN_DYNAMIC_LINK_FLAGS) @@ -163,7 +163,7 @@ function(add_hwasan_runtimes arch use_al LIBS ${hwasan_runtime}-${arch} ${hwasan_runtime}_cxx-${arch} EXTRA hwasan.syms.extra) set(VERSION_SCRIPT_FLAG - -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${hwasan_runtime}-dynamic-${arch}.vers) + -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${hwasan_runtime}-dynamic-${arch}.vers -fuse-ld=gold) set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp APPEND PROPERTY