|
| 1 | +# Unstable codegen options |
| 2 | + |
| 3 | +All of these options are passed to `rustc` via the `-C` flag, short for "codegen". The flags are |
| 4 | +stable but some of their values are individually unstable, and also require using `-Z |
| 5 | +unstable-options` to be accepted. |
| 6 | + |
| 7 | +## linker-flavor |
| 8 | + |
| 9 | +In addition to the stable set of linker flavors, the following unstable values also exist: |
| 10 | +- `ptx`: use [`rust-ptx-linker`](https://github.com/denzp/rust-ptx-linker) |
| 11 | + for Nvidia NVPTX GPGPU support. |
| 12 | +- `bpf`: use [`bpf-linker`](https://github.com/alessandrod/bpf-linker) for eBPF support. |
| 13 | + |
| 14 | +Additionally, a set of more precise linker flavors also exists, for example allowing targets to |
| 15 | +declare that they use the LLD linker by default. The following values are currently unstable, and |
| 16 | +the goal is for them to become stable, and preferred in practice over the existing stable values: |
| 17 | +- `gnu`: unix-like linker with GNU extensions |
| 18 | +- `gnu-lld`: `gnu` using LLD |
| 19 | +- `gnu-cc`: `gnu` using a C/C++ compiler as the linker driver |
| 20 | +- `gnu-lld-cc`: `gnu` using LLD and a C/C++ compiler as the linker driver |
| 21 | +- `darwin`: unix-like linker for Apple targets |
| 22 | +- `darwin-lld`: `darwin` using LLD |
| 23 | +- `darwin-cc`: `darwin` using a C/C++ compiler as the linker driver |
| 24 | +- `darwin-lld-cc`: `darwin` using LLD and a C/C++ compiler as the linker driver |
| 25 | +- `wasm-lld`: unix-like linker for Wasm targets, with LLD |
| 26 | +- `wasm-lld-cc`: unix-like linker for Wasm targets, with LLD and a C/C++ compiler as the linker |
| 27 | + driver |
| 28 | +- `unix`: basic unix-like linker for "any other Unix" targets (Solaris/illumos, L4Re, MSP430, etc), |
| 29 | + not supported with LLD. |
| 30 | +- `unix-cc`: `unix` using a C/C++ compiler as the linker driver |
| 31 | +- `msvc-lld`: MSVC-style linker for Windows and UEFI, with LLD |
| 32 | +- `em-cc`: emscripten compiler frontend, similar to `wasm-lld-cc` with a different interface |
0 commit comments