forked from OSchip/llvm-project
Add cmake rules for building LSan common on Mac OS
llvm-svn: 184639
This commit is contained in:
parent
76b7bd0e75
commit
43937b3758
|
@ -7,6 +7,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
|
||||||
add_subdirectory(interception)
|
add_subdirectory(interception)
|
||||||
add_subdirectory(sanitizer_common)
|
add_subdirectory(sanitizer_common)
|
||||||
if(NOT ANDROID)
|
if(NOT ANDROID)
|
||||||
|
add_subdirectory(lsan)
|
||||||
add_subdirectory(profile)
|
add_subdirectory(profile)
|
||||||
add_subdirectory(ubsan)
|
add_subdirectory(ubsan)
|
||||||
endif()
|
endif()
|
||||||
|
@ -16,7 +17,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
|
||||||
add_subdirectory(tsan)
|
add_subdirectory(tsan)
|
||||||
add_subdirectory(msan)
|
add_subdirectory(msan)
|
||||||
add_subdirectory(msandr)
|
add_subdirectory(msandr)
|
||||||
add_subdirectory(lsan)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# The top-level lib directory contains a large amount of C code which provides
|
# The top-level lib directory contains a large amount of C code which provides
|
||||||
|
|
|
@ -19,12 +19,10 @@ set(ASAN_SOURCES
|
||||||
asan_stack.cc
|
asan_stack.cc
|
||||||
asan_stats.cc
|
asan_stats.cc
|
||||||
asan_thread.cc
|
asan_thread.cc
|
||||||
asan_win.cc
|
asan_win.cc)
|
||||||
)
|
|
||||||
|
|
||||||
set(ASAN_DYLIB_SOURCES
|
set(ASAN_DYLIB_SOURCES
|
||||||
${ASAN_SOURCES}
|
${ASAN_SOURCES})
|
||||||
)
|
|
||||||
|
|
||||||
include_directories(..)
|
include_directories(..)
|
||||||
|
|
||||||
|
@ -58,6 +56,7 @@ if(APPLE)
|
||||||
SOURCES ${ASAN_DYLIB_SOURCES}
|
SOURCES ${ASAN_DYLIB_SOURCES}
|
||||||
$<TARGET_OBJECTS:RTInterception.osx>
|
$<TARGET_OBJECTS:RTInterception.osx>
|
||||||
$<TARGET_OBJECTS:RTSanitizerCommon.osx>
|
$<TARGET_OBJECTS:RTSanitizerCommon.osx>
|
||||||
|
$<TARGET_OBJECTS:RTLSanCommon.osx>
|
||||||
CFLAGS ${ASAN_CFLAGS}
|
CFLAGS ${ASAN_CFLAGS}
|
||||||
DEFS ${ASAN_COMMON_DEFINITIONS}
|
DEFS ${ASAN_COMMON_DEFINITIONS}
|
||||||
# Dynamic lookup is needed because shadow scale and offset are
|
# Dynamic lookup is needed because shadow scale and offset are
|
||||||
|
|
|
@ -26,7 +26,12 @@ filter_available_targets(LSAN_SUPPORTED_ARCH
|
||||||
|
|
||||||
set(LSAN_RUNTIME_LIBRARIES)
|
set(LSAN_RUNTIME_LIBRARIES)
|
||||||
|
|
||||||
if (NOT APPLE AND NOT ANDROID)
|
if(APPLE)
|
||||||
|
add_compiler_rt_osx_object_library(RTLSanCommon
|
||||||
|
ARCH ${LSAN_COMMON_SUPPORTED_ARCH}
|
||||||
|
SOURCES ${LSAN_COMMON_SOURCES}
|
||||||
|
CFLAGS ${LSAN_CFLAGS})
|
||||||
|
elseif(NOT ANDROID)
|
||||||
foreach(arch ${LSAN_COMMON_SUPPORTED_ARCH})
|
foreach(arch ${LSAN_COMMON_SUPPORTED_ARCH})
|
||||||
add_compiler_rt_object_library(RTLSanCommon ${arch}
|
add_compiler_rt_object_library(RTLSanCommon ${arch}
|
||||||
SOURCES ${LSAN_COMMON_SOURCES}
|
SOURCES ${LSAN_COMMON_SOURCES}
|
||||||
|
|
Loading…
Reference in New Issue