whatisgithub

What is mold?

rui314/mold — explained in plain English

Analysis updated 2026-06-24

16,482C++Audience · developerComplexity · 2/5Setup · moderate

In one sentence

mold is a high-speed drop-in replacement for the Unix linker that cuts C, C++, and Rust rebuild times from tens of seconds to under two seconds by parallelising the link step across all available CPU cores.

Mindmap

mindmap
  root((mold))
    What it does
      Links compiled objects
      Replaces default linker
      Parallel execution
    Speed vs alternatives
      Faster than GNU ld
      Faster than gold
      Close to file copy speed
    CPU architectures
      x86-64 and ARM64
      RISC-V
      PowerPC and s390x
    Integration
      Clang flag
      Rust config
      mold -run wrapper
    Tech Stack
      C++20
      CMake
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Speed up C++ or Rust build loops by swapping in mold with a single compiler flag, with no other code changes.

USE CASE 2

Cut CI pipeline link times for large projects like Clang or Chromium from minutes to seconds.

USE CASE 3

Use mold -run to intercept linker calls in an existing build system without editing build scripts.

What is it built with?

C++C++20CMake

How does it compare?

rui314/moldyhirose/cpp-httplibcoatisoftware/sourcetrail
Stars16,48216,47416,452
LanguageC++C++C++
Setup difficultymoderateeasymoderate
Complexity2/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires building from source with CMake and a C++20 compiler, or installing from a package manager on supported distros.

So what is it?

mold is a faster drop-in replacement for the Unix linkers that almost every C, C++ and Rust program quietly depends on. To understand what a linker is, it helps to remember that building a compiled program happens in two phases: first a compiler turns each source file into an intermediate object file, then a linker stitches all those object files together into a single executable or shared library. For large projects the linker step can take many seconds or even minutes every time you rebuild, which is painful during the quick edit-rebuild-test cycles developers do while debugging. mold's pitch is that it does this second phase several times faster than existing linkers. A benchmark table shows that linking large programs like MySQL, the Clang compiler and Chromium takes mold under two seconds on a simulated 32-thread machine, compared with tens of seconds for the traditional GNU linker. The README notes that mold is so fast it is only about twice as slow as just copying the file with cp. It supports a long list of processor architectures including x86-64, ARM64, ARM32, RISC-V variants, PowerPC variants, s390x, LoongArch, SPARC64, m68k and SH-4. Someone would install mold to shorten build wait times on a compiled project, especially during rapid debug-edit-rebuild loops or in continuous integration. The README explains how to make a compiler use mold via flags like -fuse-ld=mold for Clang and recent GCC, gives recipes for Rust, Nim and the Conan package manager, and describes a mold -run wrapper that intercepts linker calls without changing build settings. mold itself is written in C++20 and is built with CMake. The full README is longer than what was provided.

Copy-paste prompts

Prompt 1
How do I configure my Rust project to use mold instead of the default linker on Linux, show me the .cargo/config.toml change.
Prompt 2
Write a CMake snippet that sets mold as the linker for a C++20 project on Linux.
Prompt 3
Show me the benchmark comparison between mold and GNU ld when linking a large C++ binary, and the commands I'd run to reproduce it.
Prompt 4
I use Conan for C++ package management, how do I tell Conan to link my project with mold?

Frequently asked questions

What is mold?

mold is a high-speed drop-in replacement for the Unix linker that cuts C, C++, and Rust rebuild times from tens of seconds to under two seconds by parallelising the link step across all available CPU cores.

What language is mold written in?

Mainly C++. The stack also includes C++, C++20, CMake.

How hard is mold to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is mold for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.