Building stblibc++ with support for MSAN

How can I build libstdc++ with instrumentation to allow MSAN to work?
I have attempted to follow the instructions listed at,
but there were a few issues:

1) I had to change the path that is used to find the library
2) It could not find ::max_align_t, so I simply defined it to be 16
3) "No rule to make target../src/c++11/', needed

Could not figure this out.

Any help?


Evgeniy, are these intructions still relevant?

I've updated build instructions, please see if they work for you.

Are the instructions at the same link?
That link seems to be dead now.

I tried to follow the new instructions, and at the last step (make) I get the following error

In file included from ../../libstdc++-v3/libsupc++/
In file included from /home/daniel/programming/SomeLocalDir/libstdc++-v3/libsupc++/unwind-cxx.h:35:
/home/daniel/programming/SomeLocalDir/build/include/cstddef:51:11: error: no
      member named 'max_align_t' in the global namespace
  using ::max_align_t;
1 error generated.
make[2]: *** [eh_aux_runtime.lo] Error 1
make[2]: Leaving directory `/home/daniel/programming/SomeLocalDir/build/libsupc++'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/daniel/programming/SomeLocalDir/build'
make: *** [all] Error 2

Seems like the same issue that I was getting before.

This is with TOT-gcc 4.9.0 20140116 (experimental) and clang version 3.5 (198044)

Any ideas?

Thank you,

Try 4.8 branch of gcc. This process is known to work with google/gcc-4.8.
There is no upstream testing of building libstdc++ with clang, and it
is not an officially supported configuration, so it may break from
time to time.

You may want to look at libc++ as a replacement for libstdc++.

I was able to build libc++, but when I try to use -stdlib=libc++ I get the
following error:

/usr/bin/ld: /tmp/test-347fdf.o: undefined reference to symbol
/usr/lib/x86_64-linux-gnu/ error adding symbols: DSO missing
from command line
clang-3.5: error: linker command failed with exit code 1 (use -v to see

Any ideas what is going wrong here? Building on Ubuntu Saucy

I think clang driver is supposed to add -lstdc++ _after_ -lc++ with
-stdlib=libc++. This may have changed recently.
Did you follow "Build on Linux using CMake and libsupc++" section on
libc++ site?

Yes (so no attempt at instrumentation has been made) other than doing the
build out of tree (in tree gave the same result), the example I got (clang
test.cpp -stdlib=libc++) is from there.