forked from OSchip/llvm-project
Revert r160669 (except for compile flag updates)
llvm-svn: 160671
This commit is contained in:
parent
69bee8d8f6
commit
65d842ae51
|
@ -36,26 +36,15 @@ if (SUPPORTS_NO_VARIADIC_MACROS_FLAG)
|
|||
list(APPEND ASAN_CFLAGS -Wno-variadic-macros)
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
list(APPEND ASAN_CFLAGS -mmacosx-version-min=10.5)
|
||||
endif()
|
||||
|
||||
set(ASAN_COMMON_DEFINITIONS
|
||||
ASAN_HAS_EXCEPTIONS=1
|
||||
ASAN_NEEDS_SEGV=1
|
||||
)
|
||||
|
||||
# Compute the Clang version from the LLVM version.
|
||||
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
|
||||
${PACKAGE_VERSION})
|
||||
|
||||
# Set up paths to ASan runtime that Clang driver passes to linker.
|
||||
if (APPLE)
|
||||
# FIXME: We need to build OS X universal binary libclang_rt.asan-osx.a
|
||||
# instead of two arch-specific binaries.
|
||||
set(clang_lib_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/darwin)
|
||||
list(APPEND ASAN_CFLAGS -mmacosx-version-min=10.5)
|
||||
elseif (UNIX)
|
||||
# Assume Linux.
|
||||
set(clang_lib_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/linux)
|
||||
endif()
|
||||
|
||||
if(CAN_TARGET_X86_64)
|
||||
add_library(clang_rt.asan-x86_64 STATIC
|
||||
${ASAN_SOURCES}
|
||||
|
@ -68,10 +57,6 @@ if(CAN_TARGET_X86_64)
|
|||
)
|
||||
set_property(TARGET clang_rt.asan-x86_64 APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
${ASAN_COMMON_DEFINITIONS})
|
||||
add_custom_command (TARGET clang_rt.asan-x86_64 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:clang_rt.asan-x86_64>
|
||||
${clang_lib_dir}/libclang_rt.asan-x86_64.a
|
||||
COMMENT "Copying libclang_rt.asan-x86_64.a to Clang lib dir...")
|
||||
endif()
|
||||
if(CAN_TARGET_I386)
|
||||
add_library(clang_rt.asan-i386 STATIC
|
||||
|
@ -85,10 +70,6 @@ if(CAN_TARGET_I386)
|
|||
)
|
||||
set_property(TARGET clang_rt.asan-i386 APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
${ASAN_COMMON_DEFINITIONS})
|
||||
add_custom_command (TARGET clang_rt.asan-i386 POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:clang_rt.asan-i386>
|
||||
${clang_lib_dir}/libclang_rt.asan-i386.a
|
||||
COMMENT "Copying libclang_rt.asan-i386.a to Clang lib dir...")
|
||||
endif()
|
||||
|
||||
if(LLVM_INCLUDE_TESTS)
|
||||
|
|
Loading…
Reference in New Issue