Mold Linker Version 3.0.0 Release – Rewritten in Rust
Mold version 3.0.0 is released, featuring a complete rewrite from C++ to Rust with AI assistance, improving memory safety while retaining GNU ld compatibility.
read it Essential reading for systems engineers tracking modern toolchains, as mold's complete rewrite to Rust marks a major milestone in high-performance linkers.
summary
Mold version 3.0.0 marks a major transition, rewriting the entire high-performance linker from C++ to Rust while maintaining performance parity and drop-in compatibility with GNU ld. The rewrite addresses C++ memory safety issues by substituting potential out-of-bounds segmentation faults with safe runtime panics on corrupted inputs. Built now with Cargo instead of CMake, the release also closes remaining compatibility gaps like linker script support. Commenters discuss the implications for early distro bootstrapping and the heavy use of AI assistance during the translation.
key points
- Mold 3.0.0 is a complete rewrite from C++ to Rust, maintaining performance parity and drop-in compatibility with version 2.42.1.
- Memory safety is improved by replacing C++ out-of-bounds memory access crashes with safe runtime panics on corrupted input files.
- The build system has migrated from CMake to Cargo, requiring Rust 1.95+ and dropping the oneTBB dependency.
who should read it
Systems programmers, compiler engineers, and Linux distribution maintainers.
discussion positive
consensus
Commenters are generally impressed by the speed of the Rust rewrite and its heavy LLM assistance, though distro maintainers point out complications for early-stage bootstrapping.
pushback
A minority argue that writing foundational build tools in Rust creates a chicken-and-egg problem for bootstrapping Linux distros from C/C++ toolchains.
The linux distribution I co-maintain uses mold as our bootstrap linker to bootstrap rust itself, and it saved us -hours- on long version-by-version build chains. Mold being in c meant we could build it very early and use it as the default linker distro wide and enjoy build speedups everywhere.
Now sadly we will have to fork and maintain the c version as mold2 forever.
Rust is not actually the right tool for all problems.
It details the real-world operational friction distro maintainers face when a core bootstrap tool shifts from C to Rust.
Generated by an LLM from the article and thread. Check the sources before relying on it.