According to the gcc ABI policy, gcc 4.4.7 should depend on libstdc++ 6.0.13. As far as I understood, the compiler version and the libstdc++ version are deeply interrelated and can't be swapped, so it came to me as a surprise to discover the following facts:
- CentOS 5.8 somehow manages to have a gcc44 package that links against 6.0.8, apparently coming with the default system (which is based on gcc-4.1.2)
- that the libstdc++.so in the compiler directory (/usr/lib/gcc/x86_64-redhat-linux6E/4.4.7, where I expected to find a libstdc++-6.0.13) is not a link to a shared object of any sort, but a text file containing
INPUT ( -lstdc++_nonshared /usr/lib64/libstdc++.so.6 )
What kind of magic is going on here?
- How could they provide a gcc 4.4.7 that links against an older version of libstdc++? I thought it was not possible.
- what is this stdc++_nonshared library?
- I didn't know a .so file could contain that text. Who parses it (dynamic linker I guess) and what are its specifications and consequences?
- How far can this magic go? Can I use gcc4.7 with libstdc++ 6.0.3? What is the spectrum of compatibility