mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Update LLVM fuzzers to use the libFuzzer bundled with the compiler toolchain
Differential Revision: https://reviews.llvm.org/D37041 llvm-svn: 311515
This commit is contained in:
parent
1871702a49
commit
e4d95d0f5e
@ -664,7 +664,7 @@ if(LLVM_USE_SANITIZER)
|
||||
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()
|
||||
|
||||
|
@ -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()
|
||||
|
@ -4,11 +4,9 @@ set(LLVM_LINK_COMPONENTS
|
||||
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
|
||||
)
|
||||
|
@ -32,5 +32,9 @@ extern "C" void LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
|
||||
}
|
||||
ObjectFile &Obj = *ObjOrErr.get();
|
||||
std::unique_ptr<DIContext> DICtx = DWARFContext::create(Obj);
|
||||
DICtx->dump(nulls(), DIDT_All);
|
||||
|
||||
|
||||
DIDumpOptions opts;
|
||||
opts.DumpType = DIDT_All;
|
||||
DICtx->dump(nulls(), opts);
|
||||
}
|
||||
|
@ -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 @@ if( LLVM_USE_SANITIZE_COVERAGE )
|
||||
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()
|
||||
|
@ -9,7 +9,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "FuzzerInterface.h"
|
||||
#include "llvm-c/Target.h"
|
||||
#include "llvm/MC/SubtargetFeature.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
|
@ -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 @@ if( LLVM_USE_SANITIZE_COVERAGE )
|
||||
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()
|
||||
|
@ -9,7 +9,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "FuzzerInterface.h"
|
||||
#include "llvm-c/Disassembler.h"
|
||||
#include "llvm-c/Target.h"
|
||||
#include "llvm/MC/SubtargetFeature.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user