Golang构建错误0x80000034(2147483700)

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

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版本。我在我的机器上测试过,这种方法可以正常工作。

参考链接:https://www.pixelstech.net/article/1637845585-combining-dwarf-failed%3A-unknown-load-command-0x80000034-solution-in-GoLang

英文:

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.

Reference: https://www.pixelstech.net/article/1637845585-combining-dwarf-failed%3A-unknown-load-command-0x80000034-solution-in-GoLang

huangapple
  • 本文由 发表于 2021年12月16日 15:45:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/70375459.html
匿名

发表评论

匿名网友

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

确定