Rustup: x86_64-unknown-freebsd does not come with rust-lld

Created on 9 May 2019  Â·  10Comments  Â·  Source: rust-lang/rustup

Problem

a (wasm based) project i'm trying to compile on FreeBSD is expecting rust-lld, but it doesn't exist.

Steps

  1. follow https://rustup.rs/ to install rustup on a FreeBSD
  2. Follow https://docs.joinplu.me/installation/with/source-code to compile Plume (this installs cargo-web)
  3. Fail compiling with the following error:
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 #
bug

Most helpful comment

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.

All 10 comments

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kornelski picture kornelski  Â·  3Comments

matthiaskrgr picture matthiaskrgr  Â·  3Comments

mcandre picture mcandre  Â·  4Comments

fenhl picture fenhl  Â·  4Comments

KasMA1990 picture KasMA1990  Â·  3Comments