combining dwarf failed: unknown load command 0x80000034 solution in GoLang

English 简体中文 繁体中文 ภาษาไทย Tiếng Việt
Summary

Developers encountering the "combining dwarf failed: unknown load command 0x80000034" error in Go programs, particularly when using Go 1.16 on a Mac M1 (ARM64) machine, have a few workarounds. The primary recommendation is to upgrade the Go version to 1.17, which often resolves the issue. If project constraints require staying on Go 1.16, an alternative solution involves installing the AMD64 build of Go 1.16 instead of the ARM64 version. This approach has been tested and proven effective for mitigating the error.

ในกรณีที่พบข้อผิดพลาดด้านล่างขณะรันโปรแกรม go:

combining dwarf failed: unknown load command 0x80000034

อาจเป็นเพราะคุณกำลังรัน go 1.16 บนเครื่อง Mac M! ถ้าคุณตรวจสอบ go version มันอาจบอกคุณว่าคุณกำลังรันเวอร์ชัน arm ของ go

go version go1.16.10 darwin/arm64

ในกรณีเช่นนี้ คุณสามารถลองวิธีการด้านล่างเพื่อแก้ไขปัญหา

ลองอัปเกรดเวอร์ชัน go เป็น 1.17 และรันโค้ดอีกครั้ง ถ้าเป็นไปไม่ได้เพราะคุณต้องใช้ go 1.16 ด้วยเหตุผลบางอย่าง คุณอาจลองติดตั้งเวอร์ชัน amd ของ go 1.16 วิธีนี้ควรใช้งานได้ตามที่เราทดสอบแล้ว

ถ้าคุณยังมีปัญหาอยู่ โปรดแบ่งปันวิธีแก้ไขอื่นๆ หากคุณแก้ไขได้แล้ว

GO 1.16 0X80000034

  RELATED

No related programming articles found. Browse all programming tutorials and articles.

  COMMENT

1
Sushant
Mar 14, 2024 at 5:57 am

update flag CGO_ENABLED="0" in go env using below command

go env -w CGO_ENABLED="0"

it must be 1 right now and in Mac M1 this creates issue while compiling both go and c binaries together, disabling this flag makes it such that build is now done ignoring any external C libraries which will succeed.