Skip to content

Add support for rust.lto=off to bootstrap for faster dev builds #107202

Closed
@the8472

Description

@the8472

Currently bootstrap supports LTO flavors thin-local (default), thin and fat. Adding the option to completely disable it can speed up develop cycles, especially with incremental compilation. See this Zulip thread for benchmarks.

/// LTO mode used for compiling rustc itself.
#[derive(Default, Clone)]
pub enum RustcLto {
#[default]
ThinLocal,
Thin,
Fat,
}

When LTO is disabled the standard library still has to be built with -Cembed-bitcode=on so that it can be used by other crates which enable LTO.

Disabling should become the default for the library and compiler profile templates.

Metadata

Metadata

Labels

T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions