<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>119428</bug_id>
          
          <creation_ts>2006-01-18 08:42 0000</creation_ts>
          <short_desc>libcaca.la doesn&apos;t note dependency on libslang.so when it should - causing amarok not to link</short_desc>
          <delta_ts>2006-05-09 16:13:28 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Library</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>blaisorblade_spam@yahoo.it</reporter>
          <assigned_to>media-video@gentoo.org</assigned_to>
          <cc>caster@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>blaisorblade_spam@yahoo.it</who>
            <bug_when>2006-01-18 08:42:29 0000</bug_when>
            <thetext>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&apos;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&apos;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=&apos; -ldl -L/usr/lib64 -lXext /usr/lib64/libaa.la -lm -lgpm /usr/lib64/libcaca.la -lX11 -lncurses -lpthread&apos;

libcaca.la doesn&apos;t list the dependency on libslang. It doesn&apos;t list any dependency indeed.

dependency_libs=&apos;&apos;

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&apos;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&apos;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&apos;
/usr/lib64/libcaca.so: undefined reference to `SLtt_Term_Cannot_Scroll&apos;
/usr/lib64/libcaca.so: undefined reference to `SLang_getkey&apos;
/usr/lib64/libcaca.so: undefined reference to `SLkp_init&apos;
....

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&apos;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 -&gt; /usr/lib64/libslang-utf8.a
lrwxrwxrwx  1 root root     27  3 nov 02:07 /usr/lib64/libslang.so -&gt; /usr/lib64/libslang-utf8.so
lrwxrwxrwx  1 root root     29  3 nov 02:07 /usr/lib64/libslang.so.1 -&gt; /usr/lib64/libslang-utf8.so.1
lrwxrwxrwx  1 root root     33  3 nov 02:07 /usr/lib64/libslang.so.1.4.9 -&gt; /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 -&gt; libslang-utf8.so.1.4.9
lrwxrwxrwx  1 root root     22  3 nov 02:07 /usr/lib64/libslang-utf8.so.1 -&gt; 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</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>flameeyes@gentoo.org</who>
            <bug_when>2006-03-16 17:29:59 0000</bug_when>
            <thetext>This should probably fail with --as-needed, let me try.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>flameeyes@gentoo.org</who>
            <bug_when>2006-03-16 17:51:12 0000</bug_when>
            <thetext>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.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2006-05-09 16:13:28 0000</bug_when>
            <thetext>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...</thetext>
          </long_desc>
      
    </bug>

</bugzilla>