Skip to main content

Module fastlink

Module fastlink 

Source
Expand description

Zero-install fast linker.

rustup ships LLVM’s linkers inside every toolchain, next to the target’s std: <sysroot>/lib/rustlib/<host>/bin/gcc-ld/ contains ld.lld (ELF), lld-link (COFF/MSVC) and the Apple/WebAssembly variants. No mold, no lld package, no clang needed.

epicenter setup --fast wires that directory into Cargo:

  • GNU/ELF hosts keep the system C compiler as the linker driver and pass -C link-arg=-fuse-ld=lld -C link-arg=-B<gcc-ld> — a flag GCC and Clang both understand, with -B making the bundled ld.lld discoverable.
  • MSVC hosts cannot use -fuse-ld (the driver is link.exe): rustc is pointed directly at the bundled lld-link.exe with -C linker=….

Apple’s ld64.lld is not a drop-in for the system linker, so --fast refuses macOS instead of producing fragile builds.

Structs§

FastLinker
The bundled LLD for the active rustup toolchain.

Enums§

Flavor
How the bundled LLD is invoked on this host.

Functions§

detect
Detect the bundled LLD for the active toolchain’s host.
locate
Pure detection against a known sysroot/host (unit-testable).