[cxx-abi-dev] platform c++ abi additions

Jason Merrill jason at redhat.com
Fri May 14 19:45:29 UTC 2010


On 05/13/2010 08:20 PM, Nick Kledzik wrote:
> As you may have heard, llvm.org <http://llvm.org/> is working on a new
> C++ library implementation <http://libcxx.llvm.org/>. Apple would like
> to release a shared library version of this library (libc++.dylib) in
> parallel with the existing gcc based C++ library (libstc++.dylib). In
> order to allow these libraries to inter-operate, we plan to factor out
> the C++ ABI parts of libstdc++.dylib into a stand alone library
> (libc++abi.dylib) which will then be used by the higher level C++ libraries.

I think that's the wrong division.  The GNU library is divided into the 
language-support bits (clause 18 + ABI) and the rest of the library.  So 
a program written for a freestanding implementation can just link 
against libsupc++ and ignore the rest of the library.

> 1) std::set_terminate(), std::set_unexpected(), and
> std::set_new_handler() assume there is one process wide global holding
> the current handler. To support this we are adding three global
> variables to libc++abi.dylib: __cxa_terminate_handler,
> __cxa_unexpected_handler, and __cxa_new_handler. The two C++ libraries
> atop libc++abi.dylib will use these global variables instead of having
> their own copy.

We put those standard functions in libsupc++, so there's no need for 
global variables.

> 2) C++ 0x introduces std::exception_ptr.

 > 3) Lastly, the only use of __cxa_globals in the higher level C++
 > libraries is to implement std::uncaught_exception(). To keep

Likewise, all the EH code is in libsupc++.

Currently libsupc++ is linked into libstdc++, so it isn't really 
user-visible as a separate library, but that could change.

Jason



More information about the cxx-abi-dev mailing list