prepare stabilization of modern linker-flavors

fix a few comments
This commit is contained in:
Rémy Rakic 2023-09-20 17:00:57 +00:00
parent bf9a1c8a19
commit 71285c1da0
2 changed files with 7 additions and 8 deletions

View File

@ -2758,9 +2758,8 @@ pub fn build_session_options(
} }
// For testing purposes, until we have more feedback about these options: ensure `-Z // For testing purposes, until we have more feedback about these options: ensure `-Z
// unstable-options` is required when using the unstable `-C link-self-contained` options, like // unstable-options` is required when using the unstable `-C link-self-contained` and `-C
// `-C link-self-contained=+linker`, and when using the unstable `-C linker-flavor` options, like // linker-flavor` options.
// `-C linker-flavor=gnu-lld-cc`.
if !nightly_options::is_unstable_enabled(matches) { if !nightly_options::is_unstable_enabled(matches) {
let uses_unstable_self_contained_option = let uses_unstable_self_contained_option =
cg.link_self_contained.are_unstable_variants_set(); cg.link_self_contained.are_unstable_variants_set();

View File

@ -164,11 +164,11 @@ pub enum LinkerFlavor {
/// Linker flavors available externally through command line (`-Clinker-flavor`) /// Linker flavors available externally through command line (`-Clinker-flavor`)
/// or json target specifications. /// or json target specifications.
/// FIXME: This set has accumulated historically, bring it more in line with the internal /// This set has accumulated historically, and contains both (stable and unstable) legacy values, as
/// linker flavors (`LinkerFlavor`). /// well as modern ones matching the internal linker flavors (`LinkerFlavor`).
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)] #[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub enum LinkerFlavorCli { pub enum LinkerFlavorCli {
// New (unstable) flavors, with direct counterparts in `LinkerFlavor`. // Modern (unstable) flavors, with direct counterparts in `LinkerFlavor`.
Gnu(Cc, Lld), Gnu(Cc, Lld),
Darwin(Cc, Lld), Darwin(Cc, Lld),
WasmLld(Cc), WasmLld(Cc),
@ -179,7 +179,7 @@ pub enum LinkerFlavorCli {
Bpf, Bpf,
Ptx, Ptx,
// Below: the legacy stable values. // Legacy stable values
Gcc, Gcc,
Ld, Ld,
Lld(LldFlavor), Lld(LldFlavor),
@ -504,7 +504,7 @@ linker_flavor_cli_impls! {
(LinkerFlavorCli::Bpf) "bpf" (LinkerFlavorCli::Bpf) "bpf"
(LinkerFlavorCli::Ptx) "ptx" (LinkerFlavorCli::Ptx) "ptx"
// Below: legacy stable values // Legacy stable flavors
(LinkerFlavorCli::Gcc) "gcc" (LinkerFlavorCli::Gcc) "gcc"
(LinkerFlavorCli::Ld) "ld" (LinkerFlavorCli::Ld) "ld"
(LinkerFlavorCli::Lld(LldFlavor::Ld)) "ld.lld" (LinkerFlavorCli::Lld(LldFlavor::Ld)) "ld.lld"