[Interest] building Qt 5.9 on Linux - clang or GCC?

Allan Sandfeld Jensen kde at carewolf.com
Mon Dec 18 15:55:09 CET 2017


On Montag, 18. Dezember 2017 15:38:20 CET René J.V. Bertin wrote:
> Hi,
> 
> Not to start a flame war, but are there clear differences between building
> Qt (on Linux) with clang (5.0) vs. GCC (7.2) that make the one or the other
> a better choice for certain domains of application?
> 
> Link-time optimisation is out of the question (too costly on my hardware,
> which is also why I can't really do a comparison). I'm not expecting much
> performance difference, so build time (cum memory requirements) and
> installation size can tip the scales for me.
> 
It is pretty much the same. I would recommend gcc because that is default on 
Linux and the most likely to compile warning free and support most 
configurations. Clang works almost entirely the same everywhere, but sometimes 
it has different warnings that breaks developer builds or peculiar bugs on in 
some obscure corner-case that causes a compile error in one late module 
somewhere (not that gcc don't have those too, but being default, we have 
already had to work around those).

Btw. LTO isn't that insane these days, In shared Qt builds we don't not let 
the LTO work across shared libraries, so it is only performed within each 
library, which gives almost all the benefits and none of the problems. 
Especially if you want smaller binaries ltcg + optimize_size gives great 
results.

'Allan




More information about the Interest mailing list