[PATCH] D58013: [compiler-rt] Introduce SANITIZER_LIBCXX_CXX_ABI

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 10 17:38:01 PST 2019


phosek added inline comments.


================
Comment at: compiler-rt/lib/fuzzer/CMakeLists.txt:138
-                 -DLIBCXX_ABI_NAMESPACE=Fuzzer
-                 -DLIBCXX_CXX_ABI=none)
     target_compile_options(RTfuzzer.${arch} PRIVATE -isystem ${LIBCXX_${arch}_PREFIX}/include/c++/v1)
----------------
I don't think this is correct either. The problem is that on Linux you might end up mixing different C++ libraries and different C++ ABI implementations. Ideally, libFuzzer would be built against hermetic libc++abi and libc++ so it can be linked into any program independently of which C++ library it uses (or even plain C programs). This wasn't possible before, but it's possible now that libunwind, libc++abi and libc++ supports building hermetic static library.

So the ideal solution here is to build libc++abi in addition to libc++ (as hermetic libraries) and use those the same way we already do today. The resulting libFuzzer library would look like a C library from the consumer perspective. I was planning on doing that, I just haven't had time yet but I hope to get to it soon.


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D58013





More information about the llvm-commits mailing list