diff options
author | Dan Liew <dan@su-root.co.uk> | 2016-05-26 20:55:09 +0000 |
---|---|---|
committer | Dan Liew <dan@su-root.co.uk> | 2016-05-26 20:55:09 +0000 |
commit | c752a2642895e496ab4ded99deda7e8cec4bbcab (patch) | |
tree | 2ec6f88cd1b8fa23bb1ab49280630f7535f7f0c9 | |
parent | 676892a5d5d90871cc0af4cd72916bfe15e0cf71 (diff) | |
download | bcm5719-llvm-c752a2642895e496ab4ded99deda7e8cec4bbcab.tar.gz bcm5719-llvm-c752a2642895e496ab4ded99deda7e8cec4bbcab.zip |
[LibFuzzer] Emit error if LLVM_USE_SANITIZER is not correctly set.
Previously CMake would successfully configure and compile (with warnings
about ``-fsanitize-coverage=...`` being unused) but the tests LibFuzzer
tests would fail.
Differential Revision: http://reviews.llvm.org/D20662
llvm-svn: 270913
-rw-r--r-- | llvm/lib/Fuzzer/CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/CMakeLists.txt b/llvm/lib/Fuzzer/CMakeLists.txt index 6bd1d288be8..e513ac7bbdd 100644 --- a/llvm/lib/Fuzzer/CMakeLists.txt +++ b/llvm/lib/Fuzzer/CMakeLists.txt @@ -2,6 +2,12 @@ set(LIBFUZZER_FLAGS_BASE "${CMAKE_CXX_FLAGS}") # Disable the coverage and sanitizer instrumentation for the fuzzer itself. set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fno-sanitize=all -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters -Werror") if( LLVM_USE_SANITIZE_COVERAGE ) + if(NOT "${LLVM_USE_SANITIZER}" STREQUAL "Address") + message(FATAL_ERROR + "LibFuzzer and its tests require LLVM_USE_SANITIZER=Address and " + "LLVM_USE_SANITIZE_COVERAGE=YES to be set." + ) + endif() add_library(LLVMFuzzerNoMainObjects OBJECT FuzzerCrossOver.cpp FuzzerTraceState.cpp |