[PATCH] D44532: Add option to disable linking of libcxx into fuzzer
Pirama Arumuga Nainar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 15 17:11:41 PDT 2018
pirama updated this revision to Diff 138654.
pirama added a comment.
Change name of option to COMPILER_RT_FUZZER_LINK_LIBCXX.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D44532
Files:
CMakeLists.txt
lib/fuzzer/CMakeLists.txt
Index: lib/fuzzer/CMakeLists.txt
===================================================================
--- lib/fuzzer/CMakeLists.txt
+++ lib/fuzzer/CMakeLists.txt
@@ -33,7 +33,7 @@
set(LIBFUZZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH)
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH AND COMPILER_RT_FUZZER_LINK_LIBCXX)
list(APPEND LIBFUZZER_CFLAGS -nostdinc++ -D_LIBCPP_ABI_VERSION=Fuzzer)
# Remove -stdlib= which is unused when passing -nostdinc++.
string(REGEX REPLACE "-stdlib=[a-zA-Z+]*" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
@@ -81,7 +81,7 @@
CFLAGS ${LIBFUZZER_CFLAGS}
PARENT_TARGET fuzzer)
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH)
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND COMPILER_RT_LIBCXX_PATH AND COMPILER_RT_FUZZER_LINK_LIBCXX)
macro(partially_link_libcxx name dir arch)
set(cxx_${arch}_merge_dir "${CMAKE_CURRENT_BINARY_DIR}/cxx_${arch}_merge.dir")
file(MAKE_DIRECTORY ${cxx_${arch}_merge_dir})
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -38,6 +38,8 @@
mark_as_advanced(COMPILER_RT_BUILD_PROFILE)
option(COMPILER_RT_BUILD_XRAY_NO_PREINIT "Build xray with no preinit patching" OFF)
mark_as_advanced(COMPILER_RT_BUILD_XRAY_NO_PREINIT)
+option(COMPILER_RT_FUZZER_LINK_LIBCXX "Link a copy of libcxx into libfuzzer" ON)
+mark_as_advanced(COMPILER_RT_FUZZER_LINK_LIBCXX)
set(COMPILER_RT_ASAN_SHADOW_SCALE ""
CACHE STRING "Override the shadow scale to be used in ASan runtime")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44532.138654.patch
Type: text/x-patch
Size: 1647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180316/0af5db07/attachment.bin>
More information about the llvm-commits
mailing list