Index: cmake/modules/HandleLLVMOptions.cmake =================================================================== --- cmake/modules/HandleLLVMOptions.cmake +++ cmake/modules/HandleLLVMOptions.cmake @@ -664,7 +664,7 @@ FSANITIZE_USE_AFTER_SCOPE_FLAG) endif() if (LLVM_USE_SANITIZE_COVERAGE) - append("-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + append("-fsanitize=fuzzer-no-link" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() endif() Index: tools/llvm-as-fuzzer/CMakeLists.txt =================================================================== --- tools/llvm-as-fuzzer/CMakeLists.txt +++ tools/llvm-as-fuzzer/CMakeLists.txt @@ -1,13 +1,12 @@ if( LLVM_USE_SANITIZE_COVERAGE ) + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer") set(LLVM_LINK_COMPONENTS AsmParser BitWriter Core Support ) - add_llvm_tool(llvm-as-fuzzer + add_llvm_tool(llvm-as-fuzzer llvm-as-fuzzer.cpp) - target_link_libraries(llvm-as-fuzzer - LLVMFuzzer - ) endif() Index: tools/llvm-dwarfdump/fuzzer/CMakeLists.txt =================================================================== --- tools/llvm-dwarfdump/fuzzer/CMakeLists.txt +++ tools/llvm-dwarfdump/fuzzer/CMakeLists.txt @@ -4,11 +4,9 @@ Support ) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer") + add_llvm_executable(llvm-dwarfdump-fuzzer EXCLUDE_FROM_ALL llvm-dwarfdump-fuzzer.cpp ) - -target_link_libraries(llvm-dwarfdump-fuzzer - LLVMFuzzer - ) Index: tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp =================================================================== --- tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp +++ tools/llvm-dwarfdump/fuzzer/llvm-dwarfdump-fuzzer.cpp @@ -32,5 +32,9 @@ } ObjectFile &Obj = *ObjOrErr.get(); std::unique_ptr DICtx = DWARFContext::create(Obj); - DICtx->dump(nulls(), DIDT_All); + + + DIDumpOptions opts; + opts.DumpType = DIDT_All; + DICtx->dump(nulls(), opts); } Index: tools/llvm-mc-assemble-fuzzer/CMakeLists.txt =================================================================== --- tools/llvm-mc-assemble-fuzzer/CMakeLists.txt +++ tools/llvm-mc-assemble-fuzzer/CMakeLists.txt @@ -1,6 +1,5 @@ if( LLVM_USE_SANITIZE_COVERAGE ) - include_directories(BEFORE - ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/Fuzzer) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer") set(LLVM_LINK_COMPONENTS AllTargetsAsmPrinters @@ -11,9 +10,7 @@ MCParser Support ) - add_llvm_tool(llvm-mc-assemble-fuzzer + + add_llvm_tool(llvm-mc-assemble-fuzzer llvm-mc-assemble-fuzzer.cpp) - target_link_libraries(llvm-mc-assemble-fuzzer - LLVMFuzzer - ) endif() Index: tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp =================================================================== --- tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp +++ tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp @@ -9,7 +9,6 @@ // //===----------------------------------------------------------------------===// -#include "FuzzerInterface.h" #include "llvm-c/Target.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/MC/MCAsmBackend.h" Index: tools/llvm-mc-disassemble-fuzzer/CMakeLists.txt =================================================================== --- tools/llvm-mc-disassemble-fuzzer/CMakeLists.txt +++ tools/llvm-mc-disassemble-fuzzer/CMakeLists.txt @@ -1,7 +1,6 @@ if( LLVM_USE_SANITIZE_COVERAGE ) - include_directories(BEFORE - ${CMAKE_CURRENT_SOURCE_DIR}/../../lib/Fuzzer) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer") set(LLVM_LINK_COMPONENTS AllTargetsAsmPrinters AllTargetsDescs @@ -12,10 +11,6 @@ MCParser Support ) - add_llvm_tool(llvm-mc-disassemble-fuzzer + add_llvm_tool(llvm-mc-disassemble-fuzzer llvm-mc-disassemble-fuzzer.cpp) - - target_link_libraries(llvm-mc-disassemble-fuzzer - LLVMFuzzer - ) endif() Index: tools/llvm-mc-disassemble-fuzzer/llvm-mc-disassemble-fuzzer.cpp =================================================================== --- tools/llvm-mc-disassemble-fuzzer/llvm-mc-disassemble-fuzzer.cpp +++ tools/llvm-mc-disassemble-fuzzer/llvm-mc-disassemble-fuzzer.cpp @@ -9,7 +9,6 @@ // //===----------------------------------------------------------------------===// -#include "FuzzerInterface.h" #include "llvm-c/Disassembler.h" #include "llvm-c/Target.h" #include "llvm/MC/SubtargetFeature.h"