Auto merge of #116515 - petrochenkov:nolegflavor, r=lqd

linker: Remove unstable legacy CLI linker flavors
This commit is contained in:
bors 2023-10-08 15:18:22 +00:00
commit bf9a1c8a19
5 changed files with 12 additions and 23 deletions

View File

@ -184,8 +184,6 @@ pub enum LinkerFlavorCli {
Ld,
Lld(LldFlavor),
Em,
BpfLinker,
PtxLinker,
}
impl LinkerFlavorCli {
@ -199,9 +197,7 @@ impl LinkerFlavorCli {
| LinkerFlavorCli::Msvc(Lld::Yes)
| LinkerFlavorCli::EmCc
| LinkerFlavorCli::Bpf
| LinkerFlavorCli::Ptx
| LinkerFlavorCli::BpfLinker
| LinkerFlavorCli::PtxLinker => true,
| LinkerFlavorCli::Ptx => true,
LinkerFlavorCli::Gcc
| LinkerFlavorCli::Ld
| LinkerFlavorCli::Lld(..)
@ -279,8 +275,6 @@ impl LinkerFlavor {
LinkerFlavorCli::Lld(LldFlavor::Wasm) => LinkerFlavor::WasmLld(Cc::No),
LinkerFlavorCli::Lld(LldFlavor::Link) => LinkerFlavor::Msvc(Lld::Yes),
LinkerFlavorCli::Em => LinkerFlavor::EmCc,
LinkerFlavorCli::BpfLinker => LinkerFlavor::Bpf,
LinkerFlavorCli::PtxLinker => LinkerFlavor::Ptx,
}
}
@ -299,8 +293,8 @@ impl LinkerFlavor {
LinkerFlavor::Msvc(Lld::Yes) => LinkerFlavorCli::Lld(LldFlavor::Link),
LinkerFlavor::Msvc(..) => LinkerFlavorCli::Msvc(Lld::No),
LinkerFlavor::EmCc => LinkerFlavorCli::Em,
LinkerFlavor::Bpf => LinkerFlavorCli::BpfLinker,
LinkerFlavor::Ptx => LinkerFlavorCli::PtxLinker,
LinkerFlavor::Bpf => LinkerFlavorCli::Bpf,
LinkerFlavor::Ptx => LinkerFlavorCli::Ptx,
}
}
@ -320,7 +314,6 @@ impl LinkerFlavor {
LinkerFlavorCli::Ld => (Some(Cc::No), Some(Lld::No)),
LinkerFlavorCli::Lld(_) => (Some(Cc::No), Some(Lld::Yes)),
LinkerFlavorCli::Em => (Some(Cc::Yes), Some(Lld::Yes)),
LinkerFlavorCli::BpfLinker | LinkerFlavorCli::PtxLinker => (None, None),
}
}
@ -519,8 +512,6 @@ linker_flavor_cli_impls! {
(LinkerFlavorCli::Lld(LldFlavor::Link)) "lld-link"
(LinkerFlavorCli::Lld(LldFlavor::Wasm)) "wasm-ld"
(LinkerFlavorCli::Em) "em"
(LinkerFlavorCli::BpfLinker) "bpf-linker"
(LinkerFlavorCli::PtxLinker) "ptx-linker"
}
impl ToJson for LinkerFlavorCli {

View File

@ -249,11 +249,9 @@ flavor. Valid options are:
* `gcc`: use the `cc` executable, which is typically gcc or clang on many systems.
* `ld`: use the `ld` executable.
* `msvc`: use the `link.exe` executable from Microsoft Visual Studio MSVC.
* `ptx-linker`: use
[`rust-ptx-linker`](https://github.com/denzp/rust-ptx-linker) for Nvidia
NVPTX GPGPU support.
* `bpf-linker`: use
[`bpf-linker`](https://github.com/alessandrod/bpf-linker) for eBPF support.
* `ptx`: use [`rust-ptx-linker`](https://github.com/denzp/rust-ptx-linker)
for Nvidia NVPTX GPGPU support.
* `bpf`: use [`bpf-linker`](https://github.com/alessandrod/bpf-linker) for eBPF support.
* `wasm-ld`: use the [`wasm-ld`](https://lld.llvm.org/WebAssembly.html)
executable, a port of LLVM `lld` for WebAssembly.
* `ld64.lld`: use the LLVM `lld` executable with the [`-flavor darwin`

View File

@ -1,2 +1,2 @@
error: the linker flavor `bpf-linker` is unstable, the `-Z unstable-options` flag must also be passed to use the unstable values
error: the linker flavor `bpf` is unstable, the `-Z unstable-options` flag must also be passed to use the unstable values

View File

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

View File

@ -3,11 +3,11 @@
// caller). If it passes, all the other unstable options are rejected as well.
//
// revisions: bpf ptx
// [bpf] compile-flags: --target=bpfel-unknown-none -C linker-flavor=bpf-linker --crate-type=rlib
// [bpf] error-pattern: linker flavor `bpf-linker` is unstable, the `-Z unstable-options` flag
// [bpf] compile-flags: --target=bpfel-unknown-none -C linker-flavor=bpf --crate-type=rlib
// [bpf] error-pattern: linker flavor `bpf` is unstable, the `-Z unstable-options` flag
// [bpf] needs-llvm-components:
// [ptx] compile-flags: --target=nvptx64-nvidia-cuda -C linker-flavor=ptx-linker --crate-type=rlib
// [ptx] error-pattern: linker flavor `ptx-linker` is unstable, the `-Z unstable-options` flag
// [ptx] compile-flags: --target=nvptx64-nvidia-cuda -C linker-flavor=ptx --crate-type=rlib
// [ptx] error-pattern: linker flavor `ptx` is unstable, the `-Z unstable-options` flag
// [ptx] needs-llvm-components:
#![feature(no_core)]