英文:
Golang build error 0x80000034 (2147483700)
问题
我运行的命令是:go build -o main
输出:
/usr/local/go/pkg/tool/darwin_arm64/link: /usr/local/go/pkg/tool/darwin_arm64/link: 合并dwarf失败:未知的加载命令0x80000034(2147483700)
go版本:go version go1.16.4 darwin/arm64
英文:
command I ran: go build -o main
output:
/usr/local/go/pkg/tool/darwin_arm64/link: /usr/local/go/pkg/tool/darwin_arm64/link: combining dwarf failed: unknown load command 0x80000034 (2147483700)
go version: go version go1.16.4 darwin/arm64
答案1
得分: 7
请查看问题 #47269。
load command 0x80000034 对应于 LC_DYLD_CHAINED_FIXUPS。对该加载命令的支持已在 https://go-review.googlesource.com/c/go/+/312729 中添加,该提交是 Go 1.17 的一部分。
您应该升级到 Go 1.17 或更高版本。
英文:
Have a look at issue #47269.
> load command 0x80000034 corresponds to LC_DYLD_CHAINED_FIXUPS. Support for this load command was added in https://go-review.googlesource.com/c/go/+/312729, which is part of Go 1.17.
You should upgrade to Go 1.17 or above.
答案2
得分: 0
根据 @blackgreen 的提醒,可以通过升级到 Go 1.17 来解决这个问题。
然而,如果不想升级到 Go 1.17,也可以尝试安装 Go 1.16 的 AMD 版本然后再次运行。这在我的 MAC M1 上有效。
英文:
As mentioned by @blackgreen, can solve the problem by upgrading to Go 1.17.
However if not wanna upgrade to Go 1.17, can also try to install an AMD version of Go 1.16 and run again. This works for me on my MAC M1.
答案3
得分: 0
如果你可以禁用cgo,使用CGO_ENABLED=0 go build -o main
命令应该可以在Go 1.16上构建。
英文:
If you can disable cgo CGO_ENABLED=0 go build -o main
it should build with go 1.16
答案4
得分: 0
如果你使用的是Mac M1芯片,并且想要使用1.16版本的Go语言,你可以尝试安装一个适用于AMD的Go 1.16版本。我在我的机器上测试过,这种方法可以正常工作。
英文:
If you are on Mac M1 chip, and if you wanna go 1.16, can also try to install an amd version of the go 1.16. This has been tested and worked fine on my machine.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论