Links large C, C++, and Rust builds faster than conventional ld or lld by parallelizing work and serving as a command-line drop-in linker
Overview
mold is a linker for Unix-like systems intended as a faster drop-in replacement for GNU ld, gold, or LLVM lld when producing executables and shared libraries. It focuses on the second phase of compiled builds, where object files merge into final binaries, which can dominate iteration time on very large projects.
The implementation emphasizes parallelism plus efficient data structures and algorithms, and it supports numerous CPU architectures including x86-64, ARM, RISC-V, PowerPC, s390x, LoongArch, and others listed in project materials. Teams switch drivers by passing -fuse-ld=mold to Clang or recent GCC, configuring Rust or Nim linker settings, using mold -run to intercept ld invocations, or installing packaged binaries from releases.
Published benchmarks compare link times against lld and wild on programs such as Chromium, Firefox, Blender, and TensorFlow, with the largest gains on huge debug binaries. A mold -run mode preloads an interceptor so build systems that hard-code /usr/bin/ld can be redirected without rewriting every compile flag, available on Linux and FreeBSD.
mold identifies itself in the .comment section of produced binaries for verification. Prebuilt packages and per-release binaries are provided for common Linux architectures, and the tool can be built locally with Rust and a C toolchain when packages are unavailable.
Key features
- Drop-in Unix linker replacement
- Parallel linking architecture
- Wide multi-architecture support
- Clang and GCC fuse-ld integration
- Rust cargo linker configuration
- mold -run ld interception mode
- GitHub Action for CI speedups
- Binary .comment identification string
Use cases
- Faster local C++ debug cycles
- Accelerating large monorepo links
- Speeding CI builds on big binaries
- Replacing lld in existing toolchains
- Rust projects needing quicker links