[Interest] Doing a leanest-possible QtWebEngine build

René J.V. Bertin rjvbertin at gmail.com
Thu Dec 29 12:17:39 CET 2016


On Thursday December 29 2016 10:23:05 Allan Sandfeld Jensen wrote:

Hi,

>QtWebEngine is mostly not built with QMAKE but with Chromium's GYP. And it 
>doesn't use the QMAKE CFLAGS directly. We have a switch to change GYP to use -

Maybe not directly, but the flags used for building QtBase do end up in the QtWebEngine build one way or another, and that must be via QMake as that's the build "entry point".

I would hope that this would also make it possible to override those default compiler flags, presuming that QMake allows such a thing to begin with.

I don't mind if this means having to make a local copy of some .qmake or mkspecs file, in particular the one that stores the compiler options used during the QtBase build.

>Os instead of -O2 however. Just invoke qmake in qtwebengine with 
>WEBENGiNE_CONFIG+=reduce_binary_size (this is also default for embedded 
>builds).

That helps a lot already, provided that that particular -Os flag is *appended* to whatever may be set.
I've looked for a list of all existing WEBENGINE_CONFIG options, but haven't found it yet. Is there one to disable adding debug information?

Re: debug info: I can now confirm that it's this what made the link step fail through memory exhaustion. What I did (but cannot make a habit) is doing a search&replace of all -O[23] -> -Os and '-g ' -> '' in all relevant files in a fresh out-of-source build directory after running QMake.
That also gave me about a 10x reduction in size of the build directory in the end, from over 20Gb uncompressed (or 6Gb with Zip level 8 compression) to a bit under 2Gb (with lz4 compression on ZFS).

R.



More information about the Interest mailing list