From f8d3fb24f9a40efa40128a74ce919b9a2e88f13f Mon Sep 17 00:00:00 2001 From: Kostya Kortchinsky Date: Thu, 22 Mar 2018 15:04:31 +0000 Subject: [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328204 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/lsan/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/lsan') diff --git a/lib/lsan/CMakeLists.txt b/lib/lsan/CMakeLists.txt index 60da3e186..86b2bc1e3 100644 --- a/lib/lsan/CMakeLists.txt +++ b/lib/lsan/CMakeLists.txt @@ -43,6 +43,7 @@ if(COMPILER_RT_HAS_LSAN) RTInterception RTSanitizerCommon RTSanitizerCommonLibc + RTSanitizerCommonCoverage CFLAGS ${LSAN_CFLAGS} LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS} LINK_LIBS ${LSAN_LINK_LIBS} @@ -56,6 +57,7 @@ if(COMPILER_RT_HAS_LSAN) $ $ $ + $ $ CFLAGS ${LSAN_CFLAGS} PARENT_TARGET lsan) -- cgit v1.2.3