Re: Fwd: Re: Fwd: Re: [PATCH] libkdeinit symbol pruning
Karl Vogel <[email protected]>
| Newsgroups | gmane.comp.kde.devel.optimize |
|---|---|
| Message-ID | <[email protected]> |
David Faure wrote: > ---------- Forwarded Message ---------- > > Subject: Re: Fwd: Re: [PATCH] libkdeinit symbol pruning > Date: Tuesday 20 July 2004 21:30 > From: Stephan Kulow <[email protected]> > To: David Faure <[email protected]> > > That am_edit patch is broken, the unsermake patch should work :) > > Greetings, Stephan > > ------------------------------------------------------- Great! But I'm wondering what the problem with the am_edit patch was then?! Anyway.. more goodies.. I just finished testing the GCC visibility patch on QT (gcc 3.4): * Normal build $ objdump -CT libqt-mt.so.3.3.2|egrep "g +DF .text"|wc -l 14019 libqt-mt.so.3.3.2: 41138 relocations, 10177 relative (24%), 9322 PLT entries * build with visibility patch $ objdump -CT libqt-mt.so.3.3.2|egrep "g +DF .text"|wc -l 11851 libqt-mt.so.3.3.2:40993 relocations, 14275 relative (34%), 7573 PLT entries The binary was 980Kb smaller (but both were already extremely large since it was a debug build). Non-debug stripped builds give: $ ls -l libqt-mt.so.3.3.2 -rwxrwxr-x 1 kvo kvo 8225336 Jul 21 01:46 libqt-mt.so.3.3.2 $ ls -l libqt-mt.so.3.3.2 -rwxrwxr-x 1 kvo kvo 8655704 Jul 21 02:00 libqt-mt.so.3.3.2 430Kb saving. libqt-mt.so.3.3.2: 40966 relocations, 14267 relative (34%), 6291 PLT entries libqt-mt.so.3.3.2: 41114 relocations, 10174 relative (24%), 8069 PLT entries 1778 PLT entries less. There was only 1 minor problem.. KDE was using a symbol from QT that wasn't exported (qt_try_modal in src/kernel/qapplication_x11.cpp). So I added a Q_EXPORT in front of it. For the rest, all I did was add the -fvisibility=hidden to QMAKE_CXXFLAGS and edited qglobal.h to set Q_EXPORT to __attribute__((visibility ("default"))) So looks like promoting the use of KDE_EXPORT is a worthwhile cause.. together with an autoconf check for the -fvisibility gcc option.