Open gyakovlev opened 4 years ago
Linker configured during Rust compilation is not meant to propagate to the final binary. AFAIK if you want to change default linker you should patch the spec file or use Cargo configuration file.
I also have the linker issue when compiling for wasm32-wasi
on powerpc64le-unknown-linux-gnu
, where rust-lld
can't be found. Forcing the use of /bin/lld
from LLVM seems to work fine. But the PPC64LE port seems to not have rust-lld
, whereas x86_64-unknown-linux-gnu
does. Is this intentional?
rust for gentoo linux (the one we ship in official repositories)
here's how we configure wasm target:
but it still looks for rust-lld for that target by default.
not sure when it started to happen, but it was working as expected before.
rustc -Z unstable-options --target=wasm32-unknown-unknown --print target-spec-json
for some reason target spec still lists
rust-lld
as preferred linkerYes, there are ways to mitigate that, like
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER=lld
orRUSTFLAGS="-C linker=/usr/bin/lld
lld is system installed and provides the following files
if we build using bundled llvm and lld, everything works as expected ofc.
full config.toml, happens on x86_64 as well, so powerpc being primay is irrelevant.