[PATCH] D37631: [libFuzzer] Support using libc++

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 16:28:28 PST 2017


kcc added a reviewer: morehouse.
kcc added a comment.

Matt, please also take a look.



================
Comment at: CMakeLists.txt:355
 else()
-  set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/../libcxx)
+  set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx)
   if(EXISTS ${COMPILER_RT_LIBCXX_PATH}/)
----------------
Hm... 
Why ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx ? 

Also, is this related to libFuzzer? 
Could this be a separate patch? 


================
Comment at: lib/fuzzer/CMakeLists.txt:35
 
+if(CMAKE_CXX_COMPILER_ID MATCHES Clang AND COMPILER_RT_HAS_LIBCXX_SOURCES)
+  list(APPEND LIBFUZZER_CFLAGS -stdlib=libc++ -D_LIBCPP_ABI_VERSION=Fuzzer)
----------------
Why is this guarded with "CMAKE_CXX_COMPILER_ID MATCHES Clang"? 


================
Comment at: lib/fuzzer/tests/CMakeLists.txt:22
+if(CMAKE_CXX_COMPILER_ID MATCHES Clang AND COMPILER_RT_HAS_LIBCXX_SOURCES)
+  list(APPEND LIBFUZZER_UNITTEST_CFLAGS -stdlib=libc++ -D_LIBCPP_ABI_VERSION=Fuzzer)
+endif()
----------------
Why do we need stdlib=libc++ for unit tests? 

I'd rather have a separate lit test in test/fuzzer that uses stdlib=libc++. 


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D37631





More information about the llvm-commits mailing list