Golang build error 0x80000034 (2147483700)

Viewed 1851

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

4 Answers

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.

If you can disable cgo CGO_ENABLED=0 go build -o main it should build with go 1.16

Related