Note that there are some explanatory texts on larger screens.

plurals
  1. POMixing C++ ABIs to build against legacy libraries
    text
    copied!<p>Here's the situation, I've got a C++ codebase which is using a recent GCC (4.3.3), but I need to link against an older library which was built using GCC 3.2.3. There is no newer version of the library available, I can't go without it, and it's closed source so it can't be rebuilt.</p> <p>This seems to pose a problem since there are ABI incompatibilities between GCC 4.3.3 and 3.2.3, so I'm trying to see what my options are for resolving this.</p> <p>A few additional details:</p> <ul> <li>I can rebuild everything in my codebase with -fabi-version=1 to get the correct ABI version, but I am dependent on some newer features from libstdc++ version 6.</li> <li>All the C++ library dependencies outside the codebase are open source, so I can rebuild them as needed, except for this one library.</li> <li>Many C library dependencies that cannot be rebuilt or would be difficult to rebuild.</li> <li>The old library seems to be dependent on some libstdc++ version 5 features</li> </ul> <p>I have so far tried:</p> <ul> <li>Rebuild all C++ code and dependent libraries with -fabi-version=1 and link against libstdc++ version 6. This fails with a handful of undefined symbol errors for C++ standard library symbols.</li> <li>Same as above but additionally link in the shared library for libstdc++ 5, this resolves the linker issues but appears to result in mixing of the two versions at runtime inside the legacy library, and that causes a crash.</li> </ul> <p>I read this page: <a href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html">http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html</a> which seems to indicate that it can be possible to mix C++ ABI versions in an application to satisfy varying dependencies between libraries. It doesn't seem to work very well here, though, unless I am missing something.</p> <p>Any ideas?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload