[LLVMdev] conflicting c++ libs for building dragonegg

Howard Hinnant hhinnant at apple.com
Fri Aug 30 13:02:55 PDT 2013


On Aug 30, 2013, at 3:42 PM, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:

> On 30 Aug 2013, at 19:42, Duncan Sands <baldrick at free.fr> wrote:
> 
>> First off, is libc++ supposed to be incompatible with
>> libstdc++?
> 
> libc++ does not, and never had, ABI compatibility with libstdc++ as a goal.  Actually, libstdc++ periodically breaks ABI compatibility too, as we have recently found in the FreeBSD ports tree with certain projects requiring a newer libstdc++ than the one we ship in the base system.  On OS X and FreeBSD 10, libc++ are the default STL implementations and so LLVM / clang / anything that doesn't explicitly request something else will be compiled with libc++.  If DragonEgg doesn't compile with libc++, then it can not invoke any LLVM methods that take as arguments or return STL types without causing ABI-incompatibility problems.  

Fwiw, the libc++ std-defined exception types are ABI compatible with those of libstdc++.  However that is not a completely working feature out of the box.  To really be able to throw/catch across these two libs one would need to ensure that:

1.  They are both using the same implementation of the Itanium ABI (what llvm calls libc++abi).

2.  That the type_infos of the two will compare equal.  If comparing by identity, then the type_infos will need to be uniqued.  The current design is that the type_infos are laid down by libc++abi.

Howard




More information about the llvm-dev mailing list