Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 602486 - qt5-build.eclass: add gold, lto, pch USE flags
Summary: qt5-build.eclass: add gold, lto, pch USE flags
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Low enhancement (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-13 00:24 UTC by Denis Kaganovich
Modified: 2016-12-13 23:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
useflags: gold, pch, lto (qt5-build-nogold.patch,1.22 KB, patch)
2016-12-13 00:28 UTC, Denis Kaganovich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Kaganovich 2016-12-13 00:24:02 UTC
qt5-build.eclass not conform simple Gentoo style without reason (confoming is trivial). Main problem - it keep gold auto default (and can breaks system-wide LDFLAGS) - this can be "gold" useflag. Also I see 2 more similar things (but less critical) - useflags "pch" and "lto". This is normal to keep this things configurable without tricks and hacks. Next I will post trivial patch to make it more easy ;)

Reproducible: Always
Comment 1 Denis Kaganovich 2016-12-13 00:28:17 UTC
Created attachment 456026 [details, diff]
useflags: gold, pch, lto

Tested with 5.6.2
Comment 2 Denis Kaganovich 2016-12-13 00:50:43 UTC
PS I am sorry to not editing comments in patch - this is night overhead. And there are ld flag for trap to packages vs gold: -Wl,--sort-section=alignment - previous 1 or 2 episodes was parallel to issues for exotic targets, so it is at least good test for package normalization. Even I can suggest this flag to Gentoo defaults (with filtering on USE=gold)) - I unsure about performance benefits, but there are good filter against Gold silent auto-use.
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2016-12-13 03:36:39 UTC
Let's see...

*gold: I might consider this, but I don't think it's as easy as your patch seems to suggests, unless the build system changed behavior recently. OTOH, I don't see why anyone would turn this off (if gold is installed and working; if not, it's automatically disabled anyway), and even then, they can add -fuse-ld=bfd to their flags, like any other compiler/linker flags... do we have a USE flag for every compiler flag that upstream uses by default?

*lto: same as above, why using a USE flag instead of CXXFLAGS/LDFLAGS? Are we going to add USE=lto to every package in tree now?

*pch: what's the benefit? I measured building Qt with and without PCH in the early Qt5 days, and the difference was insignificant. Moreover, PCH are known to cause issues on some architectures, so a pch USE flag would only be a maintenance headache.

And last but not least, I don't want the number of USE flags on all Qt modules to explode, just to add some obscure flags that most users won't care about. Not everything needs to be exposed as a USE flag.
Comment 4 Denis Kaganovich 2016-12-13 23:12:31 UTC
gold: it just working. Again: I use -Wl,--sort-section=alignment in ldflags. It breaks gold build (not supported by gold). And works fine system-wide (2 lifetime found exclusions was fixed by others year(s) ago - I remember udev). Now I have 5.6 on one desktop & 5.7 on other - built with standard ld and this flag. No problems.

PCH. I start to use PCH only small time ago, just to speedup c++ build (most benefits I get to build boost + ceph - ceph build very slow). It is not too crytical, but simple flag is good option.

LTO. System-wide LTO is very selective and build with universal options like -ffat-lto-objects (probably). Some packages don't want to build, etc. So, if upstream developers control special case for package, this is good alternative to keep useflag on this packages and just set system-wide without special care and pain.

But primary subject is gold. Others - just "easy same". Also at least one package (I forget what) was fixed vs gold by bug from alpha or power target users - it breaks it. So, using gold by default is not recommended. Even without my "special strange LDFLAGS".