Martin Ellison
Martin Ellison

Reputation: 1343

rust-lld is missing, how do I install it?

When I try compiling for webasm, I get an error “rust-lld not found”. What should I do?

I have been following the instructions in the rust webasm book with a dummy program, and everything worked up till the initial compile, which failed with this error which apparently means that some linker has not been installed.

My context is Ubuntu on an ARM 64 bit box.

Upvotes: 8

Views: 6120

Answers (2)

xiaguangbo
xiaguangbo

Reputation: 115

x86_64 have realese rust-lld, arm、riscv currently no have, need add.

apt install lld
mkdir ~/.rustup/toolchains/stable-riscv64gc-unknown-linux-gnu/lib/rustlib/riscv64gc-unknown-linux-gnu/bin
ln /usr/lib/llvm-16/bin/lld ~/.rustup/toolchains/stable-riscv64gc-unknown-linux-gnu/lib/rustlib/riscv64gc-unknown-linux-gnu/bin/rust-lld

Upvotes: 0

hellow
hellow

Reputation: 13450

rust-lld is in a non $PATH-path which means you have to use either the full path or add the path to your $PATH environment variable.

In my case it can be found in ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-lld

Of course the path may vary by architecture and version.

Upvotes: 8

Related Questions