Skip to content

Commit

Permalink
Patch remaining GHC versions
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Jun 19, 2024
1 parent 1748a4f commit d7b153f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions overlays/bootstrap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ in {
++ onWindows (fromUntil "9.2" "9.4" ./patches/ghc/windows-pseudo-pic-9.2.patch)

# Fix issue loading windows dll using `.dll.a` file
++ onWindows (until "9.4" ./patches/ghc/ghc-9.2-windows-dll-dependent-symbol-type-fix.patch)
++ onWindows (fromUntil "9.4" "9.12" ./patches/ghc/ghc-9.10-windows-dll-dependent-symbol-type-fix.patch)
;
in ({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c
index 8622166..531ed4d 100644
--- a/rts/linker/PEi386.c
+++ b/rts/linker/PEi386.c
@@ -2076,10 +2076,13 @@
}
else if (pinfo && pinfo->owner && isSymbolImport (pinfo->owner, lbl))
{
- /* See Note [BFD import library]. */
- HINSTANCE dllInstance = (HINSTANCE)lookupDependentSymbol(pinfo->value, NULL);
- if (!dllInstance && pinfo->value)
+ // we only want to _update_ the type, if the dependent symbol is _not_ a dllInstance.
+ SymType depType = 0;
+ HINSTANCE dllInstance = (HINSTANCE)lookupDependentSymbol(pinfo->value, dependent, &depType);
+ if (!dllInstance && pinfo->value) {
+ *type = depType;
return pinfo->value;
+ }

if (!dllInstance)
{

0 comments on commit d7b153f

Please sign in to comment.