Bug 235477 - What's going on with LTO_MODE?
Summary: What's going on with LTO_MODE?
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CMake (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-22 06:37 PST by Michael Catanzaro
Modified: 2022-01-29 06:38 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2022-01-22 06:37:09 PST
I notice there is an LTO_MODE CMake variable that causes ld.lld to be selected in OptionsCommon.cmake, but this makes me nervous because I don't think anything ever sets LTO_MODE. It's not a public variable, either. How is it supposed to be used?

It adds its own manual -flto=${LTO_MODE} flags that would surely be redundant with the -flto=auto flags that are already used by distros that enable LTO. We might want to think about how this is supposed to work. I suppose it's OK so long as (a) nothing sets it except the end user, and (b) nothing assumes that it can be used to determine whether LTO is actually enabled. But assuming that LTO_MODE=OFF means no LTO seems very tempting. Maybe we could rename it to something like ADD_WEBKIT_LTO_FLAGS to be more clear that it's not the only way that LTO gets enabled?
Comment 1 Radar WebKit Bug Importer 2022-01-29 06:38:16 PST
<rdar://problem/88224082>