Skip to content

bootstrap: Pass correct linker-flavor flag for wasm targets #139375

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

Closed
wants to merge 1 commit into from

Conversation

12101111
Copy link
Contributor

@12101111 12101111 commented Apr 4, 2025

Fix: #139372

@rustbot
Copy link
Collaborator

rustbot commented Apr 4, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 4, 2025
args.push("-Clinker-flavor=em-cc".to_string());
} else {
args.push("-Clinker-flavor=wasm-lld-cc".to_string());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively you could omit the -Clinker-flavor arg entirely on wasm given that wasm already uses lld by default (there is no other wasm linker that I know of).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use -Zlinker-features instead of the flavor, I messed this up. I fixed it in #139378.

LinkerFlavor::WasmLld is the only supported link flavor for wasm.
@Kobzol
Copy link
Contributor

Kobzol commented Apr 4, 2025

To provide a bit more context; I would really like to avoid hardcoding any flavors in bootstrap, that's fragile and flavors might be removed in the future anyway. With -Zlinker-features, we should be able to enable LLD regardless of the actual flavor, which is what #139378 does. I think that is a more general fix.

Thank you for looking into this though, and for reporting the issue!

@bors bors closed this in bad6b7b Apr 5, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 5, 2025
Rollup merge of rust-lang#139378 - Kobzol:bootstrap-use-lld-fix, r=petrochenkov

Use target-agnostic LLD flags in bootstrap for `use-lld`

[Before](rust-lang#135001), I hardcoded LLD flags that pretty much only worked on GNU. The right way is to use `-Zlinker-features` instead though.

I *think* that this should also make this work on Windows mingw, and thus `@petrochenkov's` workaround is no longer necessary.

Fixes: rust-lang#139372
Closes: rust-lang#139375

r? `@lqd`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to build wasm32-unknown-unknown target with use-lld=true
5 participants