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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lxy19980601 opened this issue May 31, 2024 · 1 comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. O-windows-gnu Toolchain: GNU, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lxy19980601
Copy link
Contributor

lxy19980601 commented May 31, 2024

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?

@lxy19980601 lxy19980601 added the C-bug Category: This is a bug. label May 31, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 31, 2024
@jieyouxu jieyouxu added A-linkage Area: linking into static, shared libraries and binaries O-windows-gnu Toolchain: GNU, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 4, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 17, 2024
@Noratrieb
Copy link
Member

maybe #129079 helped here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. O-windows-gnu Toolchain: GNU, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants