[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: KDE/kdevplatform/plugins
From: Andreas Hartmetz <ahartmetz () gmail ! com>
Date: 2009-06-07 19:50:06
Message-ID: 200906072150.07325.ahartmetz () gmail ! com
[Download RAW message or body]
On Sunday 07 June 2009 01:39:56 Andreas Pakulat wrote:
> On 06.06.09 21:05:34, Andreas Hartmetz wrote:
> > SVN commit 978363 by ahartmetz:
> >
> > link with gold
> >
> > M +6 -4 git/tests/CMakeLists.txt
> > M +2 -0 mercurial/tests/CMakeLists.txt
> > M +1 -1 snippet/CMakeLists.txt
> >
> >
> > --- trunk/KDE/kdevplatform/plugins/git/tests/CMakeLists.txt
> > #978362:978363 @@ -20,13 +20,15 @@
> > set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
> > set(gitInitTest_SRCS initTest.cpp ../gitplugin.cpp)
> > kde4_add_unit_test(kdevgit-test ${gitInitTest_SRCS})
> > - target_link_libraries(kdevgit-test
> > - ${QT_QTTEST_LIBRARY}
> > - ${KDE4_KDECORE_LIBS}
> > + target_link_libraries(kdevgit-test
> > + ${QT_QTTEST_LIBRARY}
> > + ${KDE4_KDECORE_LIBS}
> > + kdevplatformshell
> > + kdevplatforminterfaces
> > kdevplatformutil
> > kdevplatformvcs
> > kdevplatformtestshell
>
> This shouldn't be needed kdevplatformtestshell sets kdevplatformshell as
> link-interface library, which means the linker is supposed to \
> automatically link the library in. This suggests that either your linker \
> is broken, or CMake needs special support for the gold linker. Please \
> revert this and the similar commit you've done to kdevelop (the same \
> applies to the other 2 files this commit changes).
>
The link interface libraries should, for all I know, be added to the g++ / \
ld command-line by cmake. KOffice for example builds just fine after all \
its libraries have gotten a comprehensive link interface. I had a \
discussion about this with Thomas Zander and it turned out that this was \
how it was supposed to work but it broke and people using ld didn't \
notice. Thomas fixed just a few lines in some CMakeLists.txt and all the \
linker errors were gone. I suspect that the link interface setup here \
somehow doesn't work.
I'll explain the relevant difference between gold and ld here with an \
example: Consider Application App which uses libQtCore and libfoo (in App's \
code). With ld, you can link App against libQtCore and because libQtCore \
uses libfoo internally you get libfoo automatically.
With gold, you have to add libfoo to the linker command line because App \
uses it and gold will *not* search for App's dependencies in libQtCore's \
required libs. If App does not link against libfoo itself this problem is \
not present. So gold ist stricter and requires you to tell the linker about \
all libraries you're going to use explicitly (i.e. not through other \
libraries).
Here is the linker command for kdevgit-test (changes reverted):
cd /home/horst/ksvn/Bkdevplatform/plugins/git/tests && /usr/local/bin/cmake \
-E cmake_link_script CMakeFiles/kdevgit-test.dir/link.txt --verbose=1 \
/usr/lib/icecc/bin/c++ -O1 -Wnon-virtual-dtor -Wno-long-long -ansi \
-Wundef - Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith \
-Wformat-security -fno- exceptions -fno-check-new -fno-common \
-Woverloaded-virtual -fno-threadsafe- statics -fvisibility=hidden \
-fvisibility-inlines-hidden -g3 -fno-inline -fPIC
-Wl,--enable-new-dtags -Wl,-Bsymbolic-functions -Wl,--as-needed
CMakeFiles/kdevgit-test.dir/kdevgit-test_automoc.o CMakeFiles/kdevgit-
test.dir/initTest.o CMakeFiles/kdevgit-test.dir/__/gitplugin.o -o kdevgit-
test -rdynamic -L/home/horst/ksvn/Bkdevplatform/lib -L/opt/kde4/lib
/opt/kde4/lib/libQtTest.so /opt/kde4/lib/libkdecore.so.5.3.0
../../../lib/libkdevplatformutil.so.1.0.0
../../../lib/libkdevplatformvcs.so.1.0.0
../../../lib/libkdevplatformtestshell.so.1.0.0
../../../lib/libkdevplatformvcs.so.1.0.0
../../../lib/libkdevplatformutil.so.1.0.0 /opt/kde4/lib/libkutils.so.4.3.0
/opt/kde4/lib/libkparts.so.4.3.0 /opt/kde4/lib/libkio.so.5.3.0
/opt/kde4/lib/libkdeui.so.5.3.0 /opt/kde4/lib/libQtSvg.so
/opt/kde4/lib/libQtNetwork.so /opt/kde4/lib/libQtXml.so
/opt/kde4/lib/libQtGui.so /opt/kde4/lib/libkdecore.so.5.3.0
/opt/kde4/lib/libQtDBus.so /opt/kde4/lib/libQtCore.so -lpthread -Wl,-
rpath,/home/horst/ksvn/Bkdevplatform/lib:/opt/kde4/lib -Wl,-rpath-
link,/home/horst/ksvn/Bkdevplatform/lib:/opt/kde4/lib \
/usr/bin/ld-new: CMakeFiles/kdevgit-test.dir/kdevgit-test_automoc.o: in
function vtable for GitPlugin:kdevgit-
test_automoc.cpp(.rodata._ZTV9GitPlugin+0x70): error: undefined reference \
to 'KDevelop::IPlugin::unload()'
(...)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic