Commit d211bc01 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis

ghc: Allow unregisterised ghc-8.2 to build newer GHC

parent 9b1be678
ghc (8.4.3-6) UNRELEASED; urgency=medium
ghc (8.4.3-6) experimental; urgency=medium
[ Gianfranco Costamagna ]
* Try to fix armel build
......@@ -6,7 +6,11 @@ ghc (8.4.3-6) UNRELEASED; urgency=medium
[ John Paul Adrian Glaubitz ]
* ghc: disable ld override on powerpcspe too
-- Gianfranco Costamagna <locutusofborg@debian.org> Mon, 30 Jul 2018 17:24:55 +0200
[ Ilias Tsitsimpis ]
* Allow unregisterised ghc-8.2 to build newer GHC
* Bump to Standards-Version 4.2.1
-- Ilias Tsitsimpis <iliastsi@debian.org> Fri, 14 Sep 2018 14:32:12 +0300
ghc (8.4.3-5) experimental; urgency=medium
......
......@@ -3,7 +3,7 @@ Section: haskell
Priority: optional
Maintainer: Debian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>
Uploaders: Joachim Breitner <nomeata@debian.org>, Clint Adams <clint@debian.org>
Standards-Version: 4.1.5
Standards-Version: 4.2.1
Rules-Requires-Root: no
Build-Depends:
debhelper (>= 10),
......
......@@ -6,11 +6,11 @@ Author: Jani Monoses <jani@ubuntu.com>
Upstream-Bug: https://ghc.haskell.org/trac/ghc/ticket/5914
Launchpad-Bug: https://ghc.haskell.org/trac/ghc/ticket/5914
Index: ghc-8.4.1/aclocal.m4
Index: b/aclocal.m4
===================================================================
--- ghc-8.4.1.orig/aclocal.m4
+++ ghc-8.4.1/aclocal.m4
@@ -423,7 +423,7 @@
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -423,7 +423,7 @@ AC_DEFUN([GET_ARM_ISA],
)],
[changequote(, )dnl
ARM_ISA=ARMv7
......
......@@ -60,10 +60,10 @@ Description: with new ghc 8.4.3, the armel situation seems to have improved,
# , byte0 w32, byte1 w32, byte2 w32, byte3 w32]
#
# ArchARM64 { } ->
Index: ghc-8.4.1/llvm-targets
Index: b/llvm-targets
===================================================================
--- ghc-8.4.1.orig/llvm-targets
+++ ghc-8.4.1/llvm-targets
--- a/llvm-targets
+++ b/llvm-targets
@@ -3,6 +3,7 @@
,("x86_64-unknown-windows", ("e-m:w-i64:64-f80:128-n8:16:32:64-S128", "x86-64", ""))
,("arm-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align"))
......
......@@ -24,9 +24,11 @@ Description: driver: skip -Bsymbolic on unregisterised targets
.
This change disables '-Bsymbolic' for unregisterised targets.
Index: b/compiler/main/SysTools.hs
===================================================================
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -534,9 +534,12 @@
@@ -534,9 +534,12 @@ linkDynLib dflags0 o_files dep_packages
-------------------------------------------------------------------
let output_fn = case o_file of { Just s -> s; Nothing -> "a.out"; }
......@@ -41,7 +43,7 @@ Description: driver: skip -Bsymbolic on unregisterised targets
runLink dflags (
map Option verbFlags
@@ -593,3 +596,27 @@
@@ -593,3 +596,27 @@ getFrameworkOpts dflags platform
-- reverse because they're added in reverse order from the cmd line:
framework_opts = concat [ ["-framework", fw]
| fw <- reverse frameworks ]
......
Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
Index: ghc-8.4.1/compiler/iface/MkIface.hs
Index: b/compiler/iface/MkIface.hs
===================================================================
--- ghc-8.4.1.orig/compiler/iface/MkIface.hs
+++ ghc-8.4.1/compiler/iface/MkIface.hs
@@ -689,7 +689,7 @@
--- a/compiler/iface/MkIface.hs
+++ b/compiler/iface/MkIface.hs
@@ -689,7 +689,7 @@ addFingerprints hsc_env mb_old_fingerpri
iface_hash <- computeFingerprint putNameLiterally
(mod_hash,
ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache
......@@ -13,7 +13,7 @@ Index: ghc-8.4.1/compiler/iface/MkIface.hs
sorted_deps,
mi_hpc iface0)
@@ -724,6 +724,9 @@
@@ -724,6 +724,9 @@ addFingerprints hsc_env mb_old_fingerpri
(non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0)
fix_fn = mi_fix_fn iface0
ann_fn = mkIfaceAnnCache (mi_anns iface0)
......
......@@ -39,11 +39,11 @@ Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4982
---
Index: ghc-8.4.3/rts/posix/OSMem.c
Index: b/rts/posix/OSMem.c
===================================================================
--- ghc-8.4.3.orig/rts/posix/OSMem.c
+++ ghc-8.4.3/rts/posix/OSMem.c
@@ -435,6 +435,8 @@
--- a/rts/posix/OSMem.c
+++ b/rts/posix/OSMem.c
@@ -435,6 +435,8 @@ osTryReserveHeapMemory (W_ len, void *hi
void *base, *top;
void *start, *end;
......@@ -52,7 +52,7 @@ Index: ghc-8.4.3/rts/posix/OSMem.c
/* We try to allocate len + MBLOCK_SIZE,
because we need memory which is MBLOCK_SIZE aligned,
and then we discard what we don't need */
@@ -502,6 +504,8 @@
@@ -502,6 +504,8 @@ void *osReserveHeapMemory(void *startAdd
attempt = 0;
while (1) {
......
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 <iliastsi@debian.org>
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provided by “Pino” via Samuel Thibault. Not yet pushed upstream.
Index: ghc-8.4.1/aclocal.m4
Index: b/aclocal.m4
===================================================================
--- ghc-8.4.1.orig/aclocal.m4
+++ ghc-8.4.1/aclocal.m4
@@ -272,12 +272,15 @@
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -272,12 +272,15 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
nto-qnx)
test -z "[$]2" || eval "[$]2=OSQNXNTO"
;;
......@@ -21,11 +21,11 @@ Index: ghc-8.4.1/aclocal.m4
*)
echo "Unknown OS '[$]1'"
exit 1
Index: ghc-8.4.1/compiler/utils/Platform.hs
Index: b/compiler/utils/Platform.hs
===================================================================
--- ghc-8.4.1.orig/compiler/utils/Platform.hs
+++ ghc-8.4.1/compiler/utils/Platform.hs
@@ -87,6 +87,7 @@
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -87,6 +87,7 @@ data OS
| OSHaiku
| OSQNXNTO
| OSAIX
......@@ -33,7 +33,7 @@ Index: ghc-8.4.1/compiler/utils/Platform.hs
deriving (Read, Show, Eq)
-- | ARM Instruction Set Architecture, Extensions and ABI
@@ -136,6 +137,7 @@
@@ -136,6 +137,7 @@ osElfTarget OSKFreeBSD = True
osElfTarget OSHaiku = True
osElfTarget OSQNXNTO = False
osElfTarget OSAIX = False
......
......@@ -10,6 +10,8 @@ armv7l-unknown-linux-gnueabihf.
utils/llvm-targets/gen-data-layout.sh | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
Index: b/llvm-targets
===================================================================
--- a/llvm-targets
+++ b/llvm-targets
@@ -3,10 +3,12 @@
......@@ -26,6 +28,8 @@ armv7l-unknown-linux-gnueabihf.
,("i386-unknown-linux-gnu", ("e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128", "pentium4", ""))
,("i386-unknown-linux", ("e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128", "pentium4", ""))
,("x86_64-unknown-linux-gnu", ("e-m:e-i64:64-f80:128-n8:16:32:64-S128", "x86-64", ""))
Index: b/utils/llvm-targets/gen-data-layout.sh
===================================================================
--- a/utils/llvm-targets/gen-data-layout.sh
+++ b/utils/llvm-targets/gen-data-layout.sh
@@ -18,7 +18,7 @@
......
......@@ -3,9 +3,11 @@ Description: Do not emit a warning if the .haddock file is missing
without the -doc package.
Author: Joachim Breitner <nomeata@debian.org>
Index: b/utils/ghc-pkg/Main.hs
===================================================================
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -1824,8 +1824,10 @@
@@ -1824,8 +1824,10 @@ checkPackageConfig pkg verbosity db_stac
mapM_ (checkDir True "dynamic-library-dirs") (libraryDynDirs pkg)
mapM_ (checkDir True "include-dirs") (includeDirs pkg)
mapM_ (checkDir True "framework-dirs") (frameworkDirs pkg)
......
......@@ -3,8 +3,10 @@ Description: cherry-pick of upstream commits
5e63a25249f3cb07300258e115af9ff55079d2ea.patch:
Last-Update: 2018-07-19
--- ghc-8.4.3.orig/aclocal.m4
+++ ghc-8.4.3/aclocal.m4
Index: b/aclocal.m4
===================================================================
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -217,7 +217,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
mipsel)
test -z "[$]2" || eval "[$]2=ArchMipsel"
......
......@@ -11,3 +11,4 @@ use-llvm-6.0.patch
e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
risc-support.patch
armel-revert-ghci-fixes.patch
fix-build-using-unregisterized-v8.2
Index: ghc-8.4.1/ghc.mk
Index: b/ghc.mk
===================================================================
--- ghc-8.4.1.orig/ghc.mk
+++ ghc-8.4.1/ghc.mk
@@ -820,7 +820,6 @@
--- a/ghc.mk
+++ b/ghc.mk
@@ -820,7 +820,6 @@ endif
# Build the Haddock contents and index
ifeq "$(HADDOCK_DOCS)" "YES"
libraries/dist-haddock/index.html: $(haddock_INPLACE) $(ALL_HADDOCK_FILES)
......@@ -10,7 +10,7 @@ Index: ghc-8.4.1/ghc.mk
ifeq "$(phase)" "final"
$(eval $(call all-target,library_doc_index,libraries/dist-haddock/index.html))
endif
@@ -953,12 +952,8 @@
@@ -953,12 +952,8 @@ endif
$(INSTALL_DIR) "$(DESTDIR)$(docdir)/html"
$(INSTALL_DOC) $(INSTALL_OPTS) docs/index.html "$(DESTDIR)$(docdir)/html"
ifneq "$(INSTALL_LIBRARY_DOCS)" ""
......@@ -24,7 +24,7 @@ Index: ghc-8.4.1/ghc.mk
endif
ifneq "$(INSTALL_HTML_DOC_DIRS)" ""
for i in $(INSTALL_HTML_DOC_DIRS); do \
@@ -1078,7 +1073,6 @@
@@ -1078,7 +1073,6 @@ $(eval $(call bindist-list,.,\
mk/project.mk \
mk/install.mk.in \
bindist.mk \
......
......@@ -2,8 +2,10 @@ Description: Use llvm 6.0 on arm*
Author: Gianfranco Costamagna <locutusofborg@debian.org>
Last-Update: 2018-07-19
--- ghc-8.4.3.orig/configure.ac
+++ ghc-8.4.3/configure.ac
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -638,7 +638,7 @@ AC_SUBST([LibtoolCmd])
# tools we are looking for. In the past, GHC supported a number of
# versions of LLVM simultaneously, but that stopped working around
......
......@@ -7,11 +7,11 @@ Description: Use the stage1 binaries for install
Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Last-Update: 2017-01-29
Index: ghc-8.4.1/ghc.mk
Index: b/ghc.mk
===================================================================
--- ghc-8.4.1.orig/ghc.mk
+++ ghc-8.4.1/ghc.mk
@@ -972,8 +972,12 @@
--- a/ghc.mk
+++ b/ghc.mk
@@ -972,8 +972,12 @@ else # CrossCompiling
# Install packages in the right order, so that ghc-pkg doesn't complain.
# Also, install ghc-pkg first.
ifeq "$(Windows_Host)" "NO"
......
......@@ -12,10 +12,10 @@ Description: Use native x86_64 instructions on x32
See: https://ghc.haskell.org/trac/ghc/ticket/11571
.
Index: ghc-8.4.1/rts/RtsSymbols.c
Index: b/rts/RtsSymbols.c
===================================================================
--- ghc-8.4.1.orig/rts/RtsSymbols.c
+++ ghc-8.4.1/rts/RtsSymbols.c
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -919,7 +919,7 @@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment