PATH and LD_LIBRARY_PATH for build time commands

Thiago Macieira thiago at kde.org
Thu Feb 16 16:13:27 CET 2006


David Faure wrote:
>> So, unless you tell the linker to use it, don't rely on it being
>> there. Which means: unless you tell the linker to use it, don't bother
>> setting LD_LIBRARY_PATH.
>
>.... unless not using RPATH at all (nor RUNPATH).

Right, but we want RPATH/RUNPATH to be on by default.

>Why isn't that an option? To save users from setting LD_LIBRARY_PATH
>to run KDE from a custom prefix? But they have to set PATH anyway...

If you don't set PATH, you can still run programs by calling their full 
names. And if you forget, you'll get minicli telling you it can't execute 
"kwrite" because it can't find it.

If you don't set the library search path, you'll get bizarre errors 
because the application starts, but doesn't show up. If you're not 
running from a shell, you'll never notice that it's a library that wasn't 
found. Hence what I said about setting it on by default: through -rpath.

The default should also be to set --enable-new-dtags, which means running 
an uninstalled binary is just a matter of setting LD_LIBRARY_PATH 
correctly before starting the app or gdb. But as I said in the other 
email, since you cannot expect that flag to be present in all archs we 
want to support, the buildsystem has to cope with the necessity of 
relinking.

Another option is to say: if your linker doesn't emit RUNPATH, then you 
cannot run uninstalled binaries. Would we get resistance from that? 
Considering the majority of our developer base is using Linux and most of 
the rest are either on GNU ld platforms (the BSDs) or not on ELF 
platforms, I don't think it would be a problem for KDE.

For cmake, as a tool, I think it would.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

1. On frumscafte, hwonne time_t wæs náht, se scieppend þone circolwyrde 
wundorcræftlíge cennede and seo eorðe wæs idel and hit wæs gód.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20060216/f11e9deb/attachment-0001.pgp 


More information about the Kde-buildsystem mailing list