I am trying to run cargo
on a RockPro64 (aarch64). I installed the toolchain using curl https://sh.rustup.rs -sSf | sh
with the output:
info: default toolchain set to 'stable-aarch64-unknown-linux-gnu'
stable-aarch64-unknown-linux-gnu installed - (error reading rustc version)
Rust is installed now. Great!
The toolchain seems to be correct as this Reddit post suggests. However, when running cargo
(or any other bin in $HOME/.cargo/bin/cargo
), I get this error:
error: command failed: 'cargo': No such file or directory (os error 2)
I tried to investigate further after following Rust musl Docker image cannot find Cargo without success. Here is the output of ldd $HOME/.cargo/bin/cargo
:
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xf6cc7000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xf6cb1000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xf6c8d000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xf6c15000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xf6c02000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xf6b14000)
/lib/ld-linux-armhf.so.3 (0xf7508000)
And the output of strace -f -e trace=execve cargo
:
execve("/home/alexandre/.cargo/bin/cargo", ["cargo"], [/* 15 vars */]) = 0
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0xab460186} ---
syscall_397(0, 0, 0, 0xfff, 0, 0x5) = -1 (errno 38)
execve("/home/alexandre/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin/cargo", ["/home/alexandre/.rustup/toolchai"...], [/* 20 vars */]) = -1 ENOENT (No such file or directory)
error: command failed: 'cargo': No such file or directory (os error 2)
+++ exited with 1 +++
Is this the correct toolchain or am I missing something?