Skip to content

Commit 0d13bfa

Browse files
committed
prepare stabilization of modern linker-flavors
fix a few comments
1 parent 4f4a413 commit 0d13bfa

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,9 +2758,8 @@ pub fn build_session_options(
27582758
}
27592759

27602760
// For testing purposes, until we have more feedback about these options: ensure `-Z
2761-
// unstable-options` is required when using the unstable `-C link-self-contained` options, like
2762-
// `-C link-self-contained=+linker`, and when using the unstable `-C linker-flavor` options, like
2763-
// `-C linker-flavor=gnu-lld-cc`.
2761+
// unstable-options` is required when using the unstable `-C link-self-contained` and `-C
2762+
// linker-flavor` options.
27642763
if !nightly_options::is_unstable_enabled(matches) {
27652764
let uses_unstable_self_contained_option =
27662765
cg.link_self_contained.are_unstable_variants_set();

compiler/rustc_target/src/spec/mod.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ pub enum LinkerFlavor {
164164

165165
/// Linker flavors available externally through command line (`-Clinker-flavor`)
166166
/// or json target specifications.
167-
/// FIXME: This set has accumulated historically, bring it more in line with the internal
168-
/// linker flavors (`LinkerFlavor`).
167+
/// This set has accumulated historically, and contains both (stable and unstable) legacy values, as
168+
/// well as modern ones matching the internal linker flavors (`LinkerFlavor`).
169169
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
170170
pub enum LinkerFlavorCli {
171-
// New (unstable) flavors, with direct counterparts in `LinkerFlavor`.
171+
// Modern (unstable) flavors, with direct counterparts in `LinkerFlavor`.
172172
Gnu(Cc, Lld),
173173
Darwin(Cc, Lld),
174174
WasmLld(Cc),
@@ -179,11 +179,13 @@ pub enum LinkerFlavorCli {
179179
Bpf,
180180
Ptx,
181181

182-
// Below: the legacy stable values.
182+
// Legacy stable values
183183
Gcc,
184184
Ld,
185185
Lld(LldFlavor),
186186
Em,
187+
188+
// Legacy unstable values
187189
BpfLinker,
188190
PtxLinker,
189191
}
@@ -511,14 +513,16 @@ linker_flavor_cli_impls! {
511513
(LinkerFlavorCli::Bpf) "bpf"
512514
(LinkerFlavorCli::Ptx) "ptx"
513515

514-
// Below: legacy stable values
516+
// Legacy stable flavors
515517
(LinkerFlavorCli::Gcc) "gcc"
516518
(LinkerFlavorCli::Ld) "ld"
517519
(LinkerFlavorCli::Lld(LldFlavor::Ld)) "ld.lld"
518520
(LinkerFlavorCli::Lld(LldFlavor::Ld64)) "ld64.lld"
519521
(LinkerFlavorCli::Lld(LldFlavor::Link)) "lld-link"
520522
(LinkerFlavorCli::Lld(LldFlavor::Wasm)) "wasm-ld"
521523
(LinkerFlavorCli::Em) "em"
524+
525+
// Legacy unstable flavors
522526
(LinkerFlavorCli::BpfLinker) "bpf-linker"
523527
(LinkerFlavorCli::PtxLinker) "ptx-linker"
524528
}

0 commit comments

Comments
 (0)