Skip to main content

linker

Specifies the linker.

linker ("value")

Parameters​

value is one of:

ValueDescriptionNotes
DefaultUse the toolset default linker.
BFDUse the GNU BFD linker (ld.bfd).Supported by Clang and GCC.
GoldUse the GNU gold linker (ld.gold).Supported by Clang and GCC. Deprecated since binutils 2.44.
LLDUse LLVM's LLD linker.Supported by Clang and GCC 9 or later.
MoldUse the mold linker.Supported by Clang and GCC 12.1 or later.
WildUse the Wild linker.Supported by Clang and GCC 16.1 or later.

The selected linker is passed to the compiler driver as -fuse-ld=<name>. The linker itself must be installed (i.e. found on the PATH).

Applies To​

Project configurations.

Availability​

Premake 5.0.0-beta3 or later. BFD, Gold, Mold and Wild are available in the latest Premake master.

Examples​

Sets LLD as the linker.

filter { "toolset:clang" }
linker "LLD"

Configures GCC to use the Mold linker.

filter { "toolset:gcc" }
linker "Mold"