Skip to content

Let custom codegen backends opt out of LTO #68349

Open
@bjorn3

Description

@bjorn3

For example cg_clif doesn't support LTO. Unfortunately enabling LTO makes the linker code always omit object files, so attempting to use -Clto=yes will result in a linker error. It is not practical to just not pass -Clto=yes, as many crates enable it in their Cargo.toml. I would like to be able to make cg_clif tell rustc that LTO should be disabled, even when -Clto=yes is passed. I think there should still be a warning though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-craneliftThings relevant to the [future] cranelift backendA-linkageArea: linking into static, shared libraries and binariesC-feature-requestCategory: A feature request, i.e: not implemented / a PR.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