Linkage Flags (v0.2.1)

Flags that select or configure the external linker toolchain.

Latest

Overview

These flags control which external C or C++ compiler participates in the linking stage and what raw arguments it receives.

Reference source: thrustc/thrustc_cli/src/help.rs

Back to command line reference

-link-with-clang

Specify the external Clang binary used for the linking stage.

Accepts value: yes

Value syntax: path/to/clang

Details

This forces the linker driver to use a specific Clang executable instead of automatic detection.

It is useful when more than one LLVM or Clang toolchain is installed on the machine.

Examples

thrustc main.thrust -link-with-clang /usr/bin/clang

Notes

-link-with-gcc

Specify the external GCC binary used for the linking stage.

Accepts value: yes

Value syntax: path/to/gcc

Details

This selects GCC as the external linking compiler.

Use it when you want GCC-specific linking behavior or when GCC is the available host linker toolchain.

Examples

thrustc main.thrust -link-with-gcc /usr/bin/gcc

Notes

-cc-args

Forward raw arguments to the active external C or C++ linking compiler.

Accepts value: yes

Value syntax: "-lm;-lz"

Details

This is the escape hatch for linker or C compiler options that do not have a first-class Thrust flag.

Arguments can be separated by spaces or semicolons inside the raw string.

Examples

thrustc main.thrust -cc-args "-lm;-lz"

Notes