[cxx-abi-dev] Library ABI version markers

Jason Merrill jason at redhat.com
Fri Oct 26 21:38:53 UTC 2012


The C++11 standard requires some ABI changes to libstdc++.  To avoid 
breaking the world, we want to handle this by mangling changes, limited 
to only those symbols that are affected by the ABI changes.

inline namespaces were intended to be a solution to this issue, but they 
don't really handle it very well; there's no way to adjust the mangling 
of a single member function (as needed for some member functions that 
change their return type in C++11) and they don't handle the issue of 
subobjects; if my type A changes ABI so I put it in an inline namespace, 
changing its mangling, then signatures that use it are updated 
appropriately.  But if type B has a member of type A, signatures that 
use B are not affected, leading to silent ABI incompatibilities.

 From our discussions of how to deal with this we settled on an 
attribute which can be attached to a class or a function to affect the 
mangling.  I'm inclined to make the arguments to the attribute 
user-provided strings which will then be gathered together and attached 
to any symbol name that uses the class, or to the mangled name of the 
function, respectively.

I'm currently leaning toward collecting all the tags involved, sorting, 
and appending them to the symbol as <source-name>s separated by 'B's.

Any thoughts?

Jason


More information about the cxx-abi-dev mailing list