[Interest] Size of libQt5Core in 5.3
Peter Kümmel
syntheticpp at gmx.net
Mon May 12 10:47:44 CEST 2014
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 package).
http://qt-project.org/doc/qt-4.8/fine-tuning-features.html
(Seems documentation got lost in Qt5)
Peter
>
> 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-CONCURRENT
> -no-feature-DRAGANDDROP -no-feature-SESSIONMANAGER -no-feature-SHORTCUT -no-feature-ACTION -no-feature-DOM
> -no-feature-FILESYSTEMMODEL -no-feature-FILESYSTEMWATCHER -no-feature-ITEMVIEWS -no-feature-DIRMODEL
> -no-feature-STANDARDITEMMODEL -no-feature-PROXYMODEL -no-feature-SORTFILTERPROXYMODEL -no-feature-IDENTITYPROXYMODEL
> -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_XBM
> -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
>
More information about the Interest
mailing list