HeadlinesBriefing favicon HeadlinesBriefing.com

Zig's ELF linker gains incremental build speed

Hacker News •
×

Matthew Lugg reported that the ELF linker introduced in Zig 0.16.0 has progressed far beyond its initial prototype. Early versions only linked pure Zig code and were disabled by default, but recent commits enable it to build the self‑hosted Zig compiler with LLVM and LLD support. The new linker can now be activated with the -fnew-linker flag, enabling full‑system builds that previously needed the GNU linker.

A key milestone shows the linker handling incremental rebuilds while pulling in external libraries and C sources on x86_64 Linux without added latency. Lugg demonstrated a 30 ms rebuild of Andrew’s Tetris clone and sub‑250 ms rebuild cycles for the Zig compiler itself, proving that fast incremental compilation works end‑to‑end. Such speed gains directly benefit developers who rely on frequent compile‑run loops during UI or game prototyping.

The only major gap remains DWARF debug info generation, which Lugg lists as his next priority. Users on the master branch can already experiment with the new ELF linker to shave milliseconds off their edit‑compile cycle, and the upcoming 0.17.0 release will package the feature for stable users. Adopting it also trims build time for large projects. Report any regressions via the Zig issue tracker.