SUBMISSION: New Library for kdesupport: indexlib

Thiago Macieira thiago at kde.org
Sun Jun 12 00:36:22 BST 2005


Michael Pyne wrote:
>> I'm not an expert on all this visibility stuff. Are there any macros
>> or whatnot we could add to the generated code to speed up linking? Or
>> is it just the sheer size of the Smoke library that is the problem?
>
>Actually that'd probably be a great idea.  The "best thing" to do would
>probably be somehow alter smoke to read in the various K*_EXPORT macros
> and automatically apply them to the generated source, and then that way
> perhaps we'd be able to use -fvisibility=hidden on the command line for
> a smaller lib size (and I'd assume a much quicker link time).
>
>I'm not really an expert either though, we should probably wait until
> Thiago tells us whether we're crazy or not. ;)

Less symbols will surely help speed up the linking, but that really 
depends on how much is turned hidden. If the most part of the symbols are 
visible, it won't change.

It also depends on the number of libraries there are. If it's all one big 
library, linking time won't change, because all symbols would be visible 
for that library.

Now, the KDE_EXPORT macro is defined in kdemacros.h and that is pretty 
self-contained. I had tried to "fix" Qt3 non-intrusively in the same 
fashion by trying:

	-DQ_EXPORT=KDE_EXPORT -include kdemacros.h

in g++'s command-line. That works for most cases (except when kdelibs 
isn't installed yet). You could adapt that to your case.

The recommendation is to have one *_EXPORT macro per library being 
compiled. Not for ELF, but to support Win32 in the future. So you 
shouldn't directly use the *_EXPORT symbols from the libraries whose 
bindings you are creating, but instead to create new macros.

But I diverge. The problem here is that g++ 3.4.x doesn't support 
visibility and I'm still not sure about 4.0.x's reliability. Those g++ 
3.4.x that have the visibility feature backported are broken.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

1. On frumscafte, hwonne time_t wæs náht, se scieppend þone circolwyrde 
wundorcræftlíge cennede and seo eorðe wæs idel and hit wæs gód.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050611/f439e913/attachment.sig>


More information about the kde-core-devel mailing list