Hey all,
I've been playing around with cross compiling CGO enabled (and C dependent) programs to Android. Building for ARMv7 (i.e. CC=arm-linux-androideabi-gcc GOOS=android GOARCH=arm GOARM=7 CGO_ENABLED=1) works perfectly, dependencies and everything and I can successfully run the programs on my Nexus. However, when I wanted to extend cross compilation to Android x86 or MIPS, I'm getting peculiar errors.
Building on x86 (i.e. CC=i686-linux-android-gcc GOOS=android GOARCH=386 CGO_ENABLED=1), I get a failure when Go is trying to build the runtime package:
# runtime
/usr/local/go/src/runtime/print1_write_android.go:101: undefined: sockaddr_un
/usr/local/go/src/runtime/print1_write_android.go:105: undefined: _AF_UNIX
/usr/local/go/src/runtime/print1_write_android.go:112: undefined: _AF_UNIX
/usr/local/go/src/runtime/print1_write_android.go:112: undefined: _SOCK_DGRAM
/usr/local/go/src/runtime/print1_write_android.go:119: invalid expression unsafe.Sizeof(logdAddr)
Building on MIPS (i.e. CC=mipsel-linux-android-gcc GOOS=android GOARCH=mips CGO_ENABLED=1), I get a completely different issue, that I thought Go 1.5 resolved after switching to pure Go:
go build runtime: android/mips must be bootstrapped using make.bash
I've yet to work my way towards the 64 bit platform, thought I'd throw this out if somebody has any ideas or pointers :)
Thanks,
Peter