[cfe-dev] Building clang on Mavericks with libc++....

Jean-Daniel Dupas devlists at shadowlab.org
Sat Nov 9 01:20:58 PST 2013


Le 9 nov. 2013 à 01:00, Fons Rademakers <Fons.Rademakers at cern.ch> a écrit :

> Hi,
> 
> when compiling clang (todays trunk) from source on Mavericks, which ships with libc++ in:
> 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/
> 
> and for LLVM configured like this:
> 
> $ /Users/rdm/root/interpreter/llvm/src/configure --prefix=/Users/rdm/root/interpreter/llvm/inst --disable-docs --disable-bindings --disable-visibility-inlines-hidden --enable-libcpp --disable-optimized --enable-targets=host --with-extra-options= CC=clang CXX=clang++ CFLAGS=-m64 CXXFLAGS=-m64
> 
> but that does not seem to be enough as the built clang++ does look for libc++ in:
> 
>> so what config option should I specify to get clang++ to use the one and only copy of libc++, namely the one in:
> 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/
> 
> Should configure not take the libc++ location from the specified CXX compiler? Which indeed is:
> 
>> 
> Any suggestions welcome.
> 
> 
> Cheers, Fons.

Since Xcode 5 (or Maverick, I'm not sure), libc++ headers are no longer part of the system, but part of the toolchain.

So Maverick does not ships with C++ header, clang in Xcode does (and it know where to look for its own libc++ headers). If you are using your own clang build, you have to provide libc++ headers yourself.

Actually, this is easy as it is done automatically by the build system if libcxx is checked out in <llvm source>/projects/

For the record, libcxx can be checked out using :

svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx

-- Jean-Daniel








More information about the cfe-dev mailing list