From f46aceaaf75e6072e4e7227d71bcbf0119201212 Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Thu, 14 Mar 2024 11:06:39 -0700 Subject: [PATCH] Restore correct version of comment and fix logic bug --- compiler/rustc_codegen_ssa/src/back/link.rs | 10 +++++----- 1 file 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; }