Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2012 10:32:56 +0100
From:      David Chisnall <theraven@freebsd.org>
To:        stable@freebsd.org
Subject:   libc++ has landed
Message-ID:  <E7389A30-D51D-45D9-9D7D-6999E4AE140E@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hi Everyone,

I have just finished merging libc++ and all of the things that it =
depends on into 9-STABLE.  Since 9.1 is due to branch Real Soon Now=99, =
it would be good if it could see a bit of testing before then.  Because =
it uses C++11, libc++ will only work if built with clang, so it is =
disabled in the default build for now.  To build it, you will need to =
add the following to your /etc/src.conf:

CC=3Dclang
CXX=3Dclang++
CPP=3Dclang-cpp
WITH_LIBCPLUSPLUS=3Dyes

You can then just make && make install in lib/libcxxrt and lib/libc++.  =
This requires a (very) recent libc, containing the xlocale APIs, so =
you'll also need to reinstall lib/libc and include.  If you want to try =
mixing libstdc++ and libc++, then you will need to also recompile / =
install libstdc++ from stable.  This depends on some rtld-elf fixes, so =
it's probably worth rebuilding world to make sure that you have =
everything. =20

Once all of this is installed, there are two things you can test.  The =
simplest is the libstdc++ / libcxxrt combination.  To do this, just add =
this to /etc/libmap.conf:

libsupc++.so.1  libcxxrt.so.1

This will use libcxxrt instead of libsupc++.  These libraries implement =
the low-level parts of C++ (RTTI, exceptions, and so on).  The other =
thing that you can try is compiling other C++ code using libc++.  This =
is trivial to do with clang++, just add -stdlib=3Dlibc++ to both your =
CXXFLAGS and LDFLAGS.

David=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E7389A30-D51D-45D9-9D7D-6999E4AE140E>