Skip to content

Instantly share code, notes, and snippets.

@zenhob
Created May 31, 2014 22:52
Show Gist options
  • Save zenhob/f70bbb802e3e6729a1a6 to your computer and use it in GitHub Desktop.
Save zenhob/f70bbb802e3e6729a1a6 to your computer and use it in GitHub Desktop.
Bulding Go binaries for Raspberry Pi

To build a binary that will run on the Raspberry Pi, you need to have a Go cross compiler and enable it when building the executable.

To build the cross compiler for Linux/ARM (you only need to do this once):

cd /usr/local/go/src
sudo GOOS=linux GOARCH=arm ./make.bash --no-clean

Once you've done that, you can build a binary for Raspberry Pi:

env GOOS=linux GOARCH=arm go build -o <target_executable> <source_file>

source: http://stackoverflow.com/questions/12168873/cross-compile-go-on-osx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment