Skip to content

Instantly share code, notes, and snippets.

@piec
Forked from mcpherrinm/instructions.md
Last active August 29, 2015 14:13
Show Gist options
  • Save piec/b71b20df6d6abfaca7ed to your computer and use it in GitHub Desktop.
Save piec/b71b20df6d6abfaca7ed to your computer and use it in GitHub Desktop.

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:

export PATH=$HOME/local/rust-cross/bin
export LD_LIBRARY_PATH=$HOME/local/rust-cross/lib
$HOME/local/rust-cross/bin/rustc -C linker=/usr/bin/arm-linux-gnueabihf-gcc --target=arm-unknown-linux-gnueabihf test.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment