Skip to content

Commit d7b153f

Browse files
committed
Patch remaining GHC versions
1 parent 1748a4f commit d7b153f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

overlays/bootstrap.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ in {
259259
++ onWindows (fromUntil "9.2" "9.4" ./patches/ghc/windows-pseudo-pic-9.2.patch)
260260

261261
# Fix issue loading windows dll using `.dll.a` file
262+
++ onWindows (until "9.4" ./patches/ghc/ghc-9.2-windows-dll-dependent-symbol-type-fix.patch)
262263
++ onWindows (fromUntil "9.4" "9.12" ./patches/ghc/ghc-9.10-windows-dll-dependent-symbol-type-fix.patch)
263264
;
264265
in ({
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
2+
index 8622166..531ed4d 100644
3+
--- a/rts/linker/PEi386.c
4+
+++ b/rts/linker/PEi386.c
5+
@@ -2076,10 +2076,13 @@
6+
}
7+
else if (pinfo && pinfo->owner && isSymbolImport (pinfo->owner, lbl))
8+
{
9+
- /* See Note [BFD import library]. */
10+
- HINSTANCE dllInstance = (HINSTANCE)lookupDependentSymbol(pinfo->value, NULL);
11+
- if (!dllInstance && pinfo->value)
12+
+ // we only want to _update_ the type, if the dependent symbol is _not_ a dllInstance.
13+
+ SymType depType = 0;
14+
+ HINSTANCE dllInstance = (HINSTANCE)lookupDependentSymbol(pinfo->value, dependent, &depType);
15+
+ if (!dllInstance && pinfo->value) {
16+
+ *type = depType;
17+
return pinfo->value;
18+
+ }
19+
20+
if (!dllInstance)
21+
{

0 commit comments

Comments
 (0)