[Interest] Size of libQt5Core in 5.3

Daniel Bowen qtmailinglist1 at bowensite.com
Mon May 12 23:29:29 CEST 2014

Thanks to everyone that responded to this thread! You've given me a lot of
good things to try.

qconfig is nice to separate out those -no-feature- items into another file -
thanks! ./configure -help still lists -qconfig, so hopefully that's a good
sign that it will stay around, even if the Qt5 documentation doesn't mention

For locale, thanks for those steps! That'd be great to have an easy way in
the future to disable everything except C and en_US (or disable everything
and only enable select items). Things like buildroot have a way to only
include a list of specified locales.

-no-exceptions would be nice.  If it's just a matter of changing "CONFIG  +=
exceptions" in corelib.pro, then that's straight forward enough.

Some of the other surgical removals are possibilities I'll look at, but that
kind of thing can have a domino effect if there's not already a supported
way to disable some section of code.

And thanks for the other tips with qtcoremapfile, object file sizes, etc..

If anyone has other things to add, please do. 

Along the way, I have a couple of things that I'll send in separate e-mails
(-no-feature-REGULAREXPRESSION not working and qtdiag building even though
-no-gui specified).


-----Original Message-----
From: interest-bounces+qtmailinglist1=bowensite.com at qt-project.org
[mailto:interest-bounces+qtmailinglist1=bowensite.com at qt-project.org] On
Behalf Of Peter Kümmel
Sent: Monday, May 12, 2014 2:48 AM
To: interest at qt-project.org
Subject: Re: [Interest] Size of libQt5Core in 5.3

On 11.05.2014 09:20, Daniel Bowen wrote:
> I have an embedded environment where we usenon-UI parts of Qt (Qt Core, Qt
Networking)on an ARM host processor.
> We’ve been using 4.8.4for a little while. There’s some other changes
comingto this code, and we’ve been looking to move
> to5.xwith the upcoming 5.3. After working through several issues, I gotthe
release candidate ofQt5.3compiledfor this
> processor.  At first, libQt5Core.so.5.3.0was 6.6MB!  With 4.8.4,we were
able to getlibQtCore4down to2.6 MB.

Here libQt5Core needs 3905596b after stripping (ARM, GCC 4.8.2, -O3)  and
with these options

-no-c++11 -optimized-qmake -no-kms -no-cups -no-nis -no-iconv -system-zlib
-system-pcre -no-pch -release -shared 
-largefile -opensource -confirm-license -gui -widgets --enable-linuxfb
-no-directfb -no-xcb -opengl es2 -eglfs -openssl 
-no-fontconfig -no-gif -system-libjpeg -system-libpng -no-dbus -no-tslib
-no-glib -no-icu -nomake examples

For removing features you could also use 'qconfig' (now in the qttools


(Seems documentation got lost in Qt5)


> So I started putting in -skip, -no-feature, etc.having features wewould
still use, but other things stripped out.I also
> had a mkspec use -Os to optimize for size.Usingsomething likethis:
> OPENSSL_LIBS="-L(pathfor openssl)-lssl -lcrypto" ./configure -release
-opensource -prefix(pathfor
> prefix)-extprefix(pathfor prefix)-shared -largefile -I(path for
jpeg)-L(path for jpeg)-sysroot(path for
> sysroot)-xplatform linux-arm_v5t_le-g++ -confirm-license -system-zlib
-system-libpng -system-libjpeg -openssl-linked
> -no-accessibility -no-freetype -no-harfbuzz -no-glib -no-gui -no-widgets
-no-cups -no-iconv -no-evdev -no-icu
> -no-fontconfig -no-pch -no-dbus -no-xcb -no-directfb -no-linuxfb -no-kms
-no-opengl -nomake examples -nomake tests -skip
> qtdeclarative -skip qtdoc -skip qtgraphicaleffects -skip qtlocation -skip
qtquick1 -skip qtquickcontrols -skip qtscript
> -skip qttranslations -skip qtwebkit -skip qtwebkit-examples -skip
qtx11extras -skip qtxmlpatterns
> -no-feature-TEXTHTMLPARSER -no-feature-TEXTODFWRITER -no-feature-CSSPARSER
> -no-feature-DRAGANDDROP -no-feature-SESSIONMANAGER -no-feature-SHORTCUT
-no-feature-ACTION -no-feature-DOM
-no-feature-ITEMVIEWS -no-feature-DIRMODEL
> -no-feature-STANDARDITEMMODEL -no-feature-PROXYMODEL
> -no-feature-STRINGLISTMODEL -no-feature-LISTVIEW -no-feature-TABLEVIEW
-no-feature-TREEVIEW -no-feature-DATAWIDGETMAPPER
> -no-feature-COLUMNVIEW -no-feature-MOVIE -no-feature-IMAGEFORMAT_PPM
> -no-feature-IMAGEFORMAT_XPM -no-feature-FREETYPE -no-feature-BIG_CODECS
-no-feature-ICONV -no-feature-FTP
> -no-feature-ACCESSIBILITY -no-feature-ANIMATION -no-feature-STATEMACHINE
-no-feature-GESTURES -no-feature-DBUS
> -no-feature-XMLSCHEMA-verbose
> It went down to 5.3 MB.5.3 MB was still too bit, so I went through the
features from qfeatures.txt, and
> did“-no-feature”for every single feature listed.  libQt5Core wouldn’t
compile without LIBRARY, SETTINGS and
> REGULAREXPRESSION, so I took the“-no-feature”out for those things.  Even
with all of that removed, libQt5Core.so.5.3.0
> was still4.3MBafterbeing stripped.  Thatwould have some things removed
though that we want.
> Is there any way to get Qt Core to compile smaller, like under 3MB?Am I
missing anything to
> skipor“-no-xyz”or“-nomake”or“-no-feature”?  Why is libQt5Core.so.5.3.0 so
much bigger than libQtCore4.so.4.8.4?
> We may just need to moveto 4.8.6 and leave it there instead of jumping
onto 5.x.
> Thanks,
> -Daniel
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

Interest mailing list
Interest at qt-project.org

More information about the Interest mailing list