4 ms·
Thanks for starting the blog! As a fellow chumby enthusiast, I've been meaning to shoot you an email asking for more detail on your cross-compiled-go-for-chumb
by joe_bleau 14y ago
Thanks for starting the blog! As a fellow chumby enthusiast, I've been meaning to shoot you an email asking for more detail on your cross-compiled-go-for-chumby setup.
I had plans to drop some I2C eeprom chips on a pcengines ALIX x86 SBC (to gain a small amount of non-volatile storage without need to mount CF partitions read-write), but just haven't found the motivation to work through the software side. Problem solved!
- georgemcbay 14y agoAssuming 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).