mold 3.0 Is a Rust Rewrite of the Fast Linker, Built to Be a Drop-In Replacement
mold, the high-speed linker popular for cutting build times in large C, C++, and Rust projects, released version 3.0 on October 5. It is the first release written in Rust; 2.42.1 is the last C++ version.
Same linker, new language
The release notes describe 3.0 as a drop-in replacement for 2.42.1:
- The same command-line options and target architectures
- Output identical to 2.42.1 apart from listed bug fixes
- Linking speed on par with the C++ version
The maintainers say they ran the full test suite on every target, compared output across varied workloads, and built every Gentoo package without finding regressions.
The safety gain is concrete: reads the C++ version performed unchecked are now bounds-checked, so corrupted input files make mold panic at the bad access instead of segfaulting.
Why rewrite
The 3.x series aims to close the remaining gaps with GNU ld, especially in linker script support, so mold can work as a default system linker rather than an opt-in speed-up.
Build changes for packagers
- The build moves from CMake to Cargo and needs Rust 1.95 or later plus a C compiler
- Install with
./install-mold.sh, which acceptsPREFIXandDESTDIR - oneTBB is no longer a dependency
- A few flag-parsing fixes change behaviour: single-dash long options are parsed the way GNU ld parses them
If you use mold through mold -run make or -fuse-ld=mold, nothing should change for you. Our Makefiles guide and building from source guide cover the build basics.