Reputation: 84842
Linux C++ programs build with GCC link against libgcc_s.so.1
and libstdc++.so.6
libraries, each of which contains multiple ABIs: newer versions contain ABIs from previous version plus new ones. GCC ABI policy document says programs build against older runtime should be able to be run with the new runtime. So, theoretically, older binaries should be runnable on new systems.
If I have a system with an older runtime and don't want to go through the trouble of upgrading GCC on this system, can I manually replace the above mentioned libraries with new ones? In theory all old executables that link against it should work (including GCC itself), but it feels like a kludge.
Is it safe to do so?
Upvotes: 7
Views: 1005
Reputation: 16045
Maybe, but I don't recommend it, at least not without extensive testing that would almost certainly eat up any gain. Here's why:
What's your goal here? If you just want to be able to compile C++ apps that use newer features, you can install a new version of GCC alongside the original, you just need to make sure all the libraries you might be using are built with the new version, too.
Upvotes: 5