mold is a high-performance drop-in replacement for existing Unix linkers, designed to speed up builds. In our August 2026 benchmarks, it links 4.9x faster than LLVM lld and 1.9x faster than wild at the median; see Benchmark for the full results.

mold is written by the original developer of LLVM lld, the linker that Android, Chrome, FreeBSD, PlayStation, Nintendo Switch, and other production systems are built with. mold started as an effort to build an even faster linker from scratch, free of the architectural limits its author had run into while optimizing lld. It has been in production use since 2021, and today it is the default linker of many large open-source projects and is used internally by many companies.

mold supports x86-64, i386, ARM 32/64, RISC-V 32/64, PowerPC 32/64, s390x, LoongArch 32/64, SPARC64, m68k, and SH-4.

If you are using a compiled language such as C, C++, or Rust, a build consists

of two phases. In the first phase, a compiler compiles source files into

object files (.o files). In the second phase, a linker takes all object

files and combines them into a single executable or shared library file.

The second phase can be time-consuming if your build output is large. mold can speed up this process, saving you time and preventing distractions while waiting for a lengthy build to finish. The difference is most noticeable during rapid debug-edit-rebuild cycles.

Here is a performance comparison of lld, wild, and mold when linking nine large programs on two machines:

- AMD Ryzen Threadripper 7980X (64 cores) running Ubuntu 24.04

- Apple M1 Ultra (16 performance cores and 4 efficiency cores) running Fedora Asahi Remix 42; the benchmark is restricted to the performance cores

The Threadripper represents many-core workstation and server processors, and the M1 Ultra represents high-performance desktop processors.

All three linkers were built from source in release configuration as of 2026-08-28 and ran with their default options. Times are wall-clock times as seen by the caller, the median of three runs after a warm-up. The ARM64 rows are the ARM64 builds of the same programs. The benchmark suite, including all linker inputs, is available on Zenodo.

AMD Ryzen Threadripper 7980X, debug builds

AMD Ryzen Threadripper 7980X, release builds

Apple M1 Ultra, debug builds

Apple M1 Ultra, release builds

N/A indicates that the linker cannot link that program. wild's Chromium

release links are also marked N/A because wild does not implement --icf=all

and links without identical code folding.

mold owes its speed to pervasive parallelism and to efficient data structures and algorithms. For details, read our paper "mold: A Massively Parallel Linker" (ASPLOS 2027), available at https://arxiv.org/abs/2608.23228.

Binary packages for the following systems are currently available:

Prebuilt binaries for Linux on x86-64, ARM64, ARM32, RISC-V, PPC64LE, s390x, and LoongArch are also attached to each GitHub release.

mold is written in Rust and built with Cargo. Install the stable Rust toolchain with rustup. You also need Git and a C compiler such as GCC or Clang, which you can install with your system's package manager.

git clone https://github.com/rui314/mold.git

cd mold

cargo build --releaseThe executable and its companion preload library are

target/release/mold and target/release/mold-wrapper.so.

Run sudo ./install-mold.sh to install mold under /usr/local. To install it

under a different prefix, set PREFIX, as in

sudo PREFIX=/usr ./install-mold.sh.

You can also run target/release/mold directly without installing it.

A classic way to use mold

On Unix, the linker command (usually /usr/bin/ld) is indirectly invoked by

the compiler driver (typically cc, gcc, or clang), which is in turn

indirectly invoked by make or other build system commands.

If you can specify an additional command line option for your compiler driver

by modifying the build system's config files, add one of the following flags

to use mold instead of /usr/bin/ld:

-

For Clang: pass -fuse-ld=mold

-

For GCC 12.1.0 or later: pass -fuse-ld=mold

-

For GCC before 12.1.0: the -fuse-ldoption does not acceptmoldas a valid argument, so you need to use the-Boption instead. The-Boption tells GCC where to look for external commands likeld.If you installed mold using the script above, there is a directory named /usr/local/libexec/mold, and theldcommand there is a symlink to mold. Pass-B/usr/local/libexec/moldto GCC. If you installed under another prefix, use that prefix instead.

If you haven't installed ld.mold to any $PATH, you can still pass

-fuse-ld=/absolute/path/to/mold to clang to use mold. However, GCC does not

accept an absolute path as an argument for -fuse-ld.

If you are using Rust

Create .cargo/config.toml in your project directory with the following:

[target.'cfg(target_os = "linux")']

linker = "clang"

rustflags = ["-C", "link-arg=-fuse-ld=/path/to/mold"]where /path/to/mold is an absolute path to the mold executable. In the

example above, we use clang as a linker driver since it always accepts the

-fuse-ld option. If your GCC is recent enough to recognize the option, you

may be able to remove the linker = "clang" line.

[target.'cfg(target_os = "linux")']

rustflags = ["-C", "link-arg=-fuse-ld=mold"]If you want to use mold for all projects, add the above snippet to

~/.cargo/config.toml.

If you are using Nim

Create config.nims in your project directory with the following:

when findExe("mold").len > 0 and defined(linux):

switch("passL", "-fuse-ld=mold")where mold must be included in the PATH environment variable. In this

example, gcc is used as the linker driver. Use the -fuse-ld option if your

GCC is recent enough to recognize this option.

If you want to use mold for all projects, add the above snippet to

~/.config/config.nims.

If you are using Conan package manager

You can configure Conan to download the latest

version of mold and use it as the linker when building your dependencies and

projects from source. Please see the instructions here.

mold -run

It is sometimes very hard to pass an appropriate command line option to cc

to specify an alternative linker. To address this situation, mold has a

feature to intercept all invocations of ld, ld.bfd, ld.lld, or ld.gold

and redirect them to itself. To use this feature, run make (or another build

command) as a subcommand of mold as follows:

mold -run make <make-options-if-any>Internally, mold invokes a given command with the LD_PRELOAD environment

variable set to its companion shared object file. The shared object file

intercepts all function calls to exec(3)-family functions to replace

argv[0] with mold if it is ld, ld.bfd, ld.gold, or ld.lld.

GitHub Actions

You can use our setup-mold GitHub Action to speed up GitHub-hosted continuous builds. Although GitHub Actions run on a 4 core machine, mold is still significantly faster than the default GNU linker, especially when linking large programs.

Verify that you are using mold

mold leaves its identification string in the .comment section of an output

file. You can print it out to verify that you are actually using mold.

$ readelf -p .comment <executable-file>

String dump of section '.comment':

[ 0] GCC: (Ubuntu 10.2.0-5ubuntu1~20.04) 10.2.0

[ 2b] mold 9a1679b47d9b22012ec7dfbda97c8983956716f7If mold is present in the .comment section, the file was created by mold.

Online manual

Since mold is a drop-in replacement, you should be able to use it without

reading its manual. However, if you need it, mold's man page

is available online. You can read the same manual by running man mold.

mold has been developed in the open since 2020 and has more than 140 contributors. Its test suite, which covers every linker feature, runs in CI for all supported target CPU architectures, natively or under QEMU, and under ASAN and TSAN. Before each release, we try to build all of Gentoo Linux's roughly 19,000 packages with mold, using GNU ld as a control, to find regressions before they reach a release.

mold is free to use, but keeping it maintained is continuous work: supporting new architectures and toolchain features, keeping up with the projects that depend on it, and making it faster. That work is funded by sponsors. If mold saves you or your company time, please consider becoming a GitHub sponsor.

We thank everyone who sponsors the project. In particular, we'd like to acknowledge the following people and organizations who have sponsored $128/month or more: