tags:

views:

415

answers:

3

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?

A: 

I think you have do divide this questoin. The C++ stuff changed very constantly even between releases, but I do not think this is true for C. However you can only figure that out if you read the Changelog.....

Friedrich
I really only care about C++, which is why I tagged the question as such.
Fredrik Ullner
The C ABI is pretty much standard and constant, isn't it?
sbk
gcc keeps abi very well
Artyom
Sorry I've not recognized the c++ tag. I've just seen the gcc in the question.
Friedrich
+1  A: 

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

ablaeul
Hm, the official ABI page has a code example (Multiple ABI Testing), where multiple versions are being used... How is this possible if they then say you should recompile everything with the same version?
Fredrik Ullner
That example shows how to use the linker in order to be able to link in multiple libraries. But they won't be interoperable: for example, you can't pass a vector from the first library to the other.
AProgrammer
I.e., it's relatively pointless since that's obviously something you would want to do.
Fredrik Ullner
+1  A: 

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

AProgrammer