[cfe-dev] clang libc++ libcxxabi std::thread std::async
David Chisnall
csdavec at swan.ac.uk
Tue May 29 12:36:30 PDT 2012
On 29 May 2012, at 20:18, David Irvine wrote:
> Yes, it's almost enough for me to get to FreeBSD, particularly as I really like the bsd licence, sad as that may seem :-). I think 10 will be switched over completely to clang/libc++. I see libcxxab now reports to have nearly everything done for linux, but I cannot see how it's built at all, I hoped it would build with libc++ as part of cmake, but alas !!
We're using libcxxrt which was working on Linux, FreeBSD, and Solaris before libc++abi was started and has been tested a lot since then.
> I think FreeBSD has libc++ set up as some filter library which I do not understand but if this worked on linux it would be great as we (in house) have moved to c++11 and until libc++ can seat itself with some abi implementation that allows std::async etc. I am afraid I code/check/compile in clang and compile/run in gcc 4.6 and 4.7.
FreeBSD now builds libstdc++ as a filter library for libsupc++. This allows us to swap out libsupc++ and replace it with libcxxrt without breaking anything that links to libstdc++ and got the (versioned) symbols from its embedded copy of libsupc++ before. You can add a line to libmap.conf to switch from libsupc++ to libcxxrt and so far everything I've tested has Just Worked™. I hope to get much wider testing for this when FreeBSD 9.1 ships with libc++ and libcxxrt out of the box.
This hackery is only required if you want to be able to link libraries built with the new stack against libraries built / linked with the old stack. If you are just wanting to use libc++, then building libc++ with -DLIBCXXRT and linking it against libcxxrt works fine. For FreeBSD 10, we don't plan on shipping libstdc++ at all in the default install, so this will likely be the default.
David
More information about the cfe-dev
mailing list