Skip to content

Cross language LTO broken for crates with build.rs #115640

Open
@dragostis

Description

@dragostis

On aarch64-apple-darwin, Rust 1.72 this fails:

cargo new --lib foo && cd foo && echo "fn main() {}" > build.rs && RUSTFLAGS="-Clinker-plugin-lto" cargo build

with ld: unknown option: -plugin-opt=O0.

Building without build.rs works as intended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LTOArea: Link-time optimization (LTO)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions