From: George Karpenkov Date: Wed, 23 Aug 2017 00:42:22 +0000 (+0000) Subject: Update Clang fuzzers to use libFuzzer bundled with the toolchain. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ecd7752cac1f7186d7dd70fba9b32d9938a5ecc5;p=clang Update Clang fuzzers to use libFuzzer bundled with the toolchain. Differential Revision: https://reviews.llvm.org/D37043 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311516 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/clang-format/fuzzer/CMakeLists.txt b/tools/clang-format/fuzzer/CMakeLists.txt index c7772fcb2f..9dc4f2a6e8 100644 --- a/tools/clang-format/fuzzer/CMakeLists.txt +++ b/tools/clang-format/fuzzer/CMakeLists.txt @@ -1,11 +1,11 @@ set(LLVM_LINK_COMPONENTS support) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer") + add_clang_executable(clang-format-fuzzer EXCLUDE_FROM_ALL ClangFormatFuzzer.cpp ) target_link_libraries(clang-format-fuzzer - ${CLANG_FORMAT_LIB_DEPS} - LLVMFuzzer - ) + ${CLANG_FORMAT_LIB_DEPS}) diff --git a/tools/clang-fuzzer/CMakeLists.txt b/tools/clang-fuzzer/CMakeLists.txt index ac2791aba8..694dd585c2 100644 --- a/tools/clang-fuzzer/CMakeLists.txt +++ b/tools/clang-fuzzer/CMakeLists.txt @@ -1,5 +1,6 @@ if( LLVM_USE_SANITIZE_COVERAGE ) set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer") if(CLANG_ENABLE_PROTO_FUZZER) # Create protobuf .h and .cc files, and put them in a library for use by @@ -38,7 +39,6 @@ if( LLVM_USE_SANITIZE_COVERAGE ) clangCXXProto clangHandleCXX clangProtoToCXX - LLVMFuzzer ) else() # Hack to bypass LLVM's cmake sources check and allow multiple libraries and @@ -55,6 +55,5 @@ if( LLVM_USE_SANITIZE_COVERAGE ) target_link_libraries(clang-fuzzer clangHandleCXX - LLVMFuzzer ) endif()