[Development] Summary ABI compabilty

Thiago Macieira thiago.macieira at intel.com
Fri Nov 25 20:30:40 CET 2016


On sexta-feira, 25 de novembro de 2016 10:51:06 PST Giuseppe D'Angelo wrote:
> Out of curiosity, why does a ABI break not incur in a soname change?

Because they technically did not break BC. Programs that were compiled and 
linked against an older version will continue to run exactly as before. 
They've only added new symbols to the library.

It's also not an SC break: programs that used to compile with the old library 
will still compile again with the new one. Like with glibc with ELF version, 
the newly-linked program will call the new symbols, not the old ones.

This is a domain of breakage that isn't very well explored because it happens 
not in the library that made the source code change, but in a second library 
that used the first one.

It happens almost exclusively in C++, though if you try hard enough you can do 
it in C with some macros too. It happens because C++ has two "features" that 
allow it to happen:

 1) default parameters (including default template parameters)
 2) extensive mangling of symbols

The most likely case of this breakage was that of adding new defaulted 
template parameers to template classes. Fortunately, it was one of the cases 
caught in the C++ Binary Compatibility guideline on KDE websites.

Inline namespaces actually make it easy to cause this breakage. So we should 
not use them in Qt public headers.

GCC ABI tags are like inline namespaces, but looking from another angle.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list