[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Help: "Cannot mix incompatible Qt libraries"
From:       "Guillaume Pothier" <gpothier () gmail ! com>
Date:       2008-08-27 17:39:47
Message-ID: 8caa8ded0808271039n2fcbc644ube7ab18e2cb66a2d () mail ! gmail ! com
[Download RAW message or body]

Okay, I think I may have an explanation.
Before starting to hack on kde4 a few weeks ago, I had the Kubuntu
kde4.1 beta packages from ppa. That installed qt 4.4.0 on my system.
Then I compiled kde trunk, and all went fine. However I think that
some of the kdesupport libraries did already link against my system's
qt instead of qt-copy at that time, but that didn't cause any problem
because qt-copy was still 4.4.0.
Then qt-copy was updated to 4.4.1 (on July 31th it seems), but I
probably didn't recompile qt-copy from scratch for a while so the
mismatch went unnoticed. Then at some point (2 days ago), some update
in kde or qt-copy probably triggered a "deep" rebuild of something,
that made the problem surface.
Does it sound reasonable? If so, it means that phonon, soprano and co
do need the same RPATH cmake options as akonadi. Just in case, a patch
that does just that is attached.
Regards,
g

On Wed, Aug 27, 2008 at 12:42 PM, Guillaume Pothier <gpothier@gmail.com> wrote:
> Thanks for the explanation Thiago!
> Actually, it seems the problem is not fixed after all. I reverted my
> whole kdesupport tree to HEAD (removing the RPATH cmake options I
> copied from akonadi to soprano, phonon and co), and the libs are wrong
> again.
>
> There are a few things I don't understand:
> - Yesterday, after adding the correct RPATH in kdesupport, no lib
> tried to link to my system's Qt anymore.  However some apps (eg
> dolphin) did, although I did also rebuild them (with kdesvn-build
> --reconfigure).
> - Today, rebuilding kdebase made those apps work again. Then reverting
> kdesupport made the libs wrong again, but the apps still work, even
> after rebuilding.
> - And most importantly: why did everything work without problems until
> a few days ago, and now doesn't? Is everything working for everybody
> except Michael Jansen and I?
>
> Regards,
> g
>
> On Wed, Aug 27, 2008 at 12:08 PM, Thiago Macieira <thiago@kde.org> wrote:
>> On Quarta 27 Agosto 2008 16:57:10 Guillaume Pothier wrote:
>>> Well, it seems this problem got fixed now. I'd like to understand what
>>> happenned anyway, anybody knows which commit did the fix?
>>
>> I don't know what commit fixed it, but I can tell you what the problem is:
>>
>> When you link to a library, you pass arguments like: -L$QTDIR/lib -lQtCore.
>> The linker will then do its magic and it'll write a binary for you. In the
>> header of that binary, it lists what libraries it needs.
>>
>> That's the NEEDED entries you saw on the objdump -p output (-p stands for
>> "platform headers" or "private headers"). It matches all of the libraries that
>> you pass with -l. However, the -L entries are not saved anywhere.
>>
>> There's another entry you can have called RPATH or RUNPATH that sets the paths
>> where to find those libraries, in order of preference. But you need an extra
>> linker option passed in order to set those.
>>
>> The kdesupport libraries did not or still do not have those extra options.
>>
>> Also note that the ELF loading process requires a depth-first loading. So when
>> dolphin links to libkdecore, libkdecore has to be successfully loaded before
>> any dependencies of dolphin appear. And since libkdecore links to soprano or
>> phonon, those have to be loaded before libkdecore loads.
>>
>> And what happened? Soprano, strigi and phonon could not be loaded because of
>> the missing entries.
>>
>> Or, in your original case, since the RPATH/RUNPATH were not present, the
>> loader found the system Qt libraries and loaded those.
>>
>> But when it came to loading the dependencies of kdecore or dolphin, it loaded
>> QtSvg from a different Qt build. And that's not allowed. Hence $subject.
>>
>> --
>>   Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
>>     PGP/GPG: 0x6EF45358; fingerprint:
>>     E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>>
>>
>>
>>>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
>>
>>
>

["kdesupport-rpath.diff" (text/plain)]

Index: kdesupport/soprano/CMakeLists.txt
===================================================================
--- kdesupport/soprano/CMakeLists.txt	(revision 853354)
+++ kdesupport/soprano/CMakeLists.txt	(working copy)
@@ -9,6 +9,9 @@
  
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) 
 
+set(CMAKE_SKIP_BUILD_RPATH FALSE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
 if(WIN32)
   set(CMAKE_DEBUG_POSTFIX "d")
 endif(WIN32)
Index: kdesupport/phonon/CMakeLists.txt
===================================================================
--- kdesupport/phonon/CMakeLists.txt	(revision 853354)
+++ kdesupport/phonon/CMakeLists.txt	(working copy)
@@ -15,6 +15,9 @@
 
 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
+set(CMAKE_SKIP_BUILD_RPATH FALSE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
 include(MacroLogFeature)
 include(MacroOptionalFindPackage)
 
Index: kdesupport/strigi/CMakeLists.txt
===================================================================
--- kdesupport/strigi/CMakeLists.txt	(revision 853354)
+++ kdesupport/strigi/CMakeLists.txt	(working copy)
@@ -13,6 +13,9 @@
 # include specific modules
 set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
+set(CMAKE_SKIP_BUILD_RPATH FALSE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
 # include general modules
 include(UsePkgConfig)
 include(MacroCheckGccVisibility)
Index: kdesupport/qimageblitz/CMakeLists.txt
===================================================================
--- kdesupport/qimageblitz/CMakeLists.txt	(revision 853354)
+++ kdesupport/qimageblitz/CMakeLists.txt	(working copy)
@@ -1,5 +1,9 @@
 project(blitz)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )
+
+set(CMAKE_SKIP_BUILD_RPATH FALSE)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
 find_package(Qt4 REQUIRED)
 
 


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic