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

Michael Powell mwpowellhtx@gmail.com
Thu Mar 7 13:59:00 GMT 2013


On Thu, Mar 7, 2013 at 7:56 AM,  <Heiko.Papenfuss@uniserv.com> wrote:
> On 7 March 2013 10:45, <jwakely.gcc@gmail.com> wrote:
>> 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.
>
> How would that become apparent or how could we make sure this is not the
> case? In our special case, we have a glibc 2.4 in the system and trying to
> use glibc 2.6 instead.

Reading the past several posts, I was getting confused. It seems to me
you have the reverse scenario from the backwards compatible one. You
are attempting to use >2.4 while <=2.4 is on the system. I don't know
how you package those updates and/or ensure proper dynamic (?)
linkage.

> -----Original Message-----
> From: Jonathan Wakely [mailto:jwakely.gcc@gmail.com]
> Sent: Donnerstag, 7. März 2013 10:45
> To: Papenfuß Heiko
> Cc: gcc-help@gcc.gnu.org
> Subject: Re: Using libstdc++.so with a newer version of glibc without recompiling
>
> 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