Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCC ABI compatibility

As far as I've understood, it is not possible to link libraries that use different versions of GCC's Application Binary Interface (ABI). Are there ABI changes to every version of GCC? Is it possible to link a library built with 4.3.1 if I use, say, GCC 4.3.2? Is there a matrix of some sort that lists all the ways I can combine GCC versions?

like image 534
Fredrik Ullner Avatar asked May 10 '10 10:05

Fredrik Ullner


People also ask

What ABI does GCC use?

From GCC version 3 onwards the GNU C++ compiler uses an industry-standard C++ ABI, the Itanium C++ ABI.

Are GCC and Clang ABI compatible?

clang, modulo bugs, is fully C++ ABI compatible with GCC (they both follow the intervendor Itanium ABI) on unix systems. Make sure you use the same standard library for all components because libstdc++ and libc++ are different implementations with completely different object layouts.

What is ABI compatibility?

ABI compatibility (application binary interface compatibility), for our purposes, refers to the ability to link pre-built (binary) libraries with arbitrary versions of a compiler.

Does C++ have a stable ABI?

The advent of the C++ international standard in 1998 (ISO/IEC 14882:1998 Programming Languages - C++) provided a base for a stable C++ ABI, at least for a given C++ implementation.


2 Answers

Since gcc-3.4.0, the ABI is forward compatible. I.E. a library made using an older release can be linked with a newer one and it should work (the reverse doesn't). Obviously, there could be bugs, but there is only one mentionned in the documentation: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33678

like image 147
AProgrammer Avatar answered Sep 21 '22 23:09

AProgrammer


The official ABI page points to an ABIcheck. This tool may do, what you want.

like image 32
ablaeul Avatar answered Sep 22 '22 23:09

ablaeul