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

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 19:10:59 PST 2017


phosek added a comment.

I managed to get this also working with GCC, but while testing the change and I noticed that 3 unit tests are currently failing, all with the same segfault: https://reviews.llvm.org/P8047, https://reviews.llvm.org/P8048, https://reviews.llvm.org/P8049. I'm debugging this now trying to figure what's the problem.



================
Comment at: test/fuzzer/lit.cfg:57
+  else:
+    link_cmd = '-lc++' if 'darwin' in config.target_triple else '-lstdc++'
   std_cmd = '-std=c++11' if is_cpp else ''
----------------
morehouse wrote:
> What is the difference between `-stdlib=libc++` and `-lc++`?  Why does the original code use `-lc++` instead?
`-stdlib=libc++` is handled by the driver which sets up the header include paths (i.e. the C++ library header path which is different for lib++ and stdlibc++) appropriately and adds all necessary libraries which could be more than just `-lc++`, e.g. `-lc++abi` or `-lunwind`. I don't know why the original code is setting the library explicitly since this should normally be handled by the driver appropriately for each host.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D37631





More information about the llvm-commits mailing list