Do not use fat lto for default opt build
Categories
(Firefox Build System :: General, task)
Tracking
(Not tracked)
People
(Reporter: sergesanspaille, Assigned: sergesanspaille)
Details
Attachments
(2 files)
As showcased by https://treeherder.mozilla.org/jobs?repo=try&revision=7ba2abd2b69b3102c631a30e287f52e9c6c4befb&selectedTaskRun=P9I07KH9SEGLbE8DDZub1g.0 the default opt build (without any kind of lto asked for by the user) is cpu bound by gkrust, probably because of single-threaded full lto being used. We should rationalize our use of lto there.
Assignee | ||
Updated•12 days ago
|
Assignee | ||
Comment 1•12 days ago
|
||
Rust has four LTO modes:
- off, 2. local-thin, 3. thin, 4. fat
With the extra possibility to pass a linker plugin for cross language optimization.
When passing -Clto, fat is assumed. When passing no lto option, thin is used
moz.configure controls LTO through --enable-lto=[cross,thin,full]*. The
possible setups are:
a. off, b. cross,thin, c. cross,full, d. thin, e. full
Current matching (including the rust.mk changes) is:
--enable-lto=off => -Clto => fat # bad!
--enable-lto=cross,thin => -Clto => fat # bad!
--enable-lto=cross,full => -Clto=fat => fat
--enable-lto=thin => -Clto => fat # bad!
--enable-lto=full => -Clto => fat
plus in developer mode or rust debug mode, we where using the default,
aka thin.
This patch implies the more legit:
--enable-lto=off => -Clto=thin => thin
--enable-lto=cross,thin => -Clto=thin => thin
--enable-lto=cross,full => -Clto=fat => fat
--enable-lto=thin => -Clto => thin
--enable-lto=full => -Clto=fat => fat
The impact is a more predictable behavior based on options being passed
to configure, a single place to handle the option (less rust.mk hooks),
and faster opt build (because we don't use fat lto there).
And in debug mode, we now use either thin-local lto or no lto,
respectively if --enable-lto is used or not.
Updated•12 days ago
|
Updated•7 days ago
|
Updated•6 days ago
|
Assignee | ||
Comment 2•3 days ago
|
||
Description
•