@@ -0,0 +1,20 @@
1+diff --git a/compiler/cbits/genSym.c b/compiler/cbits/genSym.c
2+index ecb318d5a8..8e70db33fc 100644
3+--- a/compiler/cbits/genSym.c
4++++ b/compiler/cbits/genSym.c
5+@@ -1,9 +1,15 @@
6+ #include <Rts.h>
7+ #include <assert.h>
8+ #include "Unique.h"
9++#include "ghcversion.h"
10+
11++// These global variables have been moved into the RTS. It allows them to be
12++// shared with plugins even if two different instances of the GHC library are
13++// loaded at the same time (#19940)
14++#if !MIN_VERSION_GLASGOW_HASKELL(9,2,0,0)
15+ HsInt ghc_unique_counter = 0;
16+ HsInt ghc_unique_inc = 1;
17++#endif
18+
19+ #define UNIQUE_BITS (sizeof (HsInt) * 8 - UNIQUE_TAG_BITS)
20+ #define UNIQUE_MASK ((1ULL << UNIQUE_BITS) - 1)