Skip to content

LLVM 21.1.0-rc3 breaks CGO cross-compilation for Windows ARM64 #39

@yngvar

Description

@yngvar

Description

The latest docker-go-mingw image (using LLVM 21.1.0-rc3) fails to build Go applications with CGO for Windows ARM64 targets.

Error

cgo: cannot parse $WORK/b826/cgo.o as ELF, Mach-O, PE or XCOFF

Root Cause

Regression introduced in LLVM 21.1.0-rc3 (between v1.24.4 and v1.24.6 of your image).

Tested Versions

  • v1.24.4 (LLVM 19.1.7) - Works
  • LLVM 20.1.8 (manual test) - Works
  • v1.24.6 (LLVM 21.1.0-rc3) - Fails

Recommendation

Downgrade to stable LLVM 20.1.8 until LLVM 21.1.0 final release fixes the CGO object file generation bug, which means reverting from LLVM-MinGW 20250812 to 20250709.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions