I want to write Rust code on my computer (x86_64, Ubuntu 14.04) and produce arm executables. I found hints on the internet, but not a concise set of instructions on what to do. So I wrote them down exactly:
apt-get install g++-arm-linux-gnueabihf
git clone https://github.com/mozilla/rust.git
mkdir rust/build-cross
cd rust/build-cross
../configure --target=arm-unknown-linux-gnueabihf --prefix=$HOME/local/rust-cross
make -j8 && make install
Invoke it like this:
PATH=$HOME/local/rust-cross:$PATH rustc -C linker=/usr/bin/arm-linux-gnueabihf-gcc -C target=arm-unknown-linux-gnueabihf test.rs
Thanks! I built successfully using this but I get this when testing out the rust-cross:
whereas
rustc helloworld.rs
(not./rustc
) builds it correctly, but for the current intel architecture.Any thoughts?