[Development] Use static qt libraries
Thiago Macieira
thiago.macieira at intel.com
Tue Jul 24 12:08:50 CEST 2012
On terça-feira, 24 de julho de 2012 01.42.20, peng-peter.lan at nokia.com wrote:
> We are now porting Qt5 (selected modules) on a low profile device
> (ARM11 at 300MHz). All shared objects can XIP - so there is no need to load
> libs from ROM to RAM. But a major problem is the loading time of an
> application (qtbase examples) - it cost ~10-20 seconds to resolve the
> dependencies among the qt libraries. We believe if we can make a merged
> shared object, the performance would be greatly improved. By the way, the
> OS is a proprietary one...
It looks like your system has a major issue with dynamic linking if it takes
10 seconds to load two or three libraries. Take QtGui's statistics (ok, on
Linux, but it's an indication):
libQtCore.so.5: 3953 relocations, 3658 relative (92%), 236 PLT entries, 0 for
local syms (0%), 0 users
libQtGui.so.5: 6753 relocations, 5640 relative (83%), 754 PLT entries, 0 for
local syms (0%), 0 users
libQtWidgets.so.5: 18271 relocations, 15668 relative (85%), 1930 PLT entries,
0 for local syms (0%), 0 users
The number of local relocations (15668+5640+3658 = 24966) will not change.
You'll reduce only the inter-library relocations, which are 4012 in my case. A
quick grep of symbols coming from other libraries in my case shows it to be
around 300.
So, you'll go from 29000 relocations to 25200. So it will reduce load time,
but I'm just not sure it will be enough.
Moreover, note, that in a static build all the Q_xxx_EXPORT macros will expand
to empty. You might have a problem using this library.
PS: my build is without -fno-rtti, which I guess you are using in your case.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120724/c54c7431/attachment.sig>
More information about the Development
mailing list