2016-08-27 04:52:22 +08:00
|
|
|
add_compiler_rt_component(safestack)
|
2015-06-16 05:08:47 +08:00
|
|
|
|
|
|
|
set(SAFESTACK_SOURCES safestack.cc)
|
|
|
|
|
|
|
|
include_directories(..)
|
|
|
|
|
|
|
|
set(SAFESTACK_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
# Build universal binary on APPLE.
|
2015-08-26 03:53:09 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.safestack
|
|
|
|
STATIC
|
|
|
|
OS osx
|
|
|
|
ARCHS ${SAFESTACK_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${SAFESTACK_SOURCES}
|
|
|
|
$<TARGET_OBJECTS:RTInterception.osx>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommon.osx>
|
2015-08-28 06:23:27 +08:00
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommonNoLibc.osx>
|
2015-08-26 03:53:09 +08:00
|
|
|
CFLAGS ${SAFESTACK_CFLAGS}
|
|
|
|
PARENT_TARGET safestack)
|
2015-06-16 05:08:47 +08:00
|
|
|
else()
|
|
|
|
# Otherwise, build separate libraries for each target.
|
|
|
|
foreach(arch ${SAFESTACK_SUPPORTED_ARCH})
|
2015-08-26 03:53:09 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.safestack
|
|
|
|
STATIC
|
|
|
|
ARCHS ${arch}
|
2015-06-16 05:08:47 +08:00
|
|
|
SOURCES ${SAFESTACK_SOURCES}
|
|
|
|
$<TARGET_OBJECTS:RTInterception.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
|
2015-07-24 06:05:20 +08:00
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommonNoLibc.${arch}>
|
2015-08-26 03:53:09 +08:00
|
|
|
CFLAGS ${SAFESTACK_CFLAGS}
|
|
|
|
PARENT_TARGET safestack)
|
2015-06-16 05:08:47 +08:00
|
|
|
endforeach()
|
|
|
|
endif()
|