Skip to content

v5.2.0 — Rail stands alone (no as/ld/codesign)

Choose a tag to compare

@zemo-g zemo-g released this 19 Jun 05:45
· 251 commits to master since this release

Rail's whole toolchain now stands alone — the compiler assembles, links, and ad-hoc code-signs itself, in pure Rail, in-process, with no Apple as, ld, or codesign anywhere in the build. v5.0.0 removed as/ld from the Linux ELF path; v5.2.0 closes the loop on the macOS host platform — including the ad-hoc signature arm64 requires — and extends it to FFI programs. The last external tool in Rail's build is gone.

Because Rail now owns every byte of the output — including the LC_UUID and section padding that ld randomizes — the self-compile is deterministic and bit-reproducible: the committed seed reproduces itself byte-for-byte (sha256 b02dd228…) in a single cycle. That upgrades attestation from tamper-evident to source-reproducible.

Highlights

  • Pure-Rail AArch64 assembler (tools/v5/asm.rail) — two-pass, whole-program __text layout; gate-validated 1248/1248 instruction forms byte-identical to as, with the full compiler __text (651,184 bytes) byte-exact.
  • Pure-Rail Mach-O linker (tools/v5/link_lib.rail) — bakes @PAGE/@PAGEOFF relocations, builds the __data/__bss/__mod_init image, emits classic LC_DYLD_INFO rebase + bind streams, stubs + __got, full symtab/dysymtab/indirect-symtab, then ad-hoc signs it (N-page signer).
  • In-process by default — self_compile rail-links itself at RAIL_ARENA_MB ≥ 5000; below that (or with /tmp/.rail_force_as_ld) the original as/ld path runs, byte-for-byte unchanged. The committed seed is the rail-linked binary.
  • FFI stands alone too — multi-dylib linking (second LC_LOAD_DYLIB + per-import ordinal) links libsqlite3 FFI binaries with no ld; stdlib/sqlite.rail gains prepared statements (prepare/bind/step/column/finalize) and zero-cost weak auto-linking.
  • 178/178 tests, byte-identical fixed point. Compiler behavior unchanged — this release is the build pipeline, not the language.

Reproducible attestation (verified)

The rail-link path emits every byte itself — no host as, ld, or SDK — so the build is host-independent. The seed compiled on two independent machines, an Apple M4 Pro (macOS 26.3) and an M1 Ultra (macOS 26.4.1), is byte-identical: sha256 b02dd2284a9220c29f9e984b5e3c898a7d255751263a6547e50c7c2a8abe0bb4. Rebuild it yourself and check the hash.

Full notes: CHANGELOG.md.