From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 513 invoked by alias); 7 Mar 2013 13:59:27 -0000 Received: (qmail 503 invoked by uid 22791); 7 Mar 2013 13:59:25 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-oa0-f50.google.com (HELO mail-oa0-f50.google.com) (209.85.219.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Mar 2013 13:59:15 +0000 Received: by mail-oa0-f50.google.com with SMTP id l20so576557oag.37 for ; Thu, 07 Mar 2013 05:59:14 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.12.226 with SMTP id b2mr25299444oec.76.1362664754461; Thu, 07 Mar 2013 05:59:14 -0800 (PST) Received: by 10.60.16.165 with HTTP; Thu, 7 Mar 2013 05:59:14 -0800 (PST) In-Reply-To: References: Date: Thu, 07 Mar 2013 13:59:00 -0000 Message-ID: Subject: Re: Using libstdc++.so with a newer version of glibc without recompiling From: Michael Powell To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg00091.txt.bz2 On Thu, Mar 7, 2013 at 7:56 AM, wrote: > On 7 March 2013 10:45, wrote: >> On 7 March 2013 09:23, wrote: >> > Hi, >> > >> > I have a question regarding the dependency of libstdc++.so.6 on libc.s= o.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? O= r 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 <=3D2.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=E4rz 2013 10:45 > To: Papenfu=DF Heiko > Cc: gcc-help@gcc.gnu.org > Subject: Re: Using libstdc++.so with a newer version of glibc without rec= ompiling > > On 7 March 2013 09:23, 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 th= at >> 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.