[cfe-dev] libc++abi on linux

Ben Pope benpope81 at gmail.com
Sun Jul 8 20:00:48 PDT 2012


On Monday, July 09, 2012 08:49 AM, "C. Bergström" wrote:
> libcxxrt + libunwind is the way to go imho
> https://github.com/pathscale/libcxxrt
> https://github.com/pathscale/libunwind
>
> These have been tested to work with clang - Admittedly the build process
> may not be straight forward, but if enough interest maybe we solve that

It would be nice to have a documented/tested/working way of compiling 
*and linking* programs using libc++/clang/llvm on linux, it seems that 
libc++abi is pretty close to getting that working.

This comes up on the list every couple of months and libcxxrt/libunwind 
are usually suggested over libc++abi.

What is the problem?  Is there some disagreement about the scope of 
libc++abi?  Is there some specific part that has been excluded that is 
required on linux but not darwin?  Does libc++abi replace libsupcxx (not 
entirely)?  Does libunwind address just the missing bit or is there 
overlap? If there is overlap is linking order enough to fix that? is 
libc++abi equivalent to libcxxrt? And there are lots of other questions 
that come up and it just makes it hard to get going.

I think it's a real shame that this is not documented for linux, I 
suspect it is preventing the uptake of libc++ with clang on linux and 
that's a real shame, especially as libc++ has become the default in the 
next xcode.

There are other problems as well; sometimes it's really a pain to get 
configure to work properly when trying to choose between which abi bits 
we want, it would be nice if we could do:

clang++ -std=c++11 -stdlib=libc++ -stdlibabi=libc++abi -stdlibunwind?=???

Really that line starts to get a bit scary, if I'm using clang in c++11 
mode, there should be a default that works, I strongly suggest that the 
default library is libc++ (because stdlibc++ practically always requires 
a patch to work with clang), and that the missing bits (abi/unwind) can 
be made to Just Work(tm).

Can the defaults be configured when you configure clang or through some 
other global means so that I don't have to teach every build system what 
is required?

Ben




More information about the cfe-dev mailing list