[llvm] Workaround MSVC Linker Issue when Cross-Compiling for ARM64EC (PR #143659)

Jiachen Yuan via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 11 10:04:24 PDT 2025


https://github.com/JiachenYuan updated https://github.com/llvm/llvm-project/pull/143659

>From f77d33e39d652c4af04684d34137430fcf740c06 Mon Sep 17 00:00:00 2001
From: Jiachen Yuan <jiacheny at nvidia.com>
Date: Wed, 11 Jun 2025 10:04:00 -0700
Subject: [PATCH] use indirect assignment

---
 llvm/include/llvm/IR/Mangler.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/IR/Mangler.h b/llvm/include/llvm/IR/Mangler.h
index e3dfe1eac6189..232101a8926b7 100644
--- a/llvm/include/llvm/IR/Mangler.h
+++ b/llvm/include/llvm/IR/Mangler.h
@@ -26,7 +26,16 @@ class Triple;
 class Twine;
 class raw_ostream;
 
-constexpr std::string_view HybridPatchableTargetSuffix = "$hp_target";
+// TODO: The weird assignment of HybridPatchableTargetSuffix below is a
+// temporary workaround for a linker failure that is only hit when compiling
+// llvm for arm64ec on windows. The description and context of the issue is at
+// https://github.com/llvm/llvm-project/issues/143575.
+// An upstream MSVC bug is filed at
+// https://developercommunity.visualstudio.com/t/MSVC-Linker-Issue-When-Cross-
+// Compiling-L/10920141.
+constexpr char HybridPatchableTargetSuffixArr[] = "$hp_target";
+constexpr std::string_view HybridPatchableTargetSuffix =
+    HybridPatchableTargetSuffixArr;
 
 class Mangler {
   /// We need to give global values the same name every time they are mangled.



More information about the llvm-commits mailing list