ReviewOS

home-lang/home

arm64 backend is a stub — native compilation broken on Apple Silicon

#5
Open glennmichael123 opened this 9 days ago ·
9 days ago

Context

README sells "compiles to native x64 code." In practice every Mac shipped since late 2020 is Apple Silicon (arm64), so home build on the most common contributor laptop has no working native target.

BackendLOC
packages/codegen/src/x64.zig2,665
packages/codegen/src/arm64.zig259
packages/codegen/src/wasm.zig360
packages/codegen/src/llvm_codegen.zig619

This is the #1 blocker for adoption. New contributors zig build, run hello world, and find their machine isn't supported.

Scope

  • Bring arm64.zig to feature parity with x64.zig for the language subset that has codegen tests today
  • Pass the existing codegen test suite on aarch64-macos and aarch64-linux
  • Update README to honestly describe backend coverage (or, once parity lands, drop the x64-only language)
  • Add CI matrix entries for aarch64-macos (GitHub-hosted M1 runners) and aarch64-linux

Notes

  • LLVM backend (619 LOC) is also stub-grade. If parity via direct codegen is too much, an alternative path is "finish the LLVM backend and let it cover all non-x64 targets." Worth deciding upfront.
9 days ago

Cross-ref: blocks home-lang/home-os#8 (replace rpi5_main.zig with a real .home ARM64 boot path). Closing this issue unblocks the consistency fix on the OS side.

9 days ago

Breakdown for the kernel/freestanding half of this work, driven by the HomeOS Raspberry Pi 5 media-center epic (home-lang/home-os#113):

  • #582 — aarch64 lowering for the --kernel codegen path (12-rung proof-of-life ladder, per-file ratchet)
  • #583 — --target=aarch64-freestanding explicit target selection + ELF64/aarch64 emission
  • #584 — A3: volatile MMIO semantics and barrier intrinsics in the language

Note this issue covers the userspace/native arm64 backend; #582 covers the separate home_kernel_codegen.zig path, which today has zero arm64 support.

9 days ago

Status check against origin/main @ d4b219507: still accurate. packages/codegen/src/aarch64_native_codegen.zig covers an early milestone subset (26 NotImplemented returns; no imports, closures, async or heap allocation). The direct-vs-LLVM decision raised here is now tracked in #801, and aarch64 is a prerequisite for the AOT/threads work in epic #814 (see #795, #796, #807).

Sign in to comment on this issue.