Skip to content

Commit bf9a1c8

Browse files
committed
Auto merge of #116515 - petrochenkov:nolegflavor, r=lqd
linker: Remove unstable legacy CLI linker flavors
2 parents 4f4a413 + 7ecb09d commit bf9a1c8

File tree

5 files changed

+12
-23
lines changed

5 files changed

+12
-23
lines changed

compiler/rustc_target/src/spec/mod.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ pub enum LinkerFlavorCli {
184184
Ld,
185185
Lld(LldFlavor),
186186
Em,
187-
BpfLinker,
188-
PtxLinker,
189187
}
190188

191189
impl LinkerFlavorCli {
@@ -199,9 +197,7 @@ impl LinkerFlavorCli {
199197
| LinkerFlavorCli::Msvc(Lld::Yes)
200198
| LinkerFlavorCli::EmCc
201199
| LinkerFlavorCli::Bpf
202-
| LinkerFlavorCli::Ptx
203-
| LinkerFlavorCli::BpfLinker
204-
| LinkerFlavorCli::PtxLinker => true,
200+
| LinkerFlavorCli::Ptx => true,
205201
LinkerFlavorCli::Gcc
206202
| LinkerFlavorCli::Ld
207203
| LinkerFlavorCli::Lld(..)
@@ -279,8 +275,6 @@ impl LinkerFlavor {
279275
LinkerFlavorCli::Lld(LldFlavor::Wasm) => LinkerFlavor::WasmLld(Cc::No),
280276
LinkerFlavorCli::Lld(LldFlavor::Link) => LinkerFlavor::Msvc(Lld::Yes),
281277
LinkerFlavorCli::Em => LinkerFlavor::EmCc,
282-
LinkerFlavorCli::BpfLinker => LinkerFlavor::Bpf,
283-
LinkerFlavorCli::PtxLinker => LinkerFlavor::Ptx,
284278
}
285279
}
286280

@@ -299,8 +293,8 @@ impl LinkerFlavor {
299293
LinkerFlavor::Msvc(Lld::Yes) => LinkerFlavorCli::Lld(LldFlavor::Link),
300294
LinkerFlavor::Msvc(..) => LinkerFlavorCli::Msvc(Lld::No),
301295
LinkerFlavor::EmCc => LinkerFlavorCli::Em,
302-
LinkerFlavor::Bpf => LinkerFlavorCli::BpfLinker,
303-
LinkerFlavor::Ptx => LinkerFlavorCli::PtxLinker,
296+
LinkerFlavor::Bpf => LinkerFlavorCli::Bpf,
297+
LinkerFlavor::Ptx => LinkerFlavorCli::Ptx,
304298
}
305299
}
306300

@@ -320,7 +314,6 @@ impl LinkerFlavor {
320314
LinkerFlavorCli::Ld => (Some(Cc::No), Some(Lld::No)),
321315
LinkerFlavorCli::Lld(_) => (Some(Cc::No), Some(Lld::Yes)),
322316
LinkerFlavorCli::Em => (Some(Cc::Yes), Some(Lld::Yes)),
323-
LinkerFlavorCli::BpfLinker | LinkerFlavorCli::PtxLinker => (None, None),
324317
}
325318
}
326319

@@ -519,8 +512,6 @@ linker_flavor_cli_impls! {
519512
(LinkerFlavorCli::Lld(LldFlavor::Link)) "lld-link"
520513
(LinkerFlavorCli::Lld(LldFlavor::Wasm)) "wasm-ld"
521514
(LinkerFlavorCli::Em) "em"
522-
(LinkerFlavorCli::BpfLinker) "bpf-linker"
523-
(LinkerFlavorCli::PtxLinker) "ptx-linker"
524515
}
525516

526517
impl ToJson for LinkerFlavorCli {

src/doc/rustc/src/codegen-options/index.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,9 @@ flavor. Valid options are:
249249
* `gcc`: use the `cc` executable, which is typically gcc or clang on many systems.
250250
* `ld`: use the `ld` executable.
251251
* `msvc`: use the `link.exe` executable from Microsoft Visual Studio MSVC.
252-
* `ptx-linker`: use
253-
[`rust-ptx-linker`](https://github.com/denzp/rust-ptx-linker) for Nvidia
254-
NVPTX GPGPU support.
255-
* `bpf-linker`: use
256-
[`bpf-linker`](https://github.com/alessandrod/bpf-linker) for eBPF support.
252+
* `ptx`: use [`rust-ptx-linker`](https://github.com/denzp/rust-ptx-linker)
253+
for Nvidia NVPTX GPGPU support.
254+
* `bpf`: use [`bpf-linker`](https://github.com/alessandrod/bpf-linker) for eBPF support.
257255
* `wasm-ld`: use the [`wasm-ld`](https://lld.llvm.org/WebAssembly.html)
258256
executable, a port of LLVM `lld` for WebAssembly.
259257
* `ld64.lld`: use the LLVM `lld` executable with the [`-flavor darwin`
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
error: the linker flavor `bpf-linker` is unstable, the `-Z unstable-options` flag must also be passed to use the unstable values
1+
error: the linker flavor `bpf` is unstable, the `-Z unstable-options` flag must also be passed to use the unstable values
22

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
error: the linker flavor `ptx-linker` is unstable, the `-Z unstable-options` flag must also be passed to use the unstable values
1+
error: the linker flavor `ptx` is unstable, the `-Z unstable-options` flag must also be passed to use the unstable values
22

tests/ui/linkage-attr/unstable-flavor.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// caller). If it passes, all the other unstable options are rejected as well.
44
//
55
// revisions: bpf ptx
6-
// [bpf] compile-flags: --target=bpfel-unknown-none -C linker-flavor=bpf-linker --crate-type=rlib
7-
// [bpf] error-pattern: linker flavor `bpf-linker` is unstable, the `-Z unstable-options` flag
6+
// [bpf] compile-flags: --target=bpfel-unknown-none -C linker-flavor=bpf --crate-type=rlib
7+
// [bpf] error-pattern: linker flavor `bpf` is unstable, the `-Z unstable-options` flag
88
// [bpf] needs-llvm-components:
9-
// [ptx] compile-flags: --target=nvptx64-nvidia-cuda -C linker-flavor=ptx-linker --crate-type=rlib
10-
// [ptx] error-pattern: linker flavor `ptx-linker` is unstable, the `-Z unstable-options` flag
9+
// [ptx] compile-flags: --target=nvptx64-nvidia-cuda -C linker-flavor=ptx --crate-type=rlib
10+
// [ptx] error-pattern: linker flavor `ptx` is unstable, the `-Z unstable-options` flag
1111
// [ptx] needs-llvm-components:
1212

1313
#![feature(no_core)]

0 commit comments

Comments
 (0)