TL;DR
Zig has made significant progress on its ELF linker, now supporting fast incremental builds and enabling the compilation of its self-hosted compiler with LLVM and LLD. The feature is available in the latest master branch and aims to improve development speed.
The Zig project has announced significant improvements to its ELF linker, now capable of building the self-hosted Zig compiler with LLVM and LLD libraries enabled, and supporting fast incremental compilation on x86_64 Linux.
Matthew Lugg, a Zig contributor, detailed ongoing enhancements to the new ELF linker introduced in Zig 0.16.0. The latest updates enable the linker to build complex projects such as the Zig compiler itself, including external libraries like LLVM and LLD, which was not possible at the initial release.
One of the key features now supported is fast incremental rebuilding, allowing developers to rebuild projects and external libraries with minimal delay, often in milliseconds, without performance penalties. This is particularly useful for debugging and iterative development workflows.
Currently, the main limitation is the lack of support for generating DWARF debug information, which is a priority for future development. Despite this, the incremental build feature alone offers substantial productivity benefits for users on x86_64 Linux using the master branch.
Why It Matters
These improvements could significantly speed up development cycles for Zig users, especially those working on large or complex projects. Faster rebuilds reduce wait times during debugging and iterative testing, making Zig more attractive for systems programming and compiler development.
Moreover, the ability to compile the Zig compiler with external libraries like LLVM and LLD demonstrates the maturity of the linker and its readiness for more advanced use cases, potentially influencing adoption and ecosystem growth.

Linux Basics for Hackers: Getting Started with Networking, Scripting, and Security in Kali
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Background
The ELF linker was initially introduced in Zig 0.16.0 as a basic feature supporting Zig-only code. Since then, the development focus has been on expanding its capabilities, including support for external C libraries and now, incremental compilation. Prior to these updates, build times could be lengthy, especially for large projects or when making frequent changes.
The recent improvements align with Zig’s ongoing efforts to optimize its build system and tooling, as seen in other recent updates like the reworking of its build system by Andrew Kelley. These developments aim to make Zig more competitive in systems programming and compiler development environments.
“The new ELF linker is now capable of building the Zig compiler with LLVM and LLD, and supports fast incremental compilation on x86_64 Linux.”
— Matthew Lugg
“The build system has been restructured to improve speed and flexibility, which complements the ELF linker enhancements.”
— Andrew Kelley

Executable Files for Linux: Under the Hood of ELFs for Flexible and Secure Low-Level Coding
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
What Remains Unclear
It remains unclear when DWARF debug information support will be implemented, as it is currently the main missing feature of the ELF linker. Additionally, the full impact of these updates on large-scale projects and community adoption is still to be observed.

Competitive Programming 4 – Book 1: The Lower Bound of Programming Contests in the 2020s
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
What’s Next
The Zig team will focus on adding DWARF debug info support to the ELF linker. Developers are encouraged to test the new features in the master branch and report bugs. The upcoming Zig 0.17.0 release is expected to include further improvements and stability fixes.
debugging tools with DWARF support
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Key Questions
What is the main benefit of the new ELF linker?
The main benefit is support for fast incremental compilation, allowing developers to rebuild projects in milliseconds, significantly speeding up development workflows.
Can I use this feature in stable releases now?
The improvements are available in the master branch. Users on tagged releases, such as Zig 0.16.0 or 0.17.0, will need to wait until the next stable release to access these features officially.
Does the ELF linker support debugging information now?
No, support for DWARF debug information is still in development and is the next priority for the linker team.
How does this impact build times for large projects?
It significantly reduces rebuild times through incremental compilation, which can now be done in milliseconds, improving productivity especially during debugging and iterative development.
Source: Hacker News