Skip to content

bootstrap: support building rustc with monolithic lto #49175

Closed
@matthiaskrgr

Description

@matthiaskrgr

I would like to be able to locally build rustc with monolithic lto enabled (-C lto) however it seems that using lto=true in src/Carto.toml does not have any effect.

RUSTFLAGS="-C lto" ./x.py build fails as well

Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling std v0.0.0 (file:///home/matthias/RUST/rust_build/src/libstd)
error: cannot prefer dynamic linking when performing LTO
note: only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO
error: aborting due to previous error
error: Could not compile `std`.

Edit: related: #49180

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions