Skip to content

Instantly share code, notes, and snippets.

@sthorne
Created February 28, 2015 22:29
Show Gist options
  • Save sthorne/6f7090c529182ce91948 to your computer and use it in GitHub Desktop.
Save sthorne/6f7090c529182ce91948 to your computer and use it in GitHub Desktop.
Cross Compile Go
# This must be run from GOROOT
cd /usr/local/go/src
# Options
# darwin_386
# darwin_amd64
# freebsd_386
# freebsd_amd64
# linux_386
# linux_amd64
# linux_arm
# windows_386
# windows_amd64
# Linux 32
sudo GOOS=linux GOARCH=386 CGO_ENABLED=0 /usr/local/go/src/make.bash --no-clean
# Linux 64
sudo GOOS=linux GOARCH=amd64 CGO_ENABLED=0 /usr/local/go/src/make.bash --no-clean
# Linux ARM
sudo GOOS=linux GOARCH=arm CGO_ENABLED=0 /usr/local/go/src/make.bash --no-clean
# Windows 32
sudo GOOS=windows GOARCH=386 CGO_ENABLED=0 /usr/local/go/src/make.bash --no-clean
# Windows 64
sudo GOOS=windows GOARCH=amd64 CGO_ENABLED=0 /usr/local/go/src/make.bash --no-clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment