Skip to content
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

rustc: Some small changes for the wasm32-wasip2 target #124858

Merged
merged 3 commits into from
May 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustc: Don't pass -fuse-ld=lld on wasm targets
This argument isn't necessary for WebAssembly targets since `wasm-ld` is
the only linker for the targets. Passing it otherwise interferes with
Clang's linker selection on `wasm32-wasip2` so avoid it altogether.
  • Loading branch information
alexcrichton committed May 4, 2024
commit 400e75494ab345e95125da2dd65433bacec2775a
8 changes: 7 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3127,7 +3127,13 @@ fn add_lld_args(

// 2. Implement the "linker flavor" part of this feature by asking `cc` to use some kind of
// `lld` as the linker.
cmd.arg("-fuse-ld=lld");
//
// Note that wasm targets skip this step since the only option there anyway
// is to use LLD but the `wasm32-wasip2` target relies on a wrapper around
// this, `wasm-component-ld`, which is overridden if this option is passed.
if !sess.target.is_like_wasm {
cmd.arg("-fuse-ld=lld");
}

if !flavor.is_gnu() {
// Tell clang to use a non-default LLD flavor.
Expand Down