Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25164 - gaim-0.66 ebuild linking against wrong library
Summary: gaim-0.66 ebuild linking against wrong library
Status: RESOLVED DUPLICATE of bug 23277
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gaim Bugs Crew
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
: 25221 25222 25287 25337 27827 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-23 22:50 UTC by Chris Verges
Modified: 2005-07-17 13:06 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Verges 2003-07-23 22:50:49 UTC
Computer running gcc 3.2.3 for i686.  CFLAGS="-march=pentium3 -O3 -pipe
-fomit-frame-pointer"

When attempting to emerge the gaim-0.66 ebuild, the following error message occurs:

libtool: link: cannot find the library
`/usr/lib/gcc-lib/i586-pc-linux-gnu/3.2.2/libstdc++.la'

I attempted to re-emerge gcc, but to no avail.  The libstdc++.la library is
located in /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/ on my system (with the
specs listed above).

Reproducible: Always
Steps to Reproduce:
1. Emerge gcc 3.2.3 (any release)
2. ACCEPT_KEYWORDS="~x86" emerge gaim
Actual Results:  
/bin/sh ../libtool --silent --mode=link gcc  -march=pentium3 -O3 -pipe
-fomit-frame-pointer -I/opt/include -I.. -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0
-I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include     -o gaim -export-dynamic account.o accountopt.o
blist.o connection.o conversation.o core.o debug.o event.o ft.o html.o md5.o
notify.o plugin.o pounce.o proxy.o prefs.o prpl.o request.o server.o status.o
sound.o util.o about.o away.o browser.o buddy_chat.o dialogs.o dnd-hints.o
gaim-disclosure.o gaimrc.o gtkaccount.o gtkcellrendererprogress.o gtkblist.o
gtkconn.o gtkconv.o gtkdebug.o gtkft.o gtkimhtml.o gtknotify.o gtkplugin.o
gtkprefs.o gtkpounce.o gtkrequest.o gtksound.o gtkutils.o idle.o log.o main.o
session.o stock.o themes.o -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0
-latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0   -L/usr/lib -lao -ldl -L/usr/lib
-laudiofile -lm  -L/usr/X11R6/lib  -lSM -lICE -lX11 -lXext  -L/usr/X11R6/lib 
-lXss -L/usr/X11R6/lib -lSM -lICE  -Wl,--export-dynamic -lgtkspell -lpspell
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0
-lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0   -lnsl
libtool: link: cannot find the library
`/usr/lib/gcc-lib/i586-pc-linux-gnu/3.2.2/libstdc++.la'
make[3]: *** [gaim] Error 1
make[3]: Leaving directory `/var/tmp/portage/gaim-0.66/work/gaim-0.66/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/gaim-0.66/work/gaim-0.66/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gaim-0.66/work/gaim-0.66'
make: *** [all] Error 2


Expected Results:  
Installed GAIM 0.66
Comment 1 Pol 2003-07-23 23:18:46 UTC
Weird I didn't get that error ... 

[503][/home/pol]# emerge --version
Portage 2.0.48-r5 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)
[504][/home/pol]# gaim --version
Gaim 0.66
[505][/home/pol]# 

...weird weird weird
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2003-07-23 23:29:04 UTC
try run ${PORTDIR}/sys-devel/gcc/files/fix_libtool_files.sh
Comment 3 Chris Verges 2003-07-24 06:54:25 UTC
I tried running the fix_libtool_files.sh script.  Output as below:

ivanova root # /usr/portage/sys-devel/gcc/files/fix_libtool_files.sh 3.2.2
 * Scannig libtool files for hardcoded gcc 3.2.2 library path...
 *   Scanning /usr/lib/opengl/xfree/lib...
 *   Scanning /usr/X11R6/lib...
 *   Scanning /opt/blackdown-jre-1.4.1/lib...
 *   Scanning /usr/qt/3/lib...
 *   Scanning /usr/kde/3.1/lib...
 *   Scanning /usr/lib/fltk-1.1...
 *   Scanning /lib...
 *   Scanning /usr/lib...
 *   Scanning /usr/local/lib...

I re-ran it for gcc 3.2.2, 3.2.1, and 3.2 because I'm not sure what the version of gcc PRIOR to 3.2.3 I had was.  Outputs for all were similar.

Still wasn't able to emerge gaim-0.66, however.  It bombed on the same error message as originally posted.
Comment 4 Brandon Low (RETIRED) gentoo-dev 2003-07-24 07:21:23 UTC
Martin: Rizzo will be handling gaim from now on, you can CC me of course, but assign them to him please.

*phew, one big package off my back ;-)*
Comment 5 Guillaume Marceau 2003-07-24 10:24:40 UTC
I ran "emerge --update world" this morning. Among the 73 packages in need of updates, there was:

-------------
   [ebuild    U ] sys-devel/gcc-3.2.3-r1 [3.2.2] 
<sniped 4 lines>
   [ebuild    U ] sys-apps/portage-2.0.48-r5 [2.0.48-r1] 
*** Portage will stop merging at this point and reload itself,
    recalculate dependencies, and complete the merge.
<sniped 19 lines>
   [ebuild    U ] net-im/gaim-0.63-r1 [0.61] 
<sniped the rest>
-------------

Everything was going well until the gaim compile failed. The failure is the same as reported by rizzo:

-------------------------------------------------
root@canuk gmarceau # emerge --update world
    <large snip>
/bin/sh ../libtool --silent --mode=link gcc  -O2 -mcpu=i686 -pipe -I/opt/include -I.. -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED  -o gaim -export-dynamic blist.o conversation.o core.o debug.o event.o ft.o plugin.o pounce.o proxy.o prpl.o server.o sound.o util.o about.o away.o browser.o buddy_chat.o dialogs.o dnd-hints.o gaim-disclosure.o gaimrc.o gtkcellrendererprogress.o gtkblist.o gtkconv.o gtkdebug.o gtkft.o gtkimhtml.o gtkplugin.o gtkpounce.o gtkutils.o html.o idle.o log.o main.o md5.o multi.o prefs.o session.o socket.o stock.o themes.o -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0        -L/usr/lib -lao -ldl -L/usr/lib -laudiofile -lm  -L/usr/X11R6/lib  -lSM -lICE -lX11 -lXext  -L/usr/X11R6/lib  -lXss   -L/usr/X11R6/lib -lSM -lICE           -Wl,--export-dynamic -lgtkspell -lpspell -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0   -lnsl 
libtool: link: cannot find the library `/usr/lib/gcc-lib/i586-pc-linux-gnu/3.2.2/libstdc++.la'
make[3]: *** [gaim] Error 1
make[3]: Leaving directory `/var/tmp/portage/gaim-0.63-r1/work/gaim-0.63/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/gaim-0.63-r1/work/gaim-0.63/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gaim-0.63-r1/work/gaim-0.63'
make: *** [all-recursive-am] Error 2

!!! ERROR: net-im/gaim-0.63-r1 failed.
!!! Function src_compile, Line 48, Exitcode 2
!!! Make failed

root@canuk gmarceau # fix_libtool_files.sh 3.2.2
 * Scannig libtool files for hardcoded gcc 3.2.2 library path...
    <snip>

root@canuk gmarceau # emerge gaim
    <snip>
libtool: link: cannot find the library `/usr/lib/gcc-lib/i586-pc-linux-gnu/3.2.2/libstdc++.la'
make[3]: *** [gaim] Error 1

Comment 6 Chris Verges 2003-07-24 15:02:11 UTC
Glad to know I'm not going nuts :-)
Comment 7 Chris Verges 2003-07-24 19:25:54 UTC
Occurs in gaim-0.66-r2 ebuild as well.
Bug IDs 25221 and 25222.
Comment 8 SpanKY gentoo-dev 2003-07-24 20:38:31 UTC
try this: http://forums.gentoo.org/viewtopic.php?t=65846 
Comment 9 Zhen Lin 2003-07-24 20:41:45 UTC
Since libstdc++.la is a static library, I think that a symlink should be an effective workaround. Try "grep -r 3.2.2 /usr/X11R6/lib /usr/lib" to see if any references to 3.2.2 remain.
Comment 10 SpanKY gentoo-dev 2003-07-24 21:11:15 UTC
*** Bug 25221 has been marked as a duplicate of this bug. ***
Comment 11 SpanKY gentoo-dev 2003-07-24 21:11:23 UTC
*** Bug 25222 has been marked as a duplicate of this bug. ***
Comment 12 Chris Verges 2003-07-24 22:38:18 UTC
I isolated the error to a call in the libtool script provided with gaim.  It looks like this script calls the 'link' utility, from the package sys-apps/fileutils.  I am running version 4.1.11-r1 (the latest stable version), but to be on the safe side I reemerged the package.  After this, I tried emerging gaim-0.66-r2 again.  Still has the same problem, so I'm not entirely positive it has to do with the /bin/link (/usr/bin/link) command or the gaim libtool script.

SpanKY's solution got the error message to report:
libtool: link: cannot find the library
`/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/libstdc++.la'
make[3]: *** [gaim] Error 1

I changed the following references to gcc 3.2.2 as per Zhen Lin's suggestion:
/usr/lib/libaspell.la, /usr/lib/libgtkspell.la, /usr/lib/libpspell.la, /usr/lib/gedit-2/plugins/libspell.la, /usr/lib/gstreamer-0.6/libgstarts.la, and /usr/lib/perl5/5.8.0/i586-linux/Config.pm.

AFTER running the following command in /usr/lib and /usr/X11R6/lib, I was able to replace all the references to gcc 3.2.2 with gcc 3.2.3 and THEN get the ebuild to work properly:
grep -R \/usr\/lib\/gcc-lib\/i686-pc-linux-gnu\/3\.2\.2\/libstdc++\.la *

So, in short, the solution for this problem is as follows:
1) echo -e '/lib\n/usr/lib' | cat /etc/ld.so.conf - |  perl -ne 'print unless /^#/'  | xargs -iXX find XX -name '*.la' | xargs grep -l i586  | xargs sed -i -e 's/i586/i686/g'
2) grep -R \/usr\/lib\/gcc-lib\/i686-pc-linux-gnu\/3\.2\.2\/libstdc++\.la *
   Replace any references to the old gcc version here.
3) ACCEPT_KEYWORDS="~x86" emerge gaim

I think something like 'emerge world' would have fixed the problem as well, since it would have replaced most of these libraries with the correct dependency information, but that would have taken a LOT of time.  If anyone can think of a faster (and perhaps more automated) way to add this capability to gcc ebuild upgrades, please do so.  :-)

I thank everyone for their help.  Twas much appreciated!
Comment 13 Don Seiler (RETIRED) gentoo-dev 2003-07-25 06:43:11 UTC
Great glad to see it is working.  Thanks to Spanky as well.

It appears that this wasn't so much a gaim issue, as a system issue on the whole.  Unless lostlogic or mholzer disagree, I will close this.
Comment 14 SpanKY gentoo-dev 2003-07-25 16:30:31 UTC
*** Bug 25287 has been marked as a duplicate of this bug. ***
Comment 15 SpanKY gentoo-dev 2003-07-25 16:30:37 UTC
*** Bug 24597 has been marked as a duplicate of this bug. ***
Comment 16 SpanKY gentoo-dev 2003-07-26 16:45:27 UTC
*** Bug 25337 has been marked as a duplicate of this bug. ***
Comment 17 Martin Holzer (RETIRED) gentoo-dev 2003-07-28 14:35:17 UTC
try this source /etc/profile
if still fail this source /etc/profile && ldconfig
gcc-config i686-pc-linux-gnu-3.2.2

and if still fail this
cd /usr/portage/sys-devel/gcc/files/
./fix_libtool_files.sh 3.2.1 (3.2.1 = old gcc version)
Comment 18 Don Seiler (RETIRED) gentoo-dev 2003-08-01 08:27:18 UTC
Puggy seems to also have documented a fix here:

http://forums.gentoo.org/viewtopic.php?p=434548#434548

Confirmed that it is not just a gaim bug.
Comment 19 William Stockall 2003-08-02 13:58:37 UTC
Looking through the libtool script in the /var/tmp/portage/gaim-0.6.6-r2/work/gaim-0.6.6-r2 directory, I found these lines:
# How to hardcode a shared library path into an executable.
hardcode_action=immediate

# Whether we should hardcode library paths into libraries.
hardcode_into_libs=yes

# Flag to hardcode $libdir into a binary during linking.
# This must work even if $libdir does not exist.
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"

# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator=""

# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct=no

# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L=no

# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
# the resulting binary.
hardcode_shlibpath_var=unsupported

Should the library paths be hard coded into shared libraries on a system whose library paths change as frequently as gentoo?  Is there any way to avoid this?  Obviously, changing this configuration for gaim won't fix this problem.  It would have to be done for most of the packages that build the *.la library files.  Is this feasible?
Comment 20 John Zheng 2003-08-04 22:06:19 UTC
I also ran into this, and remerged gcc, system like crazy before deciding to dig into the code.  What finally worked for me was to

emerge aspell gtkspell gaim

Well, at least I think that's the fix, gaim is still compiling.

My one short term suggestion for this is to issue a warning in the ebuild so people know to emerge aspell and gtkspell first, if they have upgraded gcc since those packages have been installed.

Such a warning would have saved me many hours of head scratching, and leave me with more hair intact to boot.

It seems the "right" way to do this would be a programatic solution that make the .la file reference a file in /etc/env.d/gcc

Otherwise, the gcc ebuild should update all the .la files, or at least suggest what packages to remerge following the tip from

http://forums.gentoo.org/viewtopic.php?p=434548#434548
Comment 21 Don Seiler (RETIRED) gentoo-dev 2003-08-18 18:32:58 UTC
Can someone else take this bug?  It doesn't seem to really be a gaim-specific bug.
Comment 22 Don Seiler (RETIRED) gentoo-dev 2003-08-19 12:34:48 UTC
Incidentally I had this same error last night updating an old laptop.  And emerge aspell gtkspell gaim fixed the problem.
Comment 23 Martin Holzer (RETIRED) gentoo-dev 2003-08-26 02:08:25 UTC
is aspell or gtkspell a depend or rdepend of gaim ?
Comment 24 Don Seiler (RETIRED) gentoo-dev 2003-08-26 06:24:22 UTC
gtkspell is a dependency of gaim if USE="spell".  gtkspell depends on virtual/aspell-dict.
Comment 25 Martin Holzer (RETIRED) gentoo-dev 2003-08-26 07:00:36 UTC
how about changing the number the latest stable version in ebuild as depend/rdepend ?
Comment 26 Don Seiler (RETIRED) gentoo-dev 2003-08-26 07:05:28 UTC
I can do that but that wouldn't necessarily stop this type of problem from happening even for gaim.  In fact I had the latest UNstable versions of aspell and gtkspell installed already, but after I upgraded gcc the problem was there.

Plus this problem happens for other software than just gaim, as some of the forum links will attest to.
Comment 27 Don Seiler (RETIRED) gentoo-dev 2003-09-04 08:06:23 UTC
*** Bug 27827 has been marked as a duplicate of this bug. ***
Comment 28 seb 2003-09-07 05:23:30 UTC
Not sure if anyone has taken ownership of the larger issue, but for the record bug  23277 is the same problem.
Comment 29 Don Seiler (RETIRED) gentoo-dev 2003-11-12 12:04:23 UTC

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