blob: 9c11bb6f7e61040b91d0cd402d57eb8bb2e0d51a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
add_custom_target(safestack)
set(SAFESTACK_SOURCES safestack.cc)
include_directories(..)
set(SAFESTACK_CFLAGS ${SANITIZER_COMMON_CFLAGS})
if(APPLE)
# Build universal binary on APPLE.
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>
$<TARGET_OBJECTS:RTSanitizerCommonNoLibc.osx>
CFLAGS ${SAFESTACK_CFLAGS}
PARENT_TARGET safestack)
else()
# Otherwise, build separate libraries for each target.
foreach(arch ${SAFESTACK_SUPPORTED_ARCH})
add_compiler_rt_runtime(clang_rt.safestack
STATIC
ARCHS ${arch}
SOURCES ${SAFESTACK_SOURCES}
$<TARGET_OBJECTS:RTInterception.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
$<TARGET_OBJECTS:RTSanitizerCommonNoLibc.${arch}>
CFLAGS ${SAFESTACK_CFLAGS}
PARENT_TARGET safestack)
endforeach()
endif()
|