交叉编译到ARMv7失败了。

huangapple go评论67阅读模式
英文:

Cross-compile to ARMv7 failed

问题

我尝试在我的Linux桌面上编译一个Go程序(Linux桌面4.10.0-28-generic #32-Ubuntu SMP Fri Jun 30 05:32:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux),Go版本为go version go1.8.3 linux/amd64,目标是ARM架构:

$ GOPATH=/home/xrfang/git/hermes/ GOARM=7 GOARCH=arm go build .

可执行文件已生成,但似乎不是ARMv7架构:

$ file hermes

hermes: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

显示为EABI5。我该如何交叉编译为ARMv7?是否有什么问题导致交叉编译回退到较低的ARM版本?

谢谢。

英文:

I try to compile a go program on my Linux desktop (Linux desktop 4.10.0-28-generic #32-Ubuntu SMP Fri Jun 30 05:32:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux), go version go version go1.8.3 linux/amd64 to arm:

$ GOPATH=/home/xrfang/git/hermes/ GOARM=7 GOARCH=arm go build .

the executable is generated, but seems NOT ARMv7:

$ file hermes

hermes: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped

It shows EABI5. How can I cross-compile to ARMv7? Is there anything missing on my Linux Desktop so that the cross-compile fallback to a lower ARM version?

Thanks.

答案1

得分: 0

我相信,这不是ARMv5。我在MAC OS上尝试了相同的操作,Mac上的"file"命令显示为v7,但Linux上的"file"命令不是。然而,我知道v7有一些很好的改进,可能会提高程序的性能。

但是,这超出了这个问题的范围,你可能需要深入研究你正在做的事情,以及为什么期望性能改进。

我只能说它是为v7编译的。

英文:

I believe, it is not ARMv5. I was trying to do the same on MAC OS and 'file' command on Mac is saying v7, but the 'file' command on Linux don't. However, I do know that v7 has some good improvements and may boost the performance of your program.

But, that is out of scope of this question and you may need to dig deeper into what you're doing and why a performance improvement is expected.
All I can say is, it is compiled for v7.

huangapple
  • 本文由 发表于 2017年8月23日 17:00:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/45835134.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定