kdeinit compiled with gcc 4.0.1 & visibility busted at runtime

David Faure faure at kde.org
Sun Jul 17 22:29:28 BST 2005


On Sunday 17 July 2005 23:11, Michael Nottebrock wrote:
> On Sunday, 17. July 2005 22:57, David Faure wrote:
> > On Sunday 17 July 2005 13:58, Michael Nottebrock wrote:
> > > Found a workaround: Hand-editing the generated klauncher_dummy.cpp and
> > > doing
> > >
> > > -extern "C" int kdeinitmain(int argc, char* argv[]) { return
> > > kdemain(argc,argv); }
> > > +extern "C" __attribute__ ((visibility("default"))) int kdeinitmain(int
> > > argc, char* argv[]) { return kdemain(argc,argv); }
> > >
> > > fixes things. Looks like we need some additional smartness in am_edit re.
> > > KDE_EXPORT? Or perhaps special-casing kdeinit will be enough - I didn't
> > > experience similar problems anywhere else (yet).
> >
> > Amazing that this didn't come up before (for other people with
> > gcc-with-visibility-support).
> >
> > How about this?
> >
> > --- am_edit     (revision 434767)
> > +++ am_edit     (working copy)
> > @@ -868,12 +868,12 @@ sub tag_KDEINIT()
> >                  push(@progs, $kdeinit);
> >
> >                  $lines .= "\n${kdeinit}.la.$cxxsuffix:\n";
> > -                $lines .= "\techo 'extern \"C\" int kdemain(int argc,
> > char* argv[]);' > ${kdeinit}.la.$cxxsuffix; \\\n"; +                $lines
> > .= "\techo 'extern \"C\" KDE_EXPORT int kdemain(int argc, char* argv[]);' >
> > ${kdeinit}.la.$cxxsuffix; \\\n"; $lines .= "\techo 'int main(int argc,
> > char* argv[]) { return kdemain(argc,argv); }' >>
> > ${kdeinit}.la.$cxxsuffix\n";
> 
> [...] 
> 
> That will probably not work - at least not in kdelibs/kinit. I tried that 
> first, but KDE_EXPORT is of course undefined in _dummy.cpp files with nothing 
> in them but extern "C" declarations.

Ah, right. khtml/Makefile.am also includes kdelibs_export.h  ... hmm, well kdemacros.h would be enough.

Can you test (at least) one of those patches?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: am_edit.diff
Type: text/x-diff
Size: 1648 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050717/a2b876b5/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdeinit_um.diff
Type: text/x-diff
Size: 1257 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050717/a2b876b5/attachment-0001.diff>


More information about the kde-core-devel mailing list