Bug 180625 - Link-Time-Optimizations could be used
Summary: Link-Time-Optimizations could be used
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Local Build
Hardware: PC Linux
: P2 Enhancement
Assignee: Nobody
Depends on:
Reported: 2017-12-09 13:26 PST by Walter Hüttenmeyer
Modified: 2021-05-20 14:17 PDT (History)
9 users (show)

See Also:

Patch to allow LTO (743 bytes, patch)
2017-12-09 13:26 PST, Walter Hüttenmeyer
no flags Details | Formatted Diff | Diff
Patch to allow -flto=n; tested against webkit-gtk-2.24.2 (607 bytes, patch)
2019-07-02 13:07 PDT, Walter Hüttenmeyer
walter.huettenmeyer: review+
walter.huettenmeyer: commit-queue?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Hüttenmeyer 2017-12-09 13:26:32 PST
Created attachment 328914 [details]
Patch to allow LTO

Compiling webkitgtk+-2.18.3 locally on an AMD64 machine, it will fail when using --flto=x --fuse-linker-plugin.
Only way to compile it without errors was to disable LTO.

I found a small patch on the gentoo forums here: https://forums.gentoo.org/viewtopic-t-1052716-start-0.html (credits to user costel78).
Patching the source with this allows me to compile it fine with LTO enabled.

Could you include this in upstream, if it seems worth?
Comment 1 Konstantin Tokarev 2019-03-27 07:18:26 PDT
FWIW, Mac port uses clang's ThinLTO since r243396
Comment 2 Walter Hüttenmeyer 2019-07-02 13:04:54 PDT
Hi Konstantin,

thank you for the info. On Linux it still won't compile with "-flto=n"
the attached patch does do the magic.

I do not know if any of the changes are in the correct and appropriate sections,
and even it's not included a statement like "well, you could do that without harming much" may do to include it in the gentoo tree until you decide on what to do with the patch.
Comment 3 Walter Hüttenmeyer 2019-07-02 13:07:24 PDT
Created attachment 373354 [details]
Patch to allow -flto=n; tested against webkit-gtk-2.24.2
Comment 4 Konstantin Tokarev 2019-07-02 13:16:57 PDT
Comment on attachment 373354 [details]
Patch to allow -flto=n; tested against webkit-gtk-2.24.2

View in context: https://bugs.webkit.org/attachment.cgi?id=373354&action=review

> b/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp   2016-01-14 21:25:52.000000000 +0100:30
> +#if __GNUC__ >= 5

We require GCC 7 now so this check is redundant