Skip to content

P4: Mach-O backend, aarch64-apple-darwin #8

Open

Description

@zackees

Part of #2. Full spec: 06-PHASE-4-MACOS.md

We do not inherit a working Mach-O. wild's backend is a skeleton: 40 todo!()s, arm64-only, feature-gated off, links trivial programs only. Treat it as a sketch of the trait impls.

Set expectations correctly: Apple's ld_prime is already 1.4–2× faster than ld64.lld. The macOS pitch is incremental linking and an open implementation, not throughput. Do not plan around winning cold-link speed here.

  • P4-T1 clear all 40 todo!()s (exact locations listed in the doc) — real impl or explicit bail!
  • P4-T2 remove the feature gate
  • P4-T3 load commands and segment layout (16 KiB pages on arm64)
  • P4-T4 arm64 relocations — note ARM64_RELOC_ADDEND is a prefix relocation modifying the next entry, structurally unlike ELF and COFF
  • P4-T5 chained fixups (LC_DYLD_CHAINED_FIXUPS); reject the legacy opcode path
  • P4-T6 .tbd stub dylibs — we never touch a real libSystem.dylib
  • P4-T7 LC_BUILD_VERSION / platform version
  • P4-T8 ad-hoc code signature — mandatory, unsigned arm64 binaries do not execute. Generate in-process; do not shell out to codesign. Size must be reserved during layout before contents can be computed

Done when: ci/gate-macos.sh exits 0, including a Rust binary running on a clean Apple Silicon machine with Gatekeeper at defaults.

Activity

  1. added
    enhancement
    on Aug 1, 2026
  2. zackees commented on Sep 18, 2026

    @zackees
    CollaboratorAuthor

    Kept on the roadmap, gated (owner decision, via #154). Order per #154's sequencing: #153 first, then Track A (Windows, #96), then Track B (Mach-O, #8); the daemon (#19) follows #6 proving Linux. No work starts before its gate.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions