Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#61381 - [qt]Consider building Qt with LTCG

Attached to Project: Arch Linux
Opened by Mark (markg85) - Sunday, 13 January 2019, 15:08 GMT
Last edited by Antonio Rojas (arojas) - Tuesday, 10 December 2019, 18:32 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Hi,

This article: http://blog.qt.io/blog/2019/01/02/qt-applications-lto/ triggered me into making this feature request.
It should give substantial package size decreases and performance improvements.

How much both wins are is unclear for dynamic builds. Just that there are wins.
All packages that rely on Qt do likely have to be rebuild for this though.

It might be too much effort for too little gain. It would be nice to have it, but not a necessity.

Cheers,
Mark
This task depends upon

Closed by  Antonio Rojas (arojas)
Tuesday, 10 December 2019, 18:32 GMT
Reason for closing:  Won't implement
Comment by Eli Schwartz (eschwartz) - Sunday, 13 January 2019, 16:50 GMT
What is so special about qt5 versus adding -flto to your makepkg.conf C(XX)FLAGS?
Comment by Mark (markg85) - Sunday, 13 January 2019, 16:59 GMT
It's a difference in responsibility.
If added to the Qt packet in the distribution it gets freely applied to everything you folks compile that depends on Qt.
If i do it locally when compiling an application it's only for me and only for that one application.

As for the C(XX)FLAGS, i'm not sure what Qt would do if that is in the flags, but "-ltcg" is not provided in the Qt configure.
Sorry, i should have mentioned this. The Qt configure needs "-ltcg" and "-reduce-relocations". The later is there already [1], the former still misses.

[1] https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/qt5-base
Comment by Eli Schwartz (eschwartz) - Tuesday, 15 January 2019, 06:44 GMT
> It's a difference in responsibility.
> If added to the Qt packet in the distribution it gets freely applied to everything you folks compile that depends on Qt.
> If i do it locally when compiling an application it's only for me and only for that one application.

Right, and when using it in CXXFLAGS this applies to all applications whether they happen to use qmake or not. So again, what does this option do that could not be duplicated on a more generic level?
Comment by Mark (markg85) - Tuesday, 15 January 2019, 08:35 GMT
I don't know if passing that in CXXFLAGS will have the exact same behavior as providing -ltcg in Qt.
It's a configure thin on the Qt side, it might not be set if -ltcg is provided or might not even work if it is provided in CXXFLAGS but isn't in configure.

Then again, i could be totally wrong and it could magically work just fine.
You'd have to test if that works :)
Comment by Jake Kreiger (Magali75) - Tuesday, 15 January 2019, 13:38 GMT
Adding -flto or -ltcg in global CXXFLAGS may cause various build issues as certainly not every project support those. If Qt upstream explicitly states it supports -ltcg then adding it is a no-brainier. Some packages like python or firefox are being build with LTO and even PGO and nobody required to build the whole world with those instead.
Comment by Mark (markg85) - Tuesday, 15 January 2019, 14:21 GMT
Qt supports it, otherwise the flag wouldn't be there in the first place.
But lets not go back and forth more then we already have done. Putting it in CXXFLAGS would seem adventurous for arch maintainers. Please consider patching up the Qt PKGBUILD file with -ltcg or close this issue if the maintainer has no interest in doing so.
Comment by Antonio Rojas (arojas) - Tuesday, 10 December 2019, 18:32 GMT
According to some comments from upstream devs, this can cause issues with the few static libraries that Qt ships. And in general it doesn't seem to give a large improvement for shared libraries. We can reevaluate for Qt6.

Loading...