Skip to content

Instantly share code, notes, and snippets.

@schemacs
Forked from martinsp/rust_for_rpi.md
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schemacs/5d12c231df05beed4c13 to your computer and use it in GitHub Desktop.
Save schemacs/5d12c231df05beed4c13 to your computer and use it in GitHub Desktop.

Howto build a rust compiler for the Raspberry Pi on Debian 7.1 (wheezy)

# additional information: http://stackoverflow.com/questions/19162072/installing-raspberry-pi-cross-compiler/19269715#19269715
sudo apt-get install -y file curl wget git build-essential python-dev
test `uname -m` = x86_64 && sudo apt-get install -y ia32-libs
git clone https://github.com/raspberrypi/tools.git
export PATH=$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin:$PATH
git clone http://github.com/mozilla/rust.git
cd rust
./configure --target=arm-unknown-linux-gnueabihf
make
sudo make install
# if compiling without '-Z lto' then running on Raspberry Pi gives error: Illegal instruction
rustc --target arm-unknown-linux-gnueabihf -C linker=arm-linux-gnueabihf-g++ -Z lto <source files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment