Using libstdc++.so with a newer version of glibc without recompiling

Jonathan Wakely jwakely.gcc@gmail.com
Thu Mar 7 09:45:00 GMT 2013


On 7 March 2013 09:23,  <Heiko.Papenfuss@uniserv.com> wrote:
> Hi,
>
> I have a question regarding the dependency of libstdc++.so.6 on libc.so.6:
>
> If changing the underlying glibc version libc.so.6 is pointing to to a
> higher version (e.g. from libc-2.4.so to libc-2.7.so), is it expected that
> the libstdc++.so.6 will still work correctly when used by a program? Or is
> it necessary to recompile GCC under the new glibc and all our with this
> new GCC as well?

The libstdc++.so.6 will still work, glibc is also backwards compatible.

You might not be able to use the older GCC with the newer glibc
headers to compile new programs though, because GCC configures itself
based on the glibc headers present at the time when GCC is built. If
you later change glibc then GCC's C++ headers may be incompatible with
the new glibc headers.  If that happens you'd need to rebuild the same
GCC version against the new glibc.



More information about the Gcc-help mailing list