Wild: A Fast Linker for Linux

Wild is a linker designed to enhance speed during iterative development processes. Although incremental linking is not yet implemented, Wild remains notably fast even without it. Developers are advised to use more established linkers such as GNU ld or LLD for production builds but can consider Wild for faster build times during development on x86-64 Linux systems. If issues arise, users are encouraged to file a bug report.

Installation

To install Wild, users can either copy the provided command from the releases page or download the tarball and manually place the Wild binary in their path. For building and installing from source, the command is:

cargo install --locked --bin wild --git https://github.com/davidlattimore/wild.git wild

Using Wild as Default Linker

To use Wild as the default linker for Rust code, users should modify their ~/.cargo/config.toml file:

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=--ld-path=wild"]

FAQs

Why Another Linker?

While Mold is fast, it lacks incremental linking capabilities. Wild, written in Rust, aims to achieve incremental linking, though it’s still in development.

Supported Platforms and Architectures

Currently, Wild supports x86-64 on Linux for various outputs, including statically linked binaries, dynamically linked binaries, shared objects, and Rust proc-macros. However, users may encounter bugs.

Features Not Yet Supported

Wild is a work-in-progress and lacks support for various features like incremental linking, non-x86-64 architectures, diverse linker flags, linker scripts, and compatibility with Mac and Windows platforms.

Verifying Wild’s Usage

Users can verify Wild as the linker by installing readelf and running:

readelf -p .comment my-executable

Alternatively, the command below can also be used:

strings my-executable | grep 'Linker:'

Name Origin

The name “Wild” is part of a tradition where linkers end with “ld.” The “W” stands for “Wild” in keeping with recursive acronyms popular in open-source projects.

Performance Benchmarks

Wild aims to excel in speed, even without incremental linking. Benchmarks demonstrate its competitive edge in non-incremental linking and initial linking phases:

Linker rustc-driver (Time ms) ± SD Clang (Time ms) ± SD
GNU ld (2.38) 20774 ± 855 8784 ± 42
gold (2.38) 6796 ± 58 2528 ± 37
lld (18.1.8) 1601 ± 24 1679 ± 23
mold (2.34.1) 946 ± 17 429 ± 2
wild (2024-11-30) 486 ± 19 244 ± 6

With debug info, Wild’s performance is currently less competitive.

Linking Rust Code

To build and test crates with Wild, the following command can be used:

RUSTFLAGS="-Clinker=clang -Clink-args=--ld-path=wild" cargo test

Contributing