From 3bf80d67c8a77c0719e24d9b5687a9ba87c70ac7 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Wed, 20 Sep 2023 10:35:41 +0200 Subject: [PATCH] Mirror clang's link stage on Windows. Fixes problem discussed in #811. --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index f3e921bf4..5bf5fc9f2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1763,6 +1763,10 @@ impl Build { // depending on the origin clang can default to a mismatchig // run-time. cmd.push_cc_arg(format!("--target={}", target).into()); + if target.contains("msvc") { + // Mirror what clang does at link stage + self.print(&format_args!("cargo:rustc-link-lib=oldnames")); + } } if cmd.family == ToolFamily::Clang && target.contains("android") {