Problem
a (wasm based) project i'm trying to compile on FreeBSD is expecting rust-lld, but it doesn't exist.
Steps
error: linker `rust-lld` not found
|
= note: No such file or directory (os error 2)
error: aborting due to previous error
error: Could not compile `plume-front`.
To learn more, run the command again with --verbose.
error: build failed
Notes
Output of rustup --version: rustup 1.18.2 (a0bf3c9cb 2019-05-02)
Output of rustup show:
root@blog:/usr/local/src/Plume # rustup show
Default host: x86_64-unknown-freebsd
installed toolchains
--------------------
stable-x86_64-unknown-freebsd
nightly-2019-03-23-x86_64-unknown-freebsd
nightly-x86_64-unknown-freebsd
installed targets for active toolchain
--------------------------------------
wasm32-unknown-unknown
x86_64-unknown-freebsd
active toolchain
----------------
nightly-2019-03-23-x86_64-unknown-freebsd (overridden by '/usr/local/src/Plume/rust-toolchain')
rustc 1.35.0-nightly (cb2f34dc6 2019-03-22)
root@blog:/usr/local/src/Plume #
I imagine you need the llvm-tools-preview component installed. If the dependency on rust-lld directly is part of the project you're trying to build then it may be worth their while including that into their documentation.
It's also possible you may need cargo-binutils installing too, I'm not sure though.
Either way, I don't think this is directly a bug in rustup itself.
on my linux laptop i don't have llvm-tools-preview installed either…
…and neither do i have cargo-binutils installed.
so my assumption is that on linux, rust-lld is just part of the toolchain, whereas on freebsd, it's not.
it seems, i should open this issue upstream:
here's the CI build's configure for Linux:
and here's the configure for FreeBSD:
Aha, I apologise for my misunderstanding of the situation then. Good luck.
Was the process updated? It's FreeBSD which supports LLD linker in base system by default. Why Rust build lack that for FreeBSD? :o
Was the process updated? It's FreeBSD which supports LLD linker in base system by default. Why Rust build lack that for FreeBSD? :o
I'll try to get this fixed on FreeBSD side: https://reviews.freebsd.org/D23653
I just use RUSTFLAGS="-C linker=ld.lld90" (lld from our llvm packages) whenever rust-lld is required (i.e. both for wasm and embedded arm microcontrollers). We don't really need rust-lld. Would be nice if rustc auto detected system llds.
if that auto-detection were possible, would that mean that we could promote FreeBSD to First-Tier platform?
I don't think the linker is the reason it's not first tier.
Most helpful comment
I just use
RUSTFLAGS="-C linker=ld.lld90"(lld from our llvm packages) wheneverrust-lldis required (i.e. both for wasm and embedded arm microcontrollers). We don't really needrust-lld. Would be nice if rustc auto detected system llds.