[PATCH] D37631: [libFuzzer] Support using libc++
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 8 10:44:31 PDT 2017
phosek created this revision.
Herald added a subscriber: mgorny.
Herald added a reviewer: EricWF.
This is needed in case the users of libFuzzer use libc++ in their code, which the fuzz target (libFuzzer) will be linked against.
Repository:
rL LLVM
https://reviews.llvm.org/D37631
Files:
CMakeLists.txt
lib/fuzzer/CMakeLists.txt
Index: lib/fuzzer/CMakeLists.txt
===================================================================
--- lib/fuzzer/CMakeLists.txt
+++ lib/fuzzer/CMakeLists.txt
@@ -32,6 +32,10 @@
set(LIBFUZZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
+if(HAVE_LIBCXX AND COMPILER_RT_ENABLE_LIBCXX)
+ append_list_if(COMPILER_RT_CXX_SUPPORTS_STDLIB -stdlib=libc++ LIBFUZZER_CFLAGS)
+endif()
+
if (CMAKE_CXX_FLAGS MATCHES "fsanitize-coverage")
list(APPEND LIBFUZZER_CFLAGS -fno-sanitize-coverage=trace-pc-guard,edge,trace-cmp,indirect-calls,8bit-counters)
endif()
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -140,6 +140,11 @@
append_list_if(COMPILER_RT_HAS_LIBSTDCXX stdc++ SANITIZER_CXX_ABI_LIBRARY)
endif()
+option(COMPILER_RT_ENABLE_LIBCXX "Use libc++ if available." OFF)
+if (COMPILER_RT_ENABLE_LIBCXX)
+ check_cxx_compiler_flag("-stdlib=libc++" COMPILER_RT_CXX_SUPPORTS_STDLIB)
+endif()
+
option(SANITIZER_USE_COMPILER_RT "Use compiler-rt builtins instead of libgcc" OFF)
#================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37631.114392.patch
Type: text/x-patch
Size: 1094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170908/4a4e5c41/attachment.bin>
More information about the llvm-commits
mailing list