Allow unregisterised ghc-8.4 to build newer GHC
authorDebian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>
Tue, 24 Mar 2020 01:50:31 +0000 (01:50 +0000)
committerSandro Tosi <morph@debian.org>
Tue, 24 Mar 2020 01:50:31 +0000 (01:50 +0000)
Commit 4075656e8bb introduced a regression stopping existing unregisteristed
compilers from being able to compile newer versions of GHC. The problem is
that the bootstrap compiler uses the newer `rts/storage/ClosureTypes.h` file
where some defines have been renamed, resulting in the following error:
.
  error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’?
.
 For more information, see https://gitlab.haskell.org/ghc/ghc/issues/15913.
.
 This patch can be removed, once ghc-8.4 is no longer the bootstrap compiler.
Author: Ilias Tsitsimpis <iliastsi@debian.org>
Bug: https://gitlab.haskell.org/ghc/ghc/issues/15913
Bug-Debian: https://bugs.debian.org/932941

Gbp-Pq: Name fix-build-using-unregisterized-v8.4

includes/rts/storage/ClosureTypes.h
includes/stg/MiscClosures.h

index 85dc1a0ce45bad2780404d9b845add83bcd9c298..439ead35851ff1cbb9e958ee27f1124d25ccd546 100644 (file)
 #define SMALL_MUT_ARR_PTRS_DIRTY      60
 #define SMALL_MUT_ARR_PTRS_FROZEN_DIRTY 61
 #define SMALL_MUT_ARR_PTRS_FROZEN_CLEAN 62
+#if __GLASGOW_HASKELL__ < 806
+#define SMALL_MUT_ARR_PTRS_FROZEN0 SMALL_MUT_ARR_PTRS_FROZEN_DIRTY
+#define SMALL_MUT_ARR_PTRS_FROZEN SMALL_MUT_ARR_PTRS_FROZEN_CLEAN
+#define MUT_ARR_PTRS_FROZEN0 MUT_ARR_PTRS_FROZEN_DIRTY
+#define MUT_ARR_PTRS_FROZEN MUT_ARR_PTRS_FROZEN_CLEAN
+#endif
 #define COMPACT_NFDATA                63
 #define N_CLOSURE_TYPES               64
index 98363b342b799588eec5bea31d40c31af579df4b..24b6cd4e250545b4d2082321aaa2b81468f8a9e9 100644 (file)
@@ -116,12 +116,22 @@ RTS_ENTRY(stg_ARR_WORDS);
 RTS_ENTRY(stg_MUT_ARR_WORDS);
 RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN);
 RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY);
+#if __GLASGOW_HASKELL__ < 806
+RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN);
+RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0);
+#else
 RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_CLEAN);
 RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_DIRTY);
+#endif
 RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_CLEAN);
 RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_DIRTY);
+#if __GLASGOW_HASKELL__ < 806
+RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN);
+RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN0);
+#else
 RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_CLEAN);
 RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_DIRTY);
+#endif
 RTS_ENTRY(stg_MUT_VAR_CLEAN);
 RTS_ENTRY(stg_MUT_VAR_DIRTY);
 RTS_ENTRY(stg_END_TSO_QUEUE);