Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 164889

Summary: Emerge GCC 4.1.1 breaks multiple emerges
Product: Gentoo Linux Reporter: Robert Bradbury <robert.bradbury>
Component: [OLD] Core systemAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Robert Bradbury 2007-02-01 18:12:03 UTC
Emerging sys-devel-gcc-4.1.1-r3 (perhaps all 4.1.x?) may break the emerging of various packages that rely on libstdc++.  The packages most effected seem to be those which use a "libtool" script to determine how to compile the packages.  The problem shows up at various points in the link process as:
  undefined reference to `__some-symbol-name@CXXABI_1.*'
e.g.
  ../libgnomecups/.libs/libgnomecupsui-1.0.so: 
   undefined reference to `__cxa_get_exception_ptr@CXXABI_1.3.1' 


The solution seems to be to create symbolic links from /usr/lib/gcc/XXX-XX-linux-gnu/4.1.1/libstdc++.* to /usr/lib/libstdc++.*


  

Reproducible: Always

Steps to Reproduce:
1. Emerge gcc 4.1.X
2. Emerge packages that use C++ and use "libtool" in the build process.


Actual Results:  
Packages which use robust C++ features, esp. "catch"ing errors raised by subroutines will fail to build.

Packages which may have this problem seem to include gnome-cups-manager, openoffice, mjpegtools, openjade (via the opensp ebuild) and dnsquery.

Expected Results:  
Packages should build.

The problem turns out to be very subtle because if you change to the build directory and "make" the ebuild it will build properly.

The difference turns out to be that when built under an "emerge" and libtool is used to invoke g++ LD_LIBRARY_PATH is set to "/lib:/usr/lib".  When you build from the shell (running make directly), LD_LIBRARY_PATH is not set.  Apparently this may effect the processing of /usr/lib/libstdc++.lai because that does specify that libdir=
 /usr/lib/gcc/i686-pc-linux-gnu/4.1.1

When LD_LIBRARY_PATH is not set ld seems to process the .lai file properly and pickup the libraries from the 4.1.1 directories.  When LD_LIBRARY_PATH is set (as is the case when libtool is used to execute g++) then the .lai file seems to be ignored and if one still has old (or alternate) libstdc++ files in /usr/lib you will get those instead.  Depending upon how those are compiled (or how old they are) one will get the undefined reference errors.

There may be some interaction with "ldconfig" as if there are old libstdc++.so.* files resident in /usr/lib, then ldconfig may setup symbolic links to the old libraries.  The solution is to remove all old libstdc++.so.* files from /usr/lib and create specific symbolic links to the libraries in the 4.1.1 installation directories.  This may be a problem that "ldconfig" isn't being instructed to create symbolic links to the 4.1.1 library directories.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-02-01 18:18:06 UTC
(In reply to comment #0)
> The solution seems to be to create symbolic links from
> /usr/lib/gcc/XXX-XX-linux-gnu/4.1.1/libstdc++.* to /usr/lib/libstdc++.*

No, that's definitely *not* a solution...

http://www.gentoo.org/doc/en/gcc-upgrading.xml

*** This bug has been marked as a duplicate of bug 64615 ***