[oi-dev] [hhinnant at apple.com: Re: [cfe-dev] libc++ ABI stability]

Guido Berhoerster gber at openindiana.org
Mon May 23 20:22:22 UTC 2011


----- Forwarded message from Howard Hinnant <hhinnant at apple.com> -----

Date: Mon, 23 May 2011 16:08:23 -0400
From: Howard Hinnant <hhinnant at apple.com>
To: Guido Berhoerster <gber at openindiana.org>
Cc: cfe-dev at cs.uiuc.edu
Subject: Re: [cfe-dev] libc++ ABI stability

On May 23, 2011, at 2:27 PM, Guido Berhoerster wrote:

> Hello,
> 
> does the LLVM project make (or plan to make) any commitment with
> regard to the ABI stability of libc++?

The plan is to keep the ABI semi-stable.  The high level parts of the library are ABI-versioned using the C++11 feature inline namespaces.  The current version is 1.  This is considered an ABI version.  And the ABI for any given version is meant to be fixed.

Every once in a great while (e.g. maybe for the next C++ standard), we could issue a new ABI, which would then live in a different inlined namespace (e.g. std::_2).  There would be config macro to choose the ABI.

Some lower-level parts of the library are not ABI versioned.  They live in namespace std only.  These will remain stable until the sun swells up and swallows the earth (after that I can't vouch for it).  These low level parts include:

* operator new/delete
* get/set new_handler
* typeinfo
* the exception classes

The exception classes not only have a stable ABI, their ABI is identical to that of gcc-4.2.  This means you can throw exceptions across dyld boundaries and not worry which C++ std::lib the recipient of your exception is using (as long as that library is also ABI compatible with gcc-4.2).

Howard


----- End forwarded message -----

-- 
Guido Berhoerster




More information about the oi-dev mailing list