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.
This commit is contained in:
parent
7a77108809
commit
400e75494a
1 changed files with 7 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue