RPATH again - different types of executables

Thiago Macieira thiago at kde.org
Wed Mar 29 10:55:41 CEST 2006


Brad King wrote:
>You're probably right.  I've never encountered the problem because I use
>CMake for everything.  It automatically pulls in library dependencies
>and links the executable explicitly to all libraries (at least if the
>project providing the libs uses export_library_dependencies properly).

Which is actually the source of the problem I had this weekend (which I 
mentioned in the reply to Albert). My KDE 3.5 build uses the linker 
flag --as-needed automatically.

This means libraries and executables don't link to libraries they don't 
import any symbols from. In turn, the search path is screwed up before 
installation, since (real example) knewstuff/khotnewstuff links to 
knewstuff/libknewstuff.la, which pulls in libkio, which pulls in 
libkdeui.

During linking, I get lots of linker warnings like "libkio.so.4 needed by 
libknewstuff.so.1 not found; maybe you need -rpath or -rpath-link".

I would have solved this problem a long time ago if I could actually 
understand libtool code...

>Inside the kdelibs build tree CMake will link the executables to
>everything they need so the library search paths will not be needed.
>Perhaps they could be built with the install tree rpath only.  I'm not
>sure what the precedence is though so that might conflict with the
>executable's rpath.  Someone will have to investigate.

The libraries should have rpath set to the install dir only. That should 
be more than enough.

If you run an uninstalled program, the LD_LIBRARY_PATH setting should take 
over and let it find everything.
-- 
Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
  thiago.macieira (AT) trolltech.com     Trolltech AS
    GPG: 0x6EF45358                   |  Sandakerveien 116,
    E067 918B B660 DBD1 105C          |  NO-0402
    966C 33F5 F005 6EF4 5358          |  Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20060329/bb1be288/attachment.pgp 


More information about the Kde-buildsystem mailing list