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

David Blaikie dblaikie at gmail.com
Wed Aug 3 07:54:49 PDT 2011


> New Scenario includes your request to build LLVM/Clang/Clang++ against
> libc++
>
> Configuration trick to get it to build my set up is as follow:
>
>   $ ../trunk/llvm/configure && ../trunk/llvm/configure
> --enable-target=x86_64,arm,cpp,cbe --with-clang=/usr/local/bin/clang
> --with-built-clang --enable-pic --enable-polly --enable-shared
> --with-cxx-include-arch=x86_64 --enable-optimized --with-optimize-option=-O2
> --enable-assertions --disable-bootstrap --disable-multilib --enable-jit
> --enable-threads --no-create --no-recursion CXX='/usr/local/bin/clang++'
> CXXFLAGS='-stdlib=libc++ -I/usr/local/include/c++/v1'
...
> SUCCESS!

I experienced similar success with a similar, though simpler, command
line, but on further experimentation it turns out that the CXXFLAGS
passed to configure weren't then used in the build itself. (you can
confirm this by adding some broken STL usage to any of the LLVM code -
I used "std::copy(1, 2, 3)"). If the compilation error points to
libc++ headers, you win, if not - you're in the same state I was.

To get LLVM to actually build with libc++ at least as an experiment, I
tried passing the same CXXFLAGS to the make command itself - this hit
the libc++abi issue that Ryuta mentioned.

I haven't tried building/using libc++abi as yet - I checked it out but
didn't find any build steps, Makefiles, etc. The website has no howto.
I assume it's just not finished/mature enough yet.

- David




More information about the cfe-dev mailing list