Mold 3.0 rewritten in Rust, replacing C++
The software development company has rewritten its high-performance linker, Mold 3.0, entirely in Rust. The aim is to enhance stability and achieve faster build times.

The software development company has completely rewritten its high-performance linker, Mold 3.0, in the Rust programming language. This new version, 3.0.0, replaces the previous C++-based iteration. The developers aim to enhance the software's stability and position it for wider adoption in Linux distributions through this transition.
The Mold development team, led by lld linker creator Rui Ueyama, intends with the Mold 3.x series to close remaining compatibility gaps with GNU ld, particularly concerning linker script support. The ultimate goal is for Mold to become the default linker in Linux, significantly accelerating build processes compared to the currently used GNU ld.
Version 3.0.0 is designed as a direct replacement for the prior C++-based version 2.42.1. The Rust version supports the same command-line options and target architectures, with linking speeds matching its predecessor. Compatibility has been tested by building all Gentoo packages, and no regressions have been identified.
The switch to Rust is intended to make Mold more robust against corrupted input files. The previous C++ version could experience memory access errors and crashes with such files. The Rust version checks these boundary accesses and terminates the program gracefully at the error point instead of crashing.