The gold linker and KDE

Alexander Neundorf neundorf at kde.org
Mon Apr 14 22:19:04 CEST 2008


On Monday 14 April 2008, Andreas Hartmetz wrote:
> Hi all,
>
> I am one of the few KDEers who tried to link KDE4 using the upcoming linker
> in GNU binutils called "gold". gold fails if it encounters an unimplemented
> option (I guess it should ignore some less important ones instead) and it
> seems to be less forgiving when given an incomplete list of required
> libraries. The upside is that in pure link time gold is reportedly 5 to 6
> times faster than the old ld.
> We obviously want to use gold at some point, right? :)

Yes :-)

> I worked around the unknown options problem by hacking the gold options
> parser. 

Which options were the problem ?
We should handle this properly.

> In kdebase I added libdl to nspluginviewer's libraries. After that

Did you commit ?

> kdesupport, kdelibs, kdepimlibs and kdebase compiled and linked. When
> running the resulting binaries, however, knotify4 crashed every time it
> tried to play a sound because, apparently, the loading of phonon's xine
> backend failed. pusling on #kde-devel suggested that the xine backend
> itself might not be linked properly.

That sounds like it could be the problem.
What happens if you create a hello world and just link to libxine ? And maybe 
call a ew functions (without any Qt or KDE) ?


> Can you guess what might go wrong here? Ideally somebody who knows linking
> and the build system very well would try to link KDE with gold and fix
> everything necessary to make it work... I think that the gold maintainer
> will also fix obvious bugs quickly when asked.
> Another strange behavior (for the uninitiated) is that setting the linker
> to gold using ccmake will not have any effect. Maybe this is because
> gcc/g++ will be used as the frontend to ld 

Yes.

> and you can't really tell it
> which linker to use? This matters becaues just copying gold over ld will
> break compilation of KDE3 and probably many other applications which seem
> to have sloppy dependency lists.

In KDE4 we have Wno-undefined and -Wfatal-warnings, so actually we shouldn't 
have undefined symbols (not quite sure why we have them in the nsplugins 
though).

Alex


More information about the Kde-buildsystem mailing list