Closed
Description
Since #48125, a LLD binary is shipped with Rust. According to this comment, it can be used by specifying "linker-flavor": "ld.lld"
in target specs. However, this fails when the sysroot is changed, for example when compiling for a custom target using xargo
. The following error occurs:
error: linker `lld` not found
|
= note: No such file or directory (os error 2)
The problem is that the lld
binary is part of the host sysroot (e.g. in .rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin
on linux), so Rust does not find it when the sysroot is changed.