donglu9978 2012-01-11 17:15
浏览 58
已采纳

我的Go工具是否针对错误的体系结构构建?

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?

  • 写回答

1条回答 默认 最新

  • dongqiang2024 2012-01-11 18:16
    关注

    The Go linux/arm port is incomplete. For example, the cgo runtime for linux/arm is unimplemented. See $GOROOT/src/pkg/runtime/cgo/gcc_arm.S and $GOROOT/src/pkg/runtime/cgo/gcc_linux_arm.c.

    [cgo on arm.] It is not planned for Go 1.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog