InBetweenNames / gentooLTO

A Gentoo Portage configuration for building with -O3, Graphite, and LTO optimizations
GNU General Public License v2.0
572 stars 96 forks source link

Qtwebengine LTO #254

Open barolo opened 5 years ago

barolo commented 5 years ago

It doesn't seem to respect c/ld/flags passed even with _FLAG_O_MATIC_ECLASS=1. At least with gcc, with clang it just fails at gn linkinking. Is there any way to force it and actually test LTO?

elsandosgrande commented 5 years ago

Soooo, it strips the flags, just like GCC?

barolo commented 5 years ago

This is still an issue, having it in workarounds is pointless as everything gets stripped when passed to ninja.

elsandosgrande commented 5 years ago

Wait, what is "c/ld/flags" even? Also, you mentioned some sort of failure? Could you please share the compilation output with us?

barolo commented 5 years ago

@elsandosgrande Let's leave it at "it strips the flags, just like GCC"

jiblime commented 5 years ago
echo "dev-qt/qtwebengine qtwebengine.conf" >> /etc/portage/package.env
echo 'EXTRA_ECONF="--use-lto --enable-lto"' >> /etc/portage/env/qtwebengine.conf

Possibly the last line would work from looking at ebuild $(equery w qtwebengine) unpack && grep -rsi '\-lto' /var/tmp/portage/dev-qt/qtwebengine-5.12.5. But I couldn't find anything regarding flag filtering.

You can also try: echo -e 'export CFLAGS="${CFLAGS}"\nexport CXXFLAGS="${CFLAGS}"\nexport LDFLAGS="${LDFLAGS}"' >> /etc/portage/env/qtwebengine.conf But it didn't seem to pass through for parts of the build. Either way there is no flag-o-matic eclass in the ebuild so I believe using ltoize's flagomatic flag would only bypass the filter in ltoworkarounds.conf.

barolo commented 5 years ago

@jiblime Nope, no go, it builds GN tools first with proper, requested flags [ lto and such ] then when going into main build strips them

elsandosgrande commented 5 years ago
  1. I now know what you were referring to by "c/ld/flags/".
  2. That is very strange...
elsandosgrande commented 4 years ago

@barolo After looking at emerge --info qtwebengine, it looks like it does not strip flags:

=================================================================
                        Package Settings
=================================================================

dev-qt/qtwebengine-5.13.2::gentoo was built with the following:
USE="alsa designer pulseaudio system-ffmpeg system-icu widgets -bindist -debug -jumbo-build -pax_kernel -test" ABI_X86="(64)"
CFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -ftracer -fsched2-use-superblocks -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra -Wl,-O1 -Wl,--as-needed -Wl,-O3"
CXXFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -ftracer -fsched2-use-superblocks -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra -Wl,-O1 -Wl,--as-needed -Wl,-O3"
FEATURES="multilib-strict distlocks userfetch config-protect-if-modified news sfperms ebuild-locks unmerge-orphans merge-sync pid-sandbox binpkg-logs binpkg-dostrip sandbox ipc-sandbox parallel-fetch userpriv assume-digests preserve-libs xattr strict protect-owned network-sandbox usersync binpkg-docompress unknown-features-warn usersandbox unmerge-logs fixlafiles"
LDFLAGS="-O3 -march=bdver4 -pipe -pthread -fira-hoist-pressure -fira-loop-pressure -fbranch-target-load-optimize -fweb -ftracer -fsched2-use-superblocks -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -fuse-linker-plugin -fuse-ld=bfd -Wall -Wextra -Wl,-O1 -Wl,--as-needed -Wl,-O3"

Why no -flto then? Well... Here's an excerpt from ltoworkarounds.conf:

dev-qt/qtwebengine *FLAGS-=-flto* #needs retest

Edit

I shall now proceed to do what I did with Mesa.

barolo commented 4 years ago

@elsandosgrande Interesting, lemme do mine. Be back in a a bit

barolo commented 4 years ago

@elsandosgrande

Just tested it, emerge lies to you [ or at least doesn't know the whole truth ], during compilation it gets stripped and compiled with -O2 and -mtune=generic, some of it with -O3

Look at it during compilation, don't trust what emerge --info says

jiblime commented 4 years ago

Since QtWebEngine is packages cobbled together, there are multiple configure files, I believed suffixed .pro for qmake, that you would need to change, then test to make sure it works.

It will be painful, and using link time optimization will make compiling QtWebEngine much longer.

Extra notes: I hate how long compiling it takes. I tried -O1 instead, and -O2 will take the same amount of time. Letting others know so you don't waste your time like I did.

elsandosgrande commented 4 years ago

Terrific... Well, since it truly does take two eras to compile (about as long as LibreOffice, if not longer), I shall give up hope for now, as I am certainly not the one with the expansive time budget and powerful processor to work on patching the various configuration files.

@jiblime Regarding your remark in the standalone sentence/second paragraph, I don't even want to imagine how long QtWebengine would take if Mesa goes from ~12h, give or take a few hours, to two days. Still, I would try it just because.

barolo commented 4 years ago

@elsandosgrande Holy shit, what are you compiling this on? What's your RAM? jumbo use flag cuts chromium and qtwebengine compile times significantly, I've noticed that you have it disabled. Not sure what's its effect on RAM usage though, I don't care since I have enough of it to fit everything in it.