Open Bug 1963571 Opened 12 days ago Updated 3 days ago

Do not use fat lto for default opt build

Categories

(Firefox Build System :: General, task)

task

Tracking

(Not tracked)

ASSIGNED

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.

Severity: -- → S4

Rust has four LTO modes:

  1. 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.

Assignee: nobody → sguelton
Status: NEW → ASSIGNED
Attachment #9484536 - Attachment description: Bug 1963571 - Harmonize LTO usage for rust crates r=glandium → Bug 1963571 - Default to thin LTO for rust crates r=glandium
Attachment #9484536 - Attachment description: Bug 1963571 - Default to thin LTO for rust crates r=glandium → Bug 1963571 - Default to thin LTO for rust crates r=glandium!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: