about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorMartin Nordholts <martin.nordholts@codetale.se>2024-06-13 20:42:12 +0200
committerMartin Nordholts <martin.nordholts@codetale.se>2024-06-14 19:29:23 +0200
commit04af37170cc6a608f87b48706d49be3504585f58 (patch)
treeda4418bf7722c2faf60d994da7b96080ee1058f3 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent7ac6c2fc685681824fbfc156b38035df743881dd (diff)
downloadrust-04af37170cc6a608f87b48706d49be3504585f58.tar.gz
rust-04af37170cc6a608f87b48706d49be3504585f58.zip
Also sort `crt-static` in `--print target-features` output
I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`),
because it was put at the bottom the large and otherwise sorted list.

Fully sort the list before we print it.

Note that `llvm_target_features` starts out sorted and does not need to
be sorted an extra time.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index 53b9b530e9b..7e0f264a4ae 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -394,10 +394,15 @@ fn print_target_features(out: &mut dyn PrintBackendInfo, sess: &Session, tm: &ll
             (*feature, desc)
         })
         .collect::<Vec<_>>();
+
+    // Since we add this at the end ...
     rustc_target_features.extend_from_slice(&[(
         "crt-static",
         "Enables C Run-time Libraries to be statically linked",
     )]);
+    // ... we need to sort the list again.
+    rustc_target_features.sort();
+
     llvm_target_features.retain(|(f, _d)| !known_llvm_target_features.contains(f));
 
     let max_feature_len = llvm_target_features