[PATCH] builds libs by default with full RPATH
Alexander Neundorf
neundorf at kde.org
Sat Dec 29 16:01:35 CET 2007
On Thursday 20 December 2007, you wrote:
> 2007/12/16, Alexander Neundorf <neundorf at kde.org>:
> > Hi,
> >
> > attached you can find a small patch which changes the default value of
> > the option KDE4_USE_ALWAYS_FULL_RPATH from OFF to ON.
> > A better name for that option would be "KDE_BUILD_LIBS_WITH_RPATH", then
> > I wouldn't have to explain what it does.
> >
> > Pros: libs should always have the correct RPATH
> > Cons: "make install" will take longer, since libs then also have to be
> > relinked (as long as cmake without chrpath support is used)
>
> Hi Alex,
>
> do you know about
> http://people.debian.org/~che/personal/rpath-considered-harmful
> or
> http://wiki.debian.org/RpathIssue
>
> Considering the issues raised there, what's your answer to this?
Set CMAKE_SKIP_RPATH to TRUE, e.g. using "make edit_cache", then you get no
RPATH at all.
If you have KDE3 and KDE4 installed, you have two different libkdecore. I
don't see another way than RPATH to get this working (without setting up
wrapper scripts which set LD_LIBRARY_PATH different for KDE3 and KDE4 apps).
If you want to run an executable from the build tree, with the shared libs in
the same build tree, you also need RPATH (or wrapper scripts).
Wrapper scripts suck, because the people who want to run the executable have
to be aware of the fact that they have to run the wrapper script and not the
actual executable.
Setting up different LD_LIBRARY_PATHs sucks, because you either need wrapper
scripts as above, or you need to run a script which changes your environment
from KDE3 to KDE4 and vice versa before running the respective applications.
I didn't differentiate between RPATH and RUNPATH, because in these points the
differences don't matter.
What sucks about RPATH is that the binutils don't provide a way to change it
in existing ELF files (Apple added an option for that to the
link, -max-something-length or so, which does just that, it adds padding to
the path embedded in the binary for the install name path (which works a bit
different, but the issue with modifying it is the same)).
And that you can't install libraries to different directories, because then
the executables won't find them anymore.
Alex
P.S. I sent that email already december 20th, but accidentally without the
kde-buildsystem address in TO or CC
More information about the Kde-buildsystem
mailing list