Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 119428 - libcaca.la doesn't note dependency on libslang.so when it should - causing amarok not to link
Summary: libcaca.la doesn't note dependency on libslang.so when it should - causing am...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-18 08:42 UTC by BlaisorBlade
Modified: 2006-05-09 16:13 UTC (History)
1 user (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 BlaisorBlade 2006-01-18 08:42:29 UTC
Short diagnosis is what I say in the title. This causes libtool not to add -lslang when linking packages using libcaca (or a libcaca-based libSDL, as below), and causing link-time errors. (Dependencies from shared libs to shared libs are not tracked in the lib itself, but by libtool only).

Below there is the complete report and analisys, since I never used libtool nor have a complete understanding of it. But I'm fairly good at guessing.

I emerged libcaca with USE=slang, then emerged amarok (which depends on libcaca, given the error below, which I got many times). I have installed 1.3.7, I failed emerging 1.3.7-r1 and 1.3.8 this way, but I guess it's because I updated libcaca/changed use flags.

As it seems, and as I verified, the missing symbols should come from libslang (I verified this for SLang_reset_tty). By looking at .la files, I get that:

libSDL.la depends on libcaca:

# Libraries that this one depends upon.
dependency_libs=' -ldl -L/usr/lib64 -lXext /usr/lib64/libaa.la -lm -lgpm /usr/lib64/libcaca.la -lX11 -lncurses -lpthread'

libcaca.la doesn't list the dependency on libslang. It doesn't list any dependency indeed.

dependency_libs=''

So the problem is something around this missing dependency. Infact, adding -lslang to the below command works. What I tried (and failed) to do is to add -lslang to libcaca.la. It didn't work. However, I later tried to add it to libSDL.la (which is the one referenced below on the cmd line), and it worked, and then the ebuild itself worked.

My conclusion is that libtool doesn't do recursive resolution of dependencies in .la files at link time. It assumes that when libSDL was built, its .la file contained the already completely resolved dependency list, which happens if all the libs it bases upon have correct .la files. I.e., if after adding -lslang to libcaca.la I rebuilt libSDL, it would have picked -lslang in its .la.

/bin/sh ../../../../libtool --silent --mode=link --tag=CXX x86_64-pc-linux-gnu-g++  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -march=athlon64 -O2 -pipe -fno-inline -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION    -o amarok_libvisual -lpthread -lm -ldl -lvisual   -lSDL -lpthread libvisual.o
/usr/lib64/libcaca.so: undefined reference to `SLtt_set_cursor_visibility'
/usr/lib64/libcaca.so: undefined reference to `SLtt_Term_Cannot_Scroll'
/usr/lib64/libcaca.so: undefined reference to `SLang_getkey'
/usr/lib64/libcaca.so: undefined reference to `SLkp_init'
....

Platform: stable amd64
Package versions:
media-libs/libcaca-0.9-r1 built with +slang:

$ equery uses media-libs/libcaca
 + + X       : Adds support for X11
 - - doc     : Adds extra documentation (API, Javadoc, etc)
 + + imlib   : Adds support for imlib, an image loading and rendering library
 + + ncurses : Adds ncurses support (console display library)
 + + slang   : Adds support for the slang text display library (it's like ncurses, but different)

$ equery uses sys-libs/slang-1.4.9-r1
 - - cjk     : Adds support for Multi-byte character languages (Chinese, Japanese, Korean)
 + + unicode : Adds support for Unicode

# ls -l /usr/lib64/libslang*

lrwxrwxrwx  1 root root     26  3 nov 02:07 /usr/lib64/libslang.a -> /usr/lib64/libslang-utf8.a
lrwxrwxrwx  1 root root     27  3 nov 02:07 /usr/lib64/libslang.so -> /usr/lib64/libslang-utf8.so
lrwxrwxrwx  1 root root     29  3 nov 02:07 /usr/lib64/libslang.so.1 -> /usr/lib64/libslang-utf8.so.1
lrwxrwxrwx  1 root root     33  3 nov 02:07 /usr/lib64/libslang.so.1.4.9 -> /usr/lib64/libslang-utf8.so.1.4.9
-rw-r--r--  1 root root 880588  3 nov 02:07 /usr/lib64/libslang-utf8.a
lrwxrwxrwx  1 root root     22  3 nov 02:07 /usr/lib64/libslang-utf8.so -> libslang-utf8.so.1.4.9
lrwxrwxrwx  1 root root     22  3 nov 02:07 /usr/lib64/libslang-utf8.so.1 -> libslang-utf8.so.1.4.9
-rwxr-xr-x  1 root root 458584  3 nov 02:07 /usr/lib64/libslang-utf8.so.1.4.9
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-03-16 17:29:59 UTC
This should probably fail with --as-needed, let me try.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-03-16 17:51:12 UTC
Okay the libtool patch was a bit messed up, now should be better in 0.9-r2: libcaca links to libslang if needed instead of leaving the dependency to be satisfied by the linking program.
Comment 3 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-05-09 16:13:28 UTC
How bout stabilizing the -r2? I just added slang to USE and remerged --newuse world (no revdep-rebuild pending), and some stuff stopped to work:

symbol lookup error: /usr/lib/libcaca.so.0: undefined symbol: SLtt_Term_Cannot_Scroll

I admit it was a game ebuild not from portage, using libsdl, but the problem went away after unmasking and merging 0.9-r2.

There is bug 126975 about problems merging the -r2, but some people there report it even with -r1...