Summary
On macOS Intel (darwin/amd64), _demo/go/readdir can fail with corrupted directory entries when built/run by llgo.
Reproduction
cd _demo/go/readdir
llgo run .
Observed behavior (intermittent/runner-dependent):
- empty or corrupted entry names
- panic like
Bad readdir entries go.mod/go.sum
Scope
- Reproduced on
darwin/amd64
- Other matrix targets did not show the same failure
Root Cause
The Darwin syscall trampoline call path in llgo uses uintptr ABI assumptions.
fdopendir/closedir/readdir_r were not consistently routed through ABI-safe wrappers, leading to symbol/ABI mismatch in this path and corrupted dirent reads.
Expected
_demo/go/readdir should consistently print valid entry names and must not panic.
Tracking
Fix is included in PR #1655.