[cfe-dev] Sanitizer test failures when switching to libc++ by default

Hahnfeld, Jonas via cfe-dev cfe-dev at lists.llvm.org
Fri Feb 5 06:21:18 PST 2016


Hi all,

I'm currently looking into (optionally) switching the default C++ stdlib to
libc++ (see http://reviews.llvm.org/D15920 which hasn't received a review so
far)
I've resolved all regression test failures in clang which are now passing
cleanly.

I'm now investigating the failing sanitizer tests in compiler-rt, here's
what I got so far:
 - two tests use -static-libstdc++ which obviously needs a -stdlib=libstdc++
(asan/TestCases/throw_invoke_test.cc and tsan/static_init6.cc)
 - tsan builds an instrumented version of libc++ and adds their headers.
This leads to errors with default C headers which are #include_next'd in
libc++. These #include_next then find the headers of the "normal" libc++
which in turn instantly return because of the header guards. Therefore basic
functions like printf aren't defined.
Solution: Pass -nostdinc++ to disable the headers of the "normal" libc++
 - lsan completely fails with libc++, I had to generally pass
-stdlib=libstdc++ - is this known and possibly still work in progress?

Greetings,
Jonas

--
Jonas Hahnfeld, MATSE-Auszubildender

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
Hahnfeld at itc.rwth-aachen.de
www.itc.rwth-aachen.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5868 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160205/c58ae62c/attachment.bin>


More information about the cfe-dev mailing list