From 2fb4e754c64a023c16edcd69f89234300477d2f0 Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Thu, 15 Aug 2019 22:15:46 +0000 Subject: [PATCH] Guard fuzzer build behind Clang-only flags. Should fix sanitizer buildbots and any one else who's building compiler-rt using gcc. llvm-svn: 369055 --- compiler-rt/lib/gwp_asan/CMakeLists.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/compiler-rt/lib/gwp_asan/CMakeLists.txt b/compiler-rt/lib/gwp_asan/CMakeLists.txt index d32080f..53927e1 100644 --- a/compiler-rt/lib/gwp_asan/CMakeLists.txt +++ b/compiler-rt/lib/gwp_asan/CMakeLists.txt @@ -100,17 +100,18 @@ if (COMPILER_RT_HAS_GWP_ASAN) CFLAGS ${GWP_ASAN_CFLAGS} ${SANITIZER_COMMON_CFLAGS}) # Build the stack trace compressor fuzzer. - add_llvm_executable(stack_trace_compressor_fuzzer - stack_trace_compressor_fuzzer.cpp - ${GWP_ASAN_SOURCES} - ${GWP_ASAN_HEADERS}) - set_target_properties(stack_trace_compressor_fuzzer - PROPERTIES FOLDER "Fuzzers") - target_compile_options(stack_trace_compressor_fuzzer - PRIVATE -fsanitize=fuzzer-no-link) - set_target_properties(stack_trace_compressor_fuzzer PROPERTIES LINK_FLAGS - -fsanitize=fuzzer) - add_dependencies(gwp_asan stack_trace_compressor_fuzzer) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_llvm_executable(stack_trace_compressor_fuzzer + stack_trace_compressor_fuzzer.cpp + ${GWP_ASAN_SOURCES} + ${GWP_ASAN_HEADERS}) + set_target_properties(stack_trace_compressor_fuzzer + PROPERTIES FOLDER "Fuzzers") + target_compile_options(stack_trace_compressor_fuzzer + PRIVATE -fsanitize=fuzzer-no-link) + target_link_options(stack_trace_compressor_fuzzer PRIVATE -fsanitize=fuzzer) + add_dependencies(gwp_asan stack_trace_compressor_fuzzer) + endif() endif() if(COMPILER_RT_INCLUDE_TESTS) -- 2.7.4