GOARM!
One of the first things I looked at when checking out go for IPFS and Camlistore was how to cross-compile it to run on my Synology DS411j, which has an ARM v5 chip. Luckily it seems like I'm late enough to the game that go cross-compiling is now easy.
I rewrote my Mediawiki export utility in go, and can compile it for my Synology with 3 simple arguments to the normal build command:
env GOOS=linux GOARCH=arm GOARM=5 go build cmd/mwexport
Camlistore on ARMv5
Camlistore has its own build system (go run make.go
) which handles cross-compiling, but doesn't provide a way to pass GOARM
. I added this extra option and submitted a pull request to fix this. This let me to a permission problem on my laptop while running go run make.go -os linux -arch arm
:
mkdir /usr/lib/go/pkg/linux_arm: permission denied
There's probably a better way to solve this, but I got past it this way:
sudo mkdir /usr/lib/go/pkg/linux_arm
sudo chmod 777 /usr/lib/go/pkg/linux_arm
go run make.go -os linux -arch arm
sudo chown -R root:root /usr/lib/go/pkg/linux_arm
sudo chmod 755 /usr/lib/go/pkg/linux_arm
These binaries are working fine on my Synology. With the various annoyances I've had running Java, or neutered python, on my Synology, I'm enjoying being able to straight-up cross-compile something to an ARM binary.