[llvm] [X86][Cygwin] Fix global variable dll import (PR #121439)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 1 09:11:10 PST 2025


https://github.com/Berrysoft updated https://github.com/llvm/llvm-project/pull/121439

>From 694e20e9698874b2834d21800ca5eff4f1e5e716 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E5=AE=87=E9=80=B8?= <Strawberry_Str at hotmail.com>
Date: Thu, 2 Jan 2025 02:10:45 +0900
Subject: [PATCH] [Cygwin] Fix global variable dll import

---
 llvm/lib/Target/TargetMachine.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index c0985f3be91a53..d5365f3c047437 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -204,7 +204,7 @@ bool TargetMachine::shouldAssumeDSOLocal(const GlobalValue *GV) const {
     // don't assume the variables to be DSO local unless we actually know
     // that for sure. This only has to be done for variables; for functions
     // the linker can insert thunks for calling functions from another DLL.
-    if (TT.isWindowsGNUEnvironment() && GV->isDeclarationForLinker() &&
+    if (TT.isOSCygMing() && GV->isDeclarationForLinker() &&
         isa<GlobalVariable>(GV))
       return false;
 



More information about the llvm-commits mailing list