-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…5dd7254a439aea31dfae32d5 to ghc 8.10
- Loading branch information
1 parent
aabf926
commit d9e73e3
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
overlays/patches/ghc/ghc-8.10-global-unique-counters-in-rts.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
diff --git a/compiler/cbits/genSym.c b/compiler/cbits/genSym.c | ||
index ecb318d5a8..8e70db33fc 100644 | ||
--- a/compiler/cbits/genSym.c | ||
+++ b/compiler/cbits/genSym.c | ||
@@ -1,9 +1,15 @@ | ||
#include <Rts.h> | ||
#include <assert.h> | ||
#include "Unique.h" | ||
+#include "ghcversion.h" | ||
|
||
+// These global variables have been moved into the RTS. It allows them to be | ||
+// shared with plugins even if two different instances of the GHC library are | ||
+// loaded at the same time (#19940) | ||
+#if !MIN_VERSION_GLASGOW_HASKELL(8,10,0,0) | ||
static HsInt GenSymCounter = 0; | ||
static HsInt GenSymInc = 1; | ||
+#endif | ||
|
||
#define UNIQUE_BITS (sizeof (HsInt) * 8 - UNIQUE_TAG_BITS) | ||
#define UNIQUE_MASK ((1ULL << UNIQUE_BITS) - 1) | ||
diff --git a/includes/rts/Globals.h b/includes/rts/Globals.h | ||
index ff36572c56..12db025423 100644 | ||
--- a/includes/rts/Globals.h | ||
+++ b/includes/rts/Globals.h | ||
@@ -34,3 +34,5 @@ mkStoreAccessorPrototype(LibHSghcInitLinkerDone) | ||
mkStoreAccessorPrototype(LibHSghcGlobalDynFlags) | ||
mkStoreAccessorPrototype(LibHSghcStaticOptions) | ||
mkStoreAccessorPrototype(LibHSghcStaticOptionsReady) | ||
+extern HsInt GenSymCounter; | ||
+extern HsInt GenSymInc; | ||
diff --git a/rts/Globals.c b/rts/Globals.c | ||
index c9980d9a3a..56522937ef 100644 | ||
--- a/rts/Globals.c | ||
+++ b/rts/Globals.c | ||
@@ -111,3 +111,5 @@ mkStoreAccessor(LibHSghcInitLinkerDone) | ||
mkStoreAccessor(LibHSghcGlobalDynFlags) | ||
mkStoreAccessor(LibHSghcStaticOptions) | ||
mkStoreAccessor(LibHSghcStaticOptionsReady) | ||
+HsInt GenSymCounter = 0; | ||
+HsInt GenSymInc = 1; | ||
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c | ||
index d5b8cc5fec..7ed561ff3f 100644 | ||
--- a/rts/RtsSymbols.c | ||
+++ b/rts/RtsSymbols.c | ||
@@ -646,6 +646,8 @@ | ||
SymI_HasProto(getOrSetLibHSghcPersistentLinkerState) \ | ||
SymI_HasProto(getOrSetLibHSghcInitLinkerDone) \ | ||
SymI_HasProto(getOrSetLibHSghcGlobalDynFlags) \ | ||
+ SymI_HasProto(GenSymCounter) \ | ||
+ SymI_HasProto(GenSymInc) \ | ||
SymI_HasProto(genericRaise) \ | ||
SymI_HasProto(getProgArgv) \ | ||
SymI_HasProto(getFullProgArgv) \ |