Skip to content

fix(zero-c): fail closed for unsupported aarch64 ELF IR#253

Open
VelariumAI wants to merge 1 commit into
vercel-labs:mainfrom
VelariumAI:fix/aarch64-elf-fail-closed-unsupported-ir
Open

fix(zero-c): fail closed for unsupported aarch64 ELF IR#253
VelariumAI wants to merge 1 commit into
vercel-labs:mainfrom
VelariumAI:fix/aarch64-elf-fail-closed-unsupported-ir

Conversation

@VelariumAI
Copy link
Copy Markdown

Summary

Addresses #145.

This PR updates the AArch64 ELF backend so unsupported IR fails closed with a CGEN004 diagnostic instead of allowing successful emission of a misleading executable.

The change is intentionally limited to validation and diagnostic behavior. It does not add new AArch64 code generation support.

What changed

  • Added AArch64 ELF validation for every IR function before successful object or executable emission.
  • Preserved the existing emitted-function behavior: non-exported functions are validated but not newly emitted.
  • Preserved the currently supported small literal-return subset.
  • Aligned unsupported-lowering diagnostic wording with existing native backend terminology.
  • Kept the existing CGEN004 diagnostic path.
  • Avoided adding world.out.write lowering, Linux write syscall lowering, general call lowering, or broader backend support.

Validation

  • Rebuilt the native compiler with make -C native/zero-c.
  • Confirmed bash bin/zero --version succeeds.
  • Confirmed zero new cli hello succeeds.
  • Confirmed zero check . succeeds.
  • Confirmed zero test . succeeds.
  • Confirmed zero build . fails with CGEN004 for unsupported AArch64 ELF lowering.
  • Confirmed zero run . fails with the same diagnostic.
  • Confirmed the previous silent no-output executable behavior no longer reproduces.
  • Confirmed the committed scope is limited to native/zero-c/src/emit_elf_aarch64.c.

Scope

This PR does not change:

  • IR generation
  • checker behavior
  • CLI behavior
  • x64 ELF backend behavior
  • Mach-O backend behavior
  • COFF backend behavior
  • WASM/WASI behavior
  • documentation
  • package files
  • lockfiles
  • build scripts

Notes

This is the fail-closed compiler behavior fix. It does not make unsupported AArch64 programs run successfully. Follow-up work can add actual AArch64 lowering for specific constructs in separate PRs.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@VelariumAI is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant