[PATCH] D58013: [compiler-rt] Build custom libcxx with libcxxabi

Jonas Hahnfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 14 01:43:40 PST 2019


Hahnfeld marked an inline comment as done.
Hahnfeld added inline comments.


================
Comment at: compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt:21
+set(LIBCXX_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
+
+add_subdirectory(${COMPILER_RT_LIBCXX_PATH} ${CMAKE_CURRENT_BINARY_DIR}/cxx)
----------------
phosek wrote:
> Should we also set `-DLIBCXX_ENABLE_EXCEPTIONS=OFF` to avoid the dependency on unwinder (e.g. libunwind or libgcc_s)? We already do this for libFuzzer but would it also make sense for MSan and TSan copies?
Yes, I guess that makes sense.


================
Comment at: compiler-rt/lib/fuzzer/CMakeLists.txt:139
       CMAKE_ARGS -DCMAKE_CXX_COMPILER_WORKS=ON
-                 -DLIBCXX_ENABLE_EXCEPTIONS=OFF
-                 -DLIBCXX_ENABLE_SHARED=OFF
-                 -DLIBCXX_ABI_NAMESPACE=Fuzzer
-                 -DLIBCXX_CXX_ABI=none)
+                 -DLIBCXX_ABI_NAMESPACE=Fuzzer)
     target_compile_options(RTfuzzer.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
----------------
I've also tried to remove the ABI namespace (and adjusting `LIBFUZZER_CFLAGS`) but that resulted in Segfaults during runtime. From a first look it appeared that some relocations were broken in the binary, resulting in calling address `0x0`, but I'll need to investigate. I'd say that's out of the scope of this patch anyway.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58013/new/

https://reviews.llvm.org/D58013





More information about the llvm-commits mailing list