Zig ELF Linker Gains Fast Incremental Compilation Support

Original: Zig ELF Linker Improvements Devlog

Why This Matters

Fast incremental compilation could significantly improve developer productivity in Zig.

Zig's new ELF linker now supports building the self-hosted compiler with LLVM/LLD libraries and enables fast incremental rebuilds in milliseconds on x86_64 Linux, marking significant progress since its 0.16.0 debut.

Matthew Lugg announced major improvements to Zig's ELF linker, which debuted in version 0.16.0 but was initially limited to Zig-only code without external libraries. The linker can now build the self-hosted Zig compiler with LLVM and LLD libraries enabled. The key advancement is fast incremental compilation support on x86_64 Linux, allowing rebuilds in around 30ms for projects like Andrew's Tetris clone and 200-300ms for the Zig compiler itself after initial 36-second builds. The linker still lacks DWARF debug information generation for Zig code, which Lugg identified as the next priority. Users can enable the experimental linker with the -fnew-linker flag.

Source

ziglang.org — Read original →