Compatibility of libstdc++.so libgcc_s.so when upgrading GCC 4.1 to GCC 4.8.2

463 Views Asked by At

I'm working on a large C/C++ application that's currently built using GCC 4.1 on Linux, where many of our third-party static and dynamic library dependencies are pre-built to help reduce compilation times.

We're thinking of upgrading to GCC 4.8.2. While I know it's safest to recompile all of the dependencies to use 4.8.2, I'm wondering what sort of gotchas there might be if I left all of the pre-built third-party libraries as is, and only rebuilt our main application and in-house libraries.

While many of the libraries are helpfully sat behind pure C interfaces, several are C++ interfaces that include std library objects in the method signatures and header includes.

Based on this GCC page on C++11 compatibility, and this one on general C++ ABI & stdlib API/ABI compatibility, I think it should work fine, provided I compile all of our libraries with C++11 features disabled.

Question 1: What are the gotchas if I were to mix things like that?

Question 2: Is it possible to enable C++11 language features (e.g. C++11's auto keyword), but to link against a non-C++11 libstdc++ (or non-C++11 std object symbols)? I'm guessing the simple answer is "no", because much of the standard library is template header stuff, and I suspect name mangling may have changed to distinguish C++ vs C++11 symbols.

0

There are 0 best solutions below