From: George Karpenkov Date: Mon, 7 Aug 2017 20:56:11 +0000 (+0000) Subject: Do not instrument libFuzzer itself when built with -DLLVM_USE_SANITIZE_COVERAGE X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79302ff8ea636c2656f7fe34f299ca808109987f;p=llvm Do not instrument libFuzzer itself when built with -DLLVM_USE_SANITIZE_COVERAGE Fixes regression from https://reviews.llvm.org/D36295 Differential Revision: https://reviews.llvm.org/D36428 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310305 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Fuzzer/CMakeLists.txt b/lib/Fuzzer/CMakeLists.txt index ef05b153234..daff0e693bf 100644 --- a/lib/Fuzzer/CMakeLists.txt +++ b/lib/Fuzzer/CMakeLists.txt @@ -24,6 +24,11 @@ endif() set(LIBFUZZER_ENABLE ${LIBFUZZER_ENABLED_CHECK} CACHE BOOL "Build libFuzzer and its tests") set(LIBFUZZER_ENABLE_TESTS OFF CACHE BOOL "Build libFuzzer and its tests") +if (LLVM_USE_SANITIZE_COVERAGE) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -fno-sanitize-coverage=trace-pc-guard,edge,trace-cmp,indirect-calls,8bit-counters -Werror") +endif() + if (LIBFUZZER_ENABLE) add_library(LLVMFuzzerNoMainObjects OBJECT FuzzerCrossOver.cpp