2016-08-27 04:52:22 +08:00
|
|
|
add_compiler_rt_component(cfi)
|
2015-12-16 07:00:33 +08:00
|
|
|
|
2017-10-10 01:07:47 +08:00
|
|
|
if(OS_NAME MATCHES "Linux")
|
|
|
|
set(CFI_SOURCES cfi.cc)
|
2015-12-16 07:00:33 +08:00
|
|
|
|
2017-10-10 01:07:47 +08:00
|
|
|
include_directories(..)
|
2015-12-16 07:00:33 +08:00
|
|
|
|
2017-10-10 01:07:47 +08:00
|
|
|
set(CFI_CFLAGS
|
|
|
|
${SANITIZER_COMMON_CFLAGS}
|
|
|
|
)
|
2015-12-16 07:00:33 +08:00
|
|
|
|
2017-10-10 01:07:47 +08:00
|
|
|
set(CFI_DIAG_CFLAGS
|
|
|
|
-DCFI_ENABLE_DIAG=1
|
|
|
|
)
|
2015-12-16 08:38:41 +08:00
|
|
|
|
2017-10-10 01:07:47 +08:00
|
|
|
foreach(arch ${CFI_SUPPORTED_ARCH})
|
|
|
|
add_compiler_rt_runtime(clang_rt.cfi
|
|
|
|
STATIC
|
|
|
|
ARCHS ${arch}
|
|
|
|
SOURCES ${CFI_SOURCES}
|
|
|
|
OBJECT_LIBS RTInterception
|
|
|
|
RTSanitizerCommon
|
|
|
|
RTSanitizerCommonLibc
|
|
|
|
CFLAGS ${CFI_CFLAGS}
|
|
|
|
PARENT_TARGET cfi)
|
|
|
|
add_compiler_rt_runtime(clang_rt.cfi_diag
|
|
|
|
STATIC
|
|
|
|
ARCHS ${arch}
|
|
|
|
SOURCES ${CFI_SOURCES}
|
|
|
|
OBJECT_LIBS RTInterception
|
|
|
|
RTSanitizerCommon
|
|
|
|
RTSanitizerCommonLibc
|
|
|
|
RTUbsan
|
|
|
|
CFLAGS ${CFI_CFLAGS} ${CFI_DIAG_CFLAGS}
|
|
|
|
PARENT_TARGET cfi)
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2015-12-16 07:00:33 +08:00
|
|
|
|
2016-02-24 05:50:39 +08:00
|
|
|
add_compiler_rt_resource_file(cfi_blacklist cfi_blacklist.txt cfi)
|