2016-08-27 04:52:22 +08:00
|
|
|
add_compiler_rt_component(cfi)
|
2015-12-16 07:00:33 +08:00
|
|
|
|
2018-10-02 02:01:55 +08:00
|
|
|
if(OS_NAME MATCHES "Linux" OR OS_NAME MATCHES "FreeBSD" OR OS_NAME MATCHES "NetBSD")
|
2019-03-01 06:03:41 +08:00
|
|
|
set(CFI_SOURCES
|
|
|
|
cfi.cpp
|
|
|
|
)
|
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
|
[sanitizer] Split coverage into separate RT in sanitizer_common
Summary:
`sanitizer_common`'s coverage support is fairly well separated, and libcdep by
default. Several sanitizers don't make use of coverage, and as far as I can
tell do no benefit from the extra dependencies pulled in by the coverage public
interface functions.
The following sanitizers call `InitializeCoverage` explicitely: MSan, ASan,
LSan, HWAsan, UBSan. On top of this, any sanitizer bundling RTUBSan should
add the coverage RT as well: ASan, Scudo, UBSan, CFI (diag), TSan, MSan, HWAsan.
So in the end the following have no need: DFSan, ESan, CFI, SafeStack (nolibc
anyway), XRay, and the upcoming Scudo minimal runtime.
I tested this with all the sanitizers check-* with gcc & clang, and in
standalone on Linux & Android, and there was no issue. I couldn't test this on
Mac, Fuchsia, BSDs, & Windows for lack of an environment, so adding a bunch of
people for additional scrunity. I couldn't test HWAsan either.
Reviewers: eugenis, vitalybuka, alekseyshl, flowerhack, kubamracek, dberris, rnk, krytarowski
Reviewed By: vitalybuka, alekseyshl, flowerhack, dberris
Subscribers: mgorny, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D44701
llvm-svn: 328204
2018-03-22 23:04:31 +08:00
|
|
|
RTSanitizerCommonCoverage
|
2018-04-17 00:58:34 +08:00
|
|
|
RTSanitizerCommonSymbolizer
|
2017-10-10 01:07:47 +08:00
|
|
|
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)
|