summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-04-06 09:11:29 -0400
committerBen Gamari <ben@smart-cactus.org>2022-04-07 09:45:07 -0400
commit9cfcb27b68e4b836bdfc92c900fc58a1ef646c0a (patch)
treee4d1e71c510624fa0db969f6ceb5208af5435106
parent7206f05586b8190e26e392eaa9e74ab3cf9f9c60 (diff)
downloadhaskell-9cfcb27b68e4b836bdfc92c900fc58a1ef646c0a.tar.gz
rts: Fallback to ucrtbase not msvcrt
Since we have switched to Clang the toolchain now links against ucrt rather than msvcrt.
-rw-r--r--rts/linker/PEi386.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index 420a50feae..82eaaaf226 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -2156,10 +2156,11 @@ SymbolAddr *lookupSymbol_PEi386(SymbolName *lbl, ObjectCode *dependent, SymType
if (pinfo->value == (void*)0xBAADF00D)
{
char symBuffer[50];
+ const char *crt_impl = "ucrtbase";
sprintf(symBuffer, "_%s", lbl);
- static HMODULE msvcrt = NULL;
- if (!msvcrt) msvcrt = GetModuleHandle("msvcrt");
- pinfo->value = GetProcAddress(msvcrt, symBuffer);
+ static HMODULE crt = NULL;
+ if (!crt) crt = GetModuleHandle(crt_impl);
+ pinfo->value = GetProcAddress(crt, symBuffer);
return pinfo->value;
}
else if (pinfo && pinfo->owner && isSymbolImport (pinfo->owner, lbl))