Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0a4f5d5

Browse files
committed
prepare stabilization of modern linker-flavors
fix a few comments
1 parent 27e4926 commit 0a4f5d5

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
@@ -2746,9 +2746,8 @@ pub fn build_session_options(
27462746
}
27472747

27482748
// For testing purposes, until we have more feedback about these options: ensure `-Z
2749-
// unstable-options` is required when using the unstable `-C link-self-contained` options, like
2750-
// `-C link-self-contained=+linker`, and when using the unstable `-C linker-flavor` options, like
2751-
// `-C linker-flavor=gnu-lld-cc`.
2749+
// unstable-options` is required when using the unstable `-C link-self-contained` and `-C
2750+
// linker-flavor` options.
27522751
if !nightly_options::is_unstable_enabled(matches) {
27532752
let uses_unstable_self_contained_option =
27542753
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
@@ -162,11 +162,11 @@ pub enum LinkerFlavor {
162162

163163
/// Linker flavors available externally through command line (`-Clinker-flavor`)
164164
/// or json target specifications.
165-
/// FIXME: This set has accumulated historically, bring it more in line with the internal
166-
/// linker flavors (`LinkerFlavor`).
165+
/// This set has accumulated historically, and contains both (stable and unstable) legacy values, as
166+
/// well as modern ones matching the internal linker flavors (`LinkerFlavor`).
167167
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
168168
pub enum LinkerFlavorCli {
169-
// New (unstable) flavors, with direct counterparts in `LinkerFlavor`.
169+
// Modern (unstable) flavors, with direct counterparts in `LinkerFlavor`.
170170
Gnu(Cc, Lld),
171171
Darwin(Cc, Lld),
172172
WasmLld(Cc),
@@ -177,11 +177,13 @@ pub enum LinkerFlavorCli {
177177
Bpf,
178178
Ptx,
179179

180-
// Below: the legacy stable values.
180+
// Legacy stable values
181181
Gcc,
182182
Ld,
183183
Lld(LldFlavor),
184184
Em,
185+
186+
// Legacy unstable values
185187
BpfLinker,
186188
PtxLinker,
187189
}
@@ -509,14 +511,16 @@ linker_flavor_cli_impls! {
509511
(LinkerFlavorCli::Bpf) "bpf"
510512
(LinkerFlavorCli::Ptx) "ptx"
511513

512-
// Below: legacy stable values
514+
// Legacy stable flavors
513515
(LinkerFlavorCli::Gcc) "gcc"
514516
(LinkerFlavorCli::Ld) "ld"
515517
(LinkerFlavorCli::Lld(LldFlavor::Ld)) "ld.lld"
516518
(LinkerFlavorCli::Lld(LldFlavor::Ld64)) "ld64.lld"
517519
(LinkerFlavorCli::Lld(LldFlavor::Link)) "lld-link"
518520
(LinkerFlavorCli::Lld(LldFlavor::Wasm)) "wasm-ld"
519521
(LinkerFlavorCli::Em) "em"
522+
523+
// Legacy unstable flavors
520524
(LinkerFlavorCli::BpfLinker) "bpf-linker"
521525
(LinkerFlavorCli::PtxLinker) "ptx-linker"
522526
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /