[EDIT]
Hi there !
Thanks to the advices of @dirvine, I’ve finally managed to have something working, from the sources to the Raspberry Pi. Unfortunately…it is the “hello test”, not sn_node…yet
Here are the steps :
Update your environment :
sudo apt update
sudo apt install curl git binutils-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
Install Rust :
curl --proto ‘=https’ --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
Get the right ARM version of your Pi :
On your Pi:
uname -m
ex: armv6l (old version of Raspberry Pi)
Choose the right target for ARM compilation :
for arm < 7 :
rustup target add arm-unknown-linux-musleabihf
for armv7 :
rustup target add armv7-unknown-linux-musleabihf
Set Cargo configuration :
for arm < 7 :
cat >> ~/.cargo/config <<EOF
[target.arm-unknown-linux-musleabihf]
linker = “arm-linux-gnueabihf-gcc”
EOF
for armv7 :
cat >> ~/.cargo/config <<EOF
[target.armv7-unknown-linux-musleabihf]
linker = “arm-linux-gnueabihf-gcc”
EOF
Test your environment:
cargo new --bin hello
cd hello
for arm < 7 :
cargo build --target=arm-unknown-linux-musleabihf
for armv7 :
cargo build --target=armv7-unknown-linux-musleabihf
Check the result :
file target/arm*-unknown-linux-musleabihf/debug/hello
target/arm-unknown-linux-musleabihf/debug/hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, BuildID[sha1]=d9e1117d104e7e73497dca40dbb1cf75348bf558, with debug_info, not stripped
Once the environment is OK, let’s work on sn_node !
Download the sources:
git clone https://github.com/maidsafe/sn_node.git
Build :
cd sn_node
for arm < 7 :
CC=arm-linux-gnueabihf-gcc cargo build --release --target=arm-unknown-linux-musleabihf
for armv7 :
CC=arm-linux-gnueabihf-gcc cargo build --release --target=armv7-unknown-linux-musleabihf
In case of failure…
…watch for the next release
https://github.com/maidsafe/sn_node/releases
Strip your binary (optional)
arm-linux-gnueabihf-strip target/arm*-unknown-linux-musleabihf/release/sn_node