Skip to content

Using -C lto=thin and -C no-prepopulate-passes at the same time for windows target , report link error: undefined symbol #125802

Open
@lxy19980601

Description

@lxy19980601

We compile hello.rs for x86_64-pc-windows-gnullvm then there is a link error: undefined symbol
rustc -C lto=thin -C no-prepopulate-passes --target=x86_64-pc-windows-gnullvm hello.rs

fn main() {
    println!("Hello world!");
}

The rustc version is rustc 1.80.0-nightly (867900499 2024-05-23)
The link error reproduces for target x86_64-pc-windows-gnu and x86_64-pc-windows-gnullvm
It seems that -C no-prepopulate-passes isn't compatible with -Clto.
Maybe we should report error that -C no-prepopulate-passes isn't compatible with -Clto?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.O-windows-gnuToolchain: GNU, Operating system: WindowsT-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