[cfe-dev] Building LLVM+Clang with Clang+libc++

David Blaikie dblaikie at gmail.com
Tue Aug 2 10:01:18 PDT 2011


> I'm not sure how to check that it's actually using libc++ (I
> suppose I could break one of the libc++ headers & see what happens, or
> access a non-existent member of an standard template & see which
> headers it points to)

So I added a simple break ("std::copy(1, 2, 3)") to see which stdlib
my build was using (when I configured it with CC=/path/to/clang
CXX=/path/to/clang++ CXXFLAGS=-stdlib=libc++) & it seems to still be
using libstdc++, not libc++. I can run "make CXXFLAGS=-stdlib=libc++"
& I get errors in the relevant headers, but I was hoping to get that
baked into my build options.

Any ideas how I could specify this to the configure command/bake it
into the build?

[bonus question: is there a way I can change the default stdlib to
libc++? I suppose I could just edit clang to do so, but I'm curious if
there's an environment variable or otherwise that clang++ itself will
pick up on to decide which stdlib to use. (I assume CXXFLAGS isn't
read by clang++ itself, but merely passed to it by tools like make,
etc)]

Thanks again,
- David



More information about the cfe-dev mailing list