about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
diff options
context:
space:
mode:
authorChris Wailes <chriswailes@google.com>2024-03-14 11:06:39 -0700
committerChris Wailes <chriswailes@google.com>2024-03-14 11:06:39 -0700
commitf46aceaaf75e6072e4e7227d71bcbf0119201212 (patch)
tree52c56afad52f8c890b4250b928d58053b389ca43 /compiler/rustc_codegen_ssa
parentbf2858a05f510b8a0317d25d7dc587afbd16acfc (diff)
downloadrust-f46aceaaf75e6072e4e7227d71bcbf0119201212.tar.gz
rust-f46aceaaf75e6072e4e7227d71bcbf0119201212.zip
Restore correct version of comment and fix logic bug
Diffstat (limited to 'compiler/rustc_codegen_ssa')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index 0491b3a2695..8d01832c678 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1213,16 +1213,16 @@ fn add_sanitizer_libraries(
         return;
     }
 
-    // On macOS the runtimes are distributed as dylibs which should be linked to
-    // both executables and dynamic shared objects. On most other platforms the
-    // runtimes are currently distributed as static libraries which should be
-    // linked to executables only.
     if matches!(crate_type, CrateType::Rlib | CrateType::Staticlib) {
         return;
     }
 
+    // On macOS and Windows using MSVC the runtimes are distributed as dylibs
+    // which should be linked to both executables and dynamic libraries.
+    // Everywhere else the runtimes are currently distributed as static
+    // libraries which should be linked to executables only.
     if matches!(crate_type, CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro)
-        && (sess.target.is_like_osx || sess.target.is_like_msvc)
+        && !(sess.target.is_like_osx || sess.target.is_like_msvc)
     {
         return;
     }