3 ms·
Assuming you have an environment where you can build Go already (which basically means having a working local gcc -- it only needs to be able to produce code fo
by georgemcbay 14y ago
Assuming you have an environment where you can build Go already (which basically means having a working local gcc -- it only needs to be able to produce code for the system you will build the code on, it doesn't have to be a cross-compiler for the target system), it is pretty much as simple as defining those variables I mention in the blog post:
export GOOS=linux
export GOARCH=arm
export GOARM=5
Then build the Go compiler tools using the src/make.bash (.bat on Windows) script that comes with the Go source code. That should build the Go compiler for that platform and stick it within your GOROOT bin directory.
Then prior to building anything you're going to put on the chumby make sure those variables are defined so Go knows which compiler to use.
Dave Cheney's tools make this easy to set up for all the different targets but if you only have one non-local target, it is probably easier to just do it manually by setting the env vars and building the Go compiler again.
- stock_toaster 14y agoIf you use homebrew on osx, you can `brew install go --cross-compile-all` to get all of them built. Or `brew install go --cross-compile-common` to get the common ones (arm is in the common group).