From f13d2a357e7b6cc77a9aa21c320a17c3c4452fa2 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Oct 18 2018 13:21:09 +0000 Subject: add fix-build-using-unregisterized-v8.2.patch --- diff --git a/fix-build-using-unregisterized-v8.2.patch b/fix-build-using-unregisterized-v8.2.patch new file mode 100644 index 0000000..29d7b49 --- /dev/null +++ b/fix-build-using-unregisterized-v8.2.patch @@ -0,0 +1,51 @@ +Description: Allow unregisterised ghc-8.2 to build newer GHC + Commit b68697e579d38ca29c2b84377dc2affa04659a28 introduced a regression + stopping existing unregisteristed compilers from being used to compile a newer + version of GHC. The problem is that the bootstrap compiler uses the newer Stg.h + where EB_, IB_, etc, definitions have changed resulting in the following error: +. + error: conflicting types for 'ghc_GhcPrelude_zdtrModule4_bytes' + note: in definition of macro 'EB_' + #define EB_(X) extern const char X[] + note: previous definition of 'ghc_GhcPrelude_zdtrModule4_bytes' was here + char ghc_GhcPrelude_zdtrModule4_bytes[] = "ghc"; +. + For more information about the problem, see https://phabricator.haskell.org/D4114. +. + This patch is a rework of https://phabricator.haskell.org/D3741. + It modifies Stg.h to include the old definitions, if a compiler older than + 8.4 is being used. +. + This patch can be removed, once ghc-8.2 is no longer the bootstrap compiler. +Author: Ilias Tsitsimpis +Bug: https://ghc.haskell.org/trac/ghc/ticket/15201 + +Index: b/includes/Stg.h +=================================================================== +--- a/includes/Stg.h ++++ b/includes/Stg.h +@@ -232,6 +232,16 @@ typedef StgInt I_; + typedef StgWord StgWordArray[]; + typedef StgFunPtr F_; + ++#if __GLASGOW_HASKELL__ < 804 ++#define EB_(X) extern char X[] ++#define IB_(X) static char X[] ++#define EI_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) ++#define II_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) ++#define IF_(f) static StgFunPtr GNUC3_ATTRIBUTE(used) f(void) ++#define FN_(f) StgFunPtr f(void) ++#define EF_(f) StgFunPtr f(void) /* External Cmm functions */ ++#define EFF_(f) void f() /* See Note [External function prototypes] */ ++#else + /* byte arrays (and strings): */ + #define EB_(X) extern const char X[] + #define IB_(X) static const char X[] +@@ -250,6 +260,7 @@ typedef StgFunPtr F_; + #define EF_(f) StgFunPtr f(void) /* External Cmm functions */ + /* foreign functions: */ + #define EFF_(f) void f() /* See Note [External function prototypes] */ ++#endif /* __GLASGOW_HASKELL__ < 804 */ + + /* Note [External function prototypes] See Trac #8965, #11395 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/ghc.spec b/ghc.spec index f7aa7be..6979e5a 100644 --- a/ghc.spec +++ b/ghc.spec @@ -70,6 +70,7 @@ Patch15: ghc-warnings.mk-CC-Wall.patch Patch24: buildpath-abi-stability.patch Patch26: no-missing-haddock-file-warning.patch Patch28: x32-use-native-x86_64-insn.patch +Patch30: fix-build-using-unregisterized-v8.2.patch # fedora ghc has been bootstrapped on # %%{ix86} x86_64 ppc ppc64 armv7hl s390 s390x ppc64le aarch64 @@ -297,6 +298,9 @@ rm -r libffi-tarballs %patch24 -p1 -b .orig %patch26 -p1 -b .orig %patch28 -p1 -b .orig +%ifarch s390x +%patch30 -p1 -b .orig +%endif %global gen_contents_index gen_contents_index.orig %if %{with docs} @@ -649,6 +653,7 @@ fi %changelog * Wed Oct 17 2018 Jens Petersen - 8.6.1-72 - initial 8.6 module build +- add fix-build-using-unregisterized-v8.2.patch from 8.4 * Wed Oct 17 2018 Jens Petersen - add ABI hash check to build