closures vs -Wl,--no-undefined

Lubos Lunak l.lunak at suse.cz
Fri Feb 14 09:24:11 GMT 2003


On Tuesday 11 of February 2003 09:51, Stephan Kulow wrote:
> Am Monday 10 February 2003 18:16 schrieb Lubos Lunak:
[snip]
> >
> >  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.

 As long as libtool still has its -no-undefined flag too. Took me some time to 
figure out :(.

> >
> >  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.
>
> -frepo is commented out as it never really worked for gcc. But e.g. Sun CC
> creates smaller code if it knows what template instances a shared library
> needs and it can't know unless it knows what templates the needed libs
> deliver. But as I'm not sure if that ever worked (I remember tons of
> problems with the STL usage of arts), I'm actually fine with the proposed
> patch.

 I tried also making libtool to use -Wl,--no-undefined for its -no-undefined, 
but libtool is really hard to persuade. After setting $no_undefined_flag to a 
correct value I found out libtool doesn't do anything useful with that 
variable anyway :(.

 So I'll commit an am_edit change that will put $(KDE_NO_UNDEFINED) next to 
every -no-undefined in LDFLAGS, as that will force libtool to use ld's 
--no-undefined flag. Closures are now off by default, if you want them for 
some reason (compiler with -frepo style of generating templates, platform 
doesn't support -Wl,--no-undefined), they have to be enabled explicitly.

 I rebuilt arts/kdelibs/kdebase with the patches without any problem, so I 
don't expect any trouble, but if there will be, yell.

-- 
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: 1894 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030214/baa0e270/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: am_edit.patch
Type: text/x-diff
Size: 1568 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030214/baa0e270/attachment-0001.patch>


More information about the kde-core-devel mailing list