[CMake] rpath problems with kdevplatform
Andreas Pakulat
apaku at gmx.de
Sat Jun 26 09:12:06 EDT 2010
On 26.06.10 13:26:29, Andreas Pakulat wrote:
> On 21.06.10 23:30:46, Andreas Pakulat wrote:
> > On 21.06.10 21:29:14, Alexander Neundorf wrote:
> > > On Sunday 20 June 2010, Andreas Pakulat wrote:
> > > > On 20.06.10 13:27:30, Thiago Macieira wrote:
> > > > > Em Domingo 20. Junho 2010, às 13.07.15, Andreas Pakulat escreveu:
> > > > > > Hi,
> > > > > >
> > > > > > I'm running into weird issues with cmake 2.8.1 and its rpath-handling.
> > > > > > First thing I found was that FindKDE4Internal.cmake from Debian sets
> > > > > > CMAKE_INSTALL_RPATH_USE_LINK_PATH to false, but even after that
> > > > > > cmake_install.cmake files in kdevplatform all have code to do
> > > > > > RPATH_REMOVE instead of RPATH_CHANGE. I'm just running cmake
> > > > > > -DCMAKE_INSTALL_PREFIX=$HOME/kdevelop
> > > > > >
> > > > > > Doing the same thing with kdevelop (which depends on kdevplatform)
> > > > > > shows no problem, the cmake_install.cmake has the proper
> > > > > > FILE(RPATH_CHANGE calls.
> > > > > >
> > > > > > Anybody an idea where I should go hunting from here? There must be some
> > > > > > difference between the two projects, but I can't see what.
> > > > >
> > > > > I don't understand what the problem is.
> > > > >
> > > > > Debian disables rpath. That's intentional.
> > > >
> > > > Actually its not, what they don't want is rpath on stuff installed to
> > > > /usr. Anyway, thats not the point of my writing, the point is that even
> > > > after adjusting the relevant setting in FindKDE4Internal.cmake (to match
> > > > the one in svn) I still get no rpath for one project, but do get rpath
> > > > for the other. And I don't understand why or where to look for
> > > > differences in the projects that would influence this.
> > >
> > > The global settings are done in FindKDE4Internal.cmake after line 996.
> > > They can be overridden locally by projects by setting these cmake variables
> > > again or by setting the corresponding target properties.
> >
> > Yeap, thats what I've done now for kdevplatform and kdevelop, but seems
> > only one is in effect...
> >
> > > What's the complete link line for the case that you don't get an RPATH ?
> >
> > /usr/bin/c++ -fPIC -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef
> > -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith
> > -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new
> > -fno-common -Woverloaded-virtual -fno-threadsafe-statics
> > -fvisibility=hidden -fvisibility-inlines-hidden -O2 -g -DNDEBUG
> > -DQT_NO_DEBUG -Wl,--enable-new-dtags -Wl,--fatal-warnings
> > -Wl,--no-undefined -lc -shared -Wl,-soname,kcm_kdev_ccsettings.so -o
> > ../../lib/kcm_kdev_ccsettings.so
> > CMakeFiles/kcm_kdev_ccsettings.dir/kcm_kdev_ccsettings_automoc.o
> > CMakeFiles/kcm_kdev_ccsettings.dir/ccpreferences.o
> > CMakeFiles/kcm_kdev_ccsettings.dir/ccconfig.o
> > /usr/lib/libkutils.so.4.4.0 /usr/lib/libkdeui.so.5.4.0
> > ../../lib/libkdevplatforminterfaces.so.2.0.0
> > ../../lib/libkdevplatformshell.so.2.0.0 /usr/lib/libktexteditor.so.4.4.0
> > ../../lib/libkdevplatforminterfaces.so.2.0.0 /usr/lib/libkutils.so.4.4.0
> > /usr/lib/libktexteditor.so.4.4.0 /usr/lib/libkparts.so.4.4.0
> > /usr/lib/libQtDesigner.so /usr/lib/libkio.so.5.4.0
> > /usr/lib/libQtNetwork.so /usr/lib/libQtXml.so /usr/lib/libkdeui.so.5.4.0
> > /usr/lib/libkdecore.so.5.4.0 /usr/lib/libQtDBus.so /usr/lib/libQtCore.so
> > /usr/lib/libQtGui.so /usr/lib/libQtSvg.so
> > -Wl,-rpath,/home/andreas/src/build/kdevplatform/lib:
> > -Wl,-rpath-link,/home/andreas/src/build/kdevplatform/lib
> >
> > That looks fine to me and in fact ldd on the module in the builddir
> > finds all libs from the builddir. But when doing a make install
> > VERBOSE=1 I see:
> > -- Installing: /home/andreas/kdevelop/lib/kde4/kcm_kdev_ccsettings.so
> > -- Removed runtime path from
> > "/home/andreas/kdevelop/lib/kde4/kcm_kdev_ccsettings.so"
>
> Ping? Any further ideas on this? Could someone at least point me to the
> source code in cmake that decides wether to add RPATH_REMOVE or
> RPATH_REPLACE to the cmake_install.cmake file?
Found it already, I've patched a cmake checkout here to give some
diagnostic output and looking at the differences its apparent that for
kdevplatform the installation prefix is not added to the
"OrderRuntimeSearchPath" list in cmComputeLinkInformation, but this is
done for kdevelop targets.
The reason seems to be that when building kdevplatform there are no
libraries in the install-prefix that the to-be-built targets link
against. So it seems that this is rather a cmake bug, hence I'm cc'ing
to the cmake list (and including all the quotes).
@CMake-List readers: Am I right that cmake simply should add the
install-prefix to the ORderRuntimeSearchPath at some point during
initialization? That should help in this case (I didn't test this yet)
where a project builds multiple shared libraries and other targets
(executables or plugins) that link against those shared libs.
Andreas
--
Stay away from hurricanes for a while.
More information about the CMake
mailing list