Some libraries are not found without LD_LIBRARY_PATH mangling

Andras Mantia amantia at kde.org
Sun Oct 28 16:23:18 GMT 2007


On Sunday 28 October 2007, Allan Sandfeld Jensen wrote:
> I didn't mean RPATH. The elf-binaries has a list of libraries, if
> these libraries are relative they use RPATH of LD_LIBRARY_PATH, but
> they can also be absolute with a full path. However it is only used
> in special cases, so it is unlikely.
>
> Using "readelf -d" you will find a list of libraries like this:
> 0x00000001 (NEEDED)         Shared library: [libQtCore.so.4]
> or like this:
> 0x00000001 (NEEDED)         Shared library:
> [/opt/qt-4/lib/libQtCore.so.4]
>
> I doubt it is the case, it is just the only explanation I can think
> of, if you haven't set any RPATHs.

When running cmake I didn't add any extra flags. I removed 
not /opt/kde4/lib64 fro /etc/ld.so.conf to reproduce the problem 
agains.
Let's take ksmserver (as an important,  base binary):
ldd /opt/kde4/bin/ksmserver
        libkdeinit4_ksmserver.so 
=> /opt/kde4/lib64/libkdeinit4_ksmserver.so (0x00002b7ca536d000)
        libplasma.so.1 => /opt/kde4/lib64/libplasma.so.1 
(0x00002b7ca559e000)
        libQtOpenGL.so.4 => /opt/qt4/lib/libQtOpenGL.so.4 
(0x00002b7ca58e5000)
[...]
        libkparts.so.4 => not found
        libkpty.so.4 => not found

readelf -d /opt/kde4/bin/ksmserver
 0x0000000000000001 (NEEDED)             Shared library: 
[libkdeinit4_ksmserver.so]
 0x0000000000000001 (NEEDED)             Shared library: 
[libplasma.so.1]
 0x0000000000000001 (NEEDED)             Shared library: 
[libQtOpenGL.so.4]
[...]
 0x000000000000000f (RPATH)              Library rpath: 
[/opt/kde4/lib64:/usr/local/lib:/opt/qt4/lib:/opt/kde4/lib64]
 0x000000000000001d (RUNPATH)            Library runpath: 
[/opt/kde4/lib64:/usr/local/lib:/opt/qt4/lib:/opt/kde4/lib64]
[...]

linkparts and libkpty DO NOT appear here! And I have an RPATH and 
RUNPATH poiting to /opt/kde4/lib64.

I think the problem is somewhere here. Some libraries are needed 
probably as a dependency of other libraries, but they are not found.

readelf -d /opt/kde4/lib64/libkparts.so
 0x0000000000000001 (NEEDED)             Shared library: 
[libQtCore.so.4]
 0x0000000000000001 (NEEDED)             Shared library: 
[libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: 
[libkdecore.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libkdeui.so.5]
 0x0000000000000001 (NEEDED)             Shared library: [libkio.so.5]
[...]
 0x000000000000000e (SONAME)             Library soname: 
[libkparts.so.4]

and there is no RPATH or RUNPATH.

In case of KDE3 libraries there is one.

Shouldn't the KDE4 libraries also have RPATH and RUNPATH entries inside 
them? I think this is the bug I see. And all the solutions with 
LD_LIBRARY_PATH, ld.so.conf and -DKDE4_USE_ALWAYS_FULL_RPATH=ON 
(untested yet) are probably only workarounds.

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071028/52e3668b/attachment.sig>


More information about the kde-core-devel mailing list