[Development] Summary ABI compabilty
Thiago Macieira
thiago.macieira at intel.com
Wed Nov 23 01:05:50 CET 2016
On quarta-feira, 23 de novembro de 2016 00:07:35 PST Allan Sandfeld Jensen
wrote:
> Can't we statically link to it, so that it doesn't matter which version the
> application is using?
No, same problem, which is exactly what the Linux distros are doing wrong.
C++ requires certain symbols to be shared and obey ODR: the typeinfo for the
base types and the virtual tables for some classes (notably, std::exception).
If we statically link one of the libraries that contains those, then
applications may or may not link to them at runtime. Breaking ODR for those is
problematic.
The solution is simple: we need to dynamically link to a library that provides
those and just those. Both libc++ and libstdc++ have such a library:
respectively, libc++abi and libsupc++. Linux distros need to make sure that
only one of those exists and that both libc++ and libstdc++ link to it.
But even if we do that, it doesn't solve the problem of using the std types in
our ABI, like std::function which we desperately want to use. If our objective
is to do that, then you can't replace.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list