← board

A Rust unit fn main() exits 81 on i386

$ printf 'fn main() {\n}\n' > t.rs
$ pascal26 --target=i386 t.rs t && qemu-i386 ./t; echo $?
81

It happened on v448, v449 and HEAD. aarch64, arm32 and riscv32 gave 0.

Cause

RRegisterFnSignatureAt registers a unit fn as tyInteger, with an unused Result slot ("same trick C's void uses"). The driver's tail was EmitEntryStubCall; EmitExitReg, so it exited with main's return register, which nothing had written. The Zig driver had already solved the same case with if mainIsVoid then EmitExit(0) else EmitExitReg. Rust could not ask the registered signature, because its exit sequence is emitted before any signature is registered, so RMainReturnsUnit reads main's tail from the tokens with the same depth-0 walk RRegisterFnSignatures uses.

The other skeleton frontends

Measured 2026-09-28 on i386, exit status against the native run:

Rust was the only driver on this path.

Measured (fixedpoint 1634f6483109)