[compiler-rt] r369551 - [GWP-ASan] Build stack_trace_compressor_fuzzer.

Mitch Phillips via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 10:52:51 PDT 2019


Author: hctim
Date: Wed Aug 21 10:52:51 2019
New Revision: 369551

URL: http://llvm.org/viewvc/llvm-project?rev=369551&view=rev
Log:
[GWP-ASan] Build stack_trace_compressor_fuzzer.

Summary:
Flips the switch to build stack_trace_compressor_fuzzer. This was recently
temporarily disabled in rL369079 as it was breaking the sanitizer buildbots.

My diagnosis of the problem is that on clang-only bootstrap builds, we build
gwp_asan before libfuzzer. This causes a discrepancy when the clang driver
attempts to link libclang_rt.fuzzer* as CMake doesn't see a dependency there.

I've (hopefully) fixed the issue by adding a direct dependency for the fuzz
target so CMake can resolve the build order properly. As part of this, the
libFuzzer 'fuzzer' target has to be discovered before the declaration of the
fuzz target.

pcc@ for mild review + notification as buildcop.

Reviewers: pcc

Reviewed By: pcc

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D66494

Modified:
    compiler-rt/trunk/lib/gwp_asan/CMakeLists.txt

Modified: compiler-rt/trunk/lib/gwp_asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/gwp_asan/CMakeLists.txt?rev=369551&r1=369550&r2=369551&view=diff
==============================================================================
--- compiler-rt/trunk/lib/gwp_asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/gwp_asan/CMakeLists.txt Wed Aug 21 10:52:51 2019
@@ -100,23 +100,21 @@ if (COMPILER_RT_HAS_GWP_ASAN)
       CFLAGS ${GWP_ASAN_CFLAGS} ${SANITIZER_COMMON_CFLAGS})
 
   # Build the stack trace compressor fuzzer.
-  # Currently commented out in order to give me some time to figure out what the
-  # issue is. Rolling back would require rolling back 5 CL's, so this should be
-  # okay until I can get to a real computer and actually fix it tomorrow.
-  # - hctim
-  #if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-  #  add_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)
-  #endif()
+  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND
+      COMPILER_RT_BUILD_LIBFUZZER)
+    add_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(stack_trace_compressor_fuzzer fuzzer)
+    add_dependencies(gwp_asan stack_trace_compressor_fuzzer)
+  endif()
 endif()
 
 if(COMPILER_RT_INCLUDE_TESTS)




More information about the llvm-commits mailing list