Index: cmake/Modules/AddCompilerRT.cmake =================================================================== --- cmake/Modules/AddCompilerRT.cmake +++ cmake/Modules/AddCompilerRT.cmake @@ -106,7 +106,8 @@ set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) else() set(libname "${name}-dynamic-${arch}") - set(extra_linkflags_${libname} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS} ${LIB_LINKFLAGS}) + set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + set(extra_linkflags_${libname} ${TARGET_${arch}_LINKFLAGS} ${LIB_LINKFLAGS}) if(WIN32) set(output_name_${libname} ${name}_dynamic-${arch}${COMPILER_RT_OS_SUFFIX}) else() Index: cmake/Modules/CompilerRTUtils.cmake =================================================================== --- cmake/Modules/CompilerRTUtils.cmake +++ cmake/Modules/CompilerRTUtils.cmake @@ -107,6 +107,7 @@ # If successful, saves target flags for this architecture. macro(test_target_arch arch def) set(TARGET_${arch}_CFLAGS ${ARGN}) + set(TARGET_${arch}_LINKFLAGS ${ARGN}) set(argstring "") foreach(arg ${ARGN}) set(argstring "${argstring} ${arg}") Index: cmake/base-config-ix.cmake =================================================================== --- cmake/base-config-ix.cmake +++ cmake/base-config-ix.cmake @@ -107,9 +107,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") append("${MSVC_VERSION_FLAG}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) elseif (COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang") - # Add this flag to test compiles to suppress clang's auto-detection - # logic. - append("${MSVC_VERSION_FLAG}" COMPILER_RT_TEST_COMPILER_CFLAGS) + # Add this flag to test compiles to suppress clang's auto-detection + # logic. + append("${MSVC_VERSION_FLAG}" COMPILER_RT_TEST_COMPILER_CFLAGS) endif() endif() endif() @@ -130,9 +130,9 @@ test_target_arch(i386 __i386__ "-m32") else() if (CMAKE_SIZEOF_VOID_P EQUAL 4) - test_target_arch(i386 "" "") + test_target_arch(i386 "" "") else() - test_target_arch(x86_64 "" "") + test_target_arch(x86_64 "" "") endif() endif() elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc") Index: lib/asan/CMakeLists.txt =================================================================== --- lib/asan/CMakeLists.txt +++ lib/asan/CMakeLists.txt @@ -75,7 +75,7 @@ # Compile ASan sources into an object library. -add_compiler_rt_object_libraries(RTAsan_dynamic +add_compiler_rt_object_libraries(RTAsan_dynamic OS ${SANITIZER_COMMON_SUPPORTED_OS} ARCHS ${ASAN_SUPPORTED_ARCH} SOURCES ${ASAN_SOURCES} ${ASAN_CXX_SOURCES} @@ -122,7 +122,7 @@ PARENT_TARGET asan) else() # Build separate libraries for each target. - + set(ASAN_COMMON_RUNTIME_OBJECT_LIBS RTInterception RTSanitizerCommon @@ -166,8 +166,8 @@ -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/dummy.cc - PROPERTIES - OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers) + PROPERTIES + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers) else() set(VERSION_SCRIPT_FLAG) endif() Index: make/platform/clang_linux.mk =================================================================== --- make/platform/clang_linux.mk +++ make/platform/clang_linux.mk @@ -11,7 +11,7 @@ # cross compilers). For now, we just find the target architecture of the # compiler and only define configurations we know that compiler can generate. CompilerTargetTriple := $(shell \ - LANG=C $(CC) -v 2>&1 | grep 'Target:' | cut -d' ' -f2) + LANG=C $(CC) -v 2>&1 | grep 'Target:' | cut -d' ' -f2) ifeq ($(CompilerTargetTriple),) $(error "unable to infer compiler target triple for $(CC)") endif