英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论