closures vs -Wl,--no-undefined

Lubos Lunak l.lunak at suse.cz
Mon Feb 10 17:16:42 GMT 2003


 Hello,

 in case you haven't noticed yet, many KDE libs are linked twice. To be 
precise, all those having -no-undefined (or $(KDE_PLUGIN) ) in their LDFLAGS. 
Which makes the not so pleasant linking times even less pleasant.

 This is caused by the closures used in build process. They were introduced in 
order to help with templates (the -frepo days), but these days, as far as I 
can say, they're used only for -no-undefined (since adding -frepo to CXXFLAGS 
is commented out - maybe another compiler still needs it). But GNU ld has 
option --no-undefined, which can check for undefined references too, and 
which libtool's -no-undefined option doesn't use (what a surprise :/ ).

 I tried to recompile kdelibs with the attached patches from admin/, and it 
built quite fine, detecting undefined symbols, with two exceptions, in 
arts/kde, and one subdir in kabc/. This is because -Wl,--no-undefined (i.e. 
the GNU ld one) needs all dependent libs to be listed in the link command, 
and those two apparently don't have it, and link only because all needed libs 
are pulled in as dependencies of libs used in the link command. But I don't 
consider this a bit problem, as libtool lists all dependent libs in the link 
command anyway.

 Can anyone comment on the closures, or the attached patches? Maybe it would 
be simpler to make our libtool use -Wl,--no-undefined (for 
$no_undefined_flag) instead of the replacing done by am_edit, but I'm too 
scared to touch libtool.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acinclude.m4.in.patch
Type: text/x-diff
Size: 1931 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030210/ffa415a9/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: am_edit.patch
Type: text/x-diff
Size: 1806 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030210/ffa415a9/attachment-0001.patch>


More information about the kde-core-devel mailing list