I'm a big fan of Go language, and now I am trying to explore other architectures than x86/amd64. I build Go for ARM, and it seems to have good support for that target. All libraries build successfully, and tests fail (because it's trying to run ARM test binaries on my amd64 system).
After all, I have 5g
/5l
in my $GOBIN
folder and they produce valid and working ARM binaries.
But what's happening to other Go tools:
5a: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
5c: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
5g: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
5l: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
6cov: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
6nm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
6prof: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
cgo: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
ebnflint: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
godefs: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
godoc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
gofix: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
gofmt: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
goinstall: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
gomake: POSIX shell script, ASCII text executable
gopack: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
gopprof: a perl script, ASCII text executable
gotest: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
gotry: a bash script, ASCII text executable
gotype: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
govet: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
goyacc: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
hgpatch: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped
See? cgo
is an ARM binary, gofix
and gofmt
are ARM binaries as well. I thought it's expected that if I provide $GOHOSTOS
/$GOHOSTARCH
variables I will cross-compile my apps? How to get cgo
work for ARM target?