[Git][haskell-team/DHG_packages][master] 37 commits: ghc: bump std-version to 4.1.4, no changes required

Ilias Tsitsimpis gitlab at salsa.debian.org
Wed Sep 26 10:14:42 BST 2018


Ilias Tsitsimpis pushed to branch master at Debian Haskell Group / DHG_packages


Commits:
d1687846 by Gianfranco Costamagna at 2018-04-09T10:40:40Z
ghc: bump std-version to 4.1.4, no changes required

- - - - -
bd8ffaa8 by Gianfranco Costamagna at 2018-04-09T10:43:51Z
ghc: bump llvm required version to 5.0

- - - - -
98dc84f4 by Gianfranco Costamagna at 2018-04-09T10:43:58Z
ghc: drop patches now upstream

- - - - -
7071d80c by Gianfranco Costamagna at 2018-04-09T10:44:04Z
ghc: patch refresh

- - - - -
7696943c by Gianfranco Costamagna at 2018-04-09T10:44:25Z
ghc: update changelog for version 8.4.1 and upload to experimental

- - - - -
03a95b43 by Gianfranco Costamagna at 2018-04-09T12:17:34Z
ghc: drop old binutils dependency, already installed inside chroots, thanks pochu for the help!

- - - - -
a20f009f by Gianfranco Costamagna at 2018-04-09T13:54:39Z
ghc: refresh timestamp entry

- - - - -
d1e3f279 by Gianfranco Costamagna at 2018-04-10T06:59:15Z
ghc: patch refresh for armel build, but do not apply it, upload to experimental

- - - - -
129867c3 by Gianfranco Costamagna at 2018-04-10T08:09:46Z
Merge branch 'master' into experimental

- - - - -
e74880c8 by Gianfranco Costamagna at 2018-04-23T08:34:14Z
ghc: new upstream release, upload to experimental

- - - - -
1f43a86f by Clint Adams at 2018-05-30T22:41:31Z
ghc: 8.4.3

- - - - -
d1d5fff3 by Gianfranco Costamagna at 2018-06-05T13:38:24Z
ghc: drop old powerpcspe patch

- - - - -
240a12da by Gianfranco Costamagna at 2018-06-20T10:37:03Z
ghc: Switch to llvm 6.0

- - - - -
2f6b3725 by Gianfranco Costamagna at 2018-07-03T06:47:39Z
ghc: add closing of bug 850915

- - - - -
7baf7920 by Clint Adams at 2018-07-18T23:10:46Z
Merge branch 'master' into experimental

- - - - -
7be959fb by Clint Adams at 2018-07-18T23:13:19Z
ghc: 8.4.3-2

- - - - -
8b2fce92 by Clint Adams at 2018-07-19T02:16:13Z
ghc: revert broken LLVM change

- - - - -
4e3d07e3 by Gianfranco Costamagna at 2018-07-19T10:22:52Z
Revert "ghc: revert broken LLVM change"

This reverts commit 8b2fce9217805a41dceaeec75217998760ecab87.

- - - - -
f937cdf2 by Gianfranco Costamagna at 2018-07-19T10:23:20Z
>From 8b2fce9217805a41dceaeec75217998760ecab87: keep bump of std-version to 4.1.5, and switch website uri to https

- - - - -
9ad07978 by Gianfranco Costamagna at 2018-07-19T10:24:49Z
ghc: Add patch to make ghc look for llvm 6

- - - - -
2b885c0d by Gianfranco Costamagna at 2018-07-19T17:29:47Z
ghc: add upstream support for risc architecture

- - - - -
806d6b91 by Gianfranco Costamagna at 2018-07-19T22:25:16Z
ghc: refresh timestamp

- - - - -
7c6d2f21 by Gianfranco Costamagna at 2018-07-20T11:53:38Z
ghc: Simplify configure script, using dh_auto_configure

- - - - -
855ea7ac by Gianfranco Costamagna at 2018-07-26T12:11:32Z
ghc: fix previous upload, force multiarch disable in rules

- - - - -
85f5c582 by Gianfranco Costamagna at 2018-07-27T06:37:50Z
ghc: upload to experimental

- - - - -
5056046d by Gianfranco Costamagna at 2018-07-27T06:44:53Z
ghc: drop trailing newline on changelog file

- - - - -
97ce9255 by John Paul Adrian Glaubitz at 2018-07-30T06:32:08Z
ghc: disable ld override on powerpcspe too

- - - - -
24668a10 by Gianfranco Costamagna at 2018-07-30T09:13:09Z
ghc: try to enable again armel patch, but commented out, and everywhere

- - - - -
b4f3c962 by Gianfranco Costamagna at 2018-07-30T15:26:37Z
ghc: update changelog

- - - - -
9b1be678 by Ilias Tsitsimpis at 2018-09-14T10:19:04Z
Merge branch 'master' into experimental

- - - - -
d211bc01 by Ilias Tsitsimpis at 2018-09-14T11:32:38Z
ghc: Allow unregisterised ghc-8.2 to build newer GHC

- - - - -
b0a20146 by Ilias Tsitsimpis at 2018-09-18T11:27:05Z
ghc: Backport upstream commit ec9aacf3eb2 (add -latomic to ghc-prim)

- - - - -
e29b92f5 by Ilias Tsitsimpis at 2018-09-18T11:30:49Z
ghc: Use system's default ld (ld.bfd) on sparc64, instead of ld.gold

- - - - -
196fd11a by Ilias Tsitsimpis at 2018-09-21T19:41:23Z
ghc: Backport fix for high memory usage in Haddock

- - - - -
fcfb99be by Ilias Tsitsimpis at 2018-09-21T20:14:00Z
ghc: Remove DFSG incompatible file

- - - - -
5195d758 by Ilias Tsitsimpis at 2018-09-26T09:09:39Z
Merge branch 'experimental'

- - - - -
0d47dfa9 by Ilias Tsitsimpis at 2018-09-26T09:10:51Z
ghc: Upload version 8.4.3+dfsg1-2 to unstable

- - - - -


28 changed files:

- p/ghc/debian/changelog
- p/ghc/debian/control
- p/ghc/debian/copyright
- p/ghc/debian/patches/ARM-VFPv3D16
- + p/ghc/debian/patches/add_-latomic_to_ghc-prim
- p/ghc/debian/patches/armel-revert-ghci-fixes.patch
- p/ghc/debian/patches/bsymbolic-only-for-registerised.patch
- − p/ghc/debian/patches/build-unlit-and-hp2ps-twice.patch
- p/ghc/debian/patches/buildpath-abi-stability.patch
- − p/ghc/debian/patches/do-not-use-SHELL
- p/ghc/debian/patches/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
- + p/ghc/debian/patches/fix-build-using-unregisterized-v8.2
- − p/ghc/debian/patches/fix-hssplicety.patch
- + p/ghc/debian/patches/haddock-out-of-memory.patch
- p/ghc/debian/patches/hurd.diff
- + p/ghc/debian/patches/llvm-targets-Add-versioned-ARM-targets.patch
- − p/ghc/debian/patches/lower-optimization-for-unreg.patch
- p/ghc/debian/patches/no-missing-haddock-file-warning
- − p/ghc/debian/patches/powerpcspe-disable-FPU-code.patch
- − p/ghc/debian/patches/reproducible-tmp-names
- p/ghc/debian/patches/risc-support.patch
- p/ghc/debian/patches/series
- p/ghc/debian/patches/use-debian-gen_contents_index
- + p/ghc/debian/patches/use-llvm-6.0.patch
- p/ghc/debian/patches/use-stage1-binaries-for-install.patch
- p/ghc/debian/patches/x32-use-native-x86_64-insn.patch
- p/ghc/debian/rules
- p/ghc/debian/watch


Changes:

=====================================
p/ghc/debian/changelog
=====================================
@@ -1,3 +1,108 @@
+ghc (8.4.3+dfsg1-2) unstable; urgency=medium
+
+  * Upload to unstable
+
+ -- Ilias Tsitsimpis <iliastsi at debian.org>  Wed, 26 Sep 2018 12:10:37 +0300
+
+ghc (8.4.3+dfsg1-1) experimental; urgency=medium
+
+  * Backport upstream commit 18cb44dfae3f.
+    This fixes upstream bug #15213 (32 bit Haddock runs out of memory
+    compiling 32 bit GHC).
+  * Remove DFSG incompatible file (Closes: #870683).
+
+ -- Ilias Tsitsimpis <iliastsi at debian.org>  Fri, 21 Sep 2018 23:05:59 +0300
+
+ghc (8.4.3-7) experimental; urgency=medium
+
+  * Backport upstream commit ec9aacf3eb2 (add -latomic to ghc-prim)
+  * Use system's default ld (ld.bfd) on sparc64, instead of ld.gold
+    (Closes: #908998)
+
+ -- Ilias Tsitsimpis <iliastsi at debian.org>  Tue, 18 Sep 2018 14:30:06 +0300
+
+ghc (8.4.3-6) experimental; urgency=medium
+
+  [ Gianfranco Costamagna ]
+  * Try to fix armel build
+
+  [ John Paul Adrian Glaubitz ]
+  * ghc: disable ld override on powerpcspe too
+
+  [ Ilias Tsitsimpis ]
+  * Allow unregisterised ghc-8.2 to build newer GHC
+  * Bump to Standards-Version 4.2.1
+
+ -- Ilias Tsitsimpis <iliastsi at debian.org>  Fri, 14 Sep 2018 14:32:12 +0300
+
+ghc (8.4.3-5) experimental; urgency=medium
+
+  * Switch to dh_auto_configure, making the correct triplet
+    being passed to the build system, with also --target flag
+    (this should hopefully make the configure more robust, and
+    stop failing now that armhf runs on arm64 systems)
+    - thanks waldi, jcristay for the help
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Fri, 20 Jul 2018 13:52:19 +0200
+
+ghc (8.4.3-4) experimental; urgency=medium
+
+  * merge with unstable 8.2.2-6
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Fri, 20 Jul 2018 00:24:43 +0200
+
+ghc (8.4.3-3) experimental; urgency=medium
+
+  * Switch configure.ac to search for llvm 6.0
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Thu, 19 Jul 2018 12:16:02 +0200
+
+ghc (8.4.3-2) experimental; urgency=medium
+
+  [ Gianfranco Costamagna ]
+  * Remove old and non-applied anymore powerpcspe-disable-FPU-code.patch.
+    (Closes: #900817)
+  * Switch to llvm 6.0 (Closes: #850915)
+
+  [ Clint Adams ]
+  * Merge in 8.2.2-5.
+
+ -- Clint Adams <clint at debian.org>  Wed, 18 Jul 2018 19:12:59 -0400
+
+ghc (8.4.3-1) experimental; urgency=medium
+
+  * New upstream version.
+  * Apply upstream patch to build on armhf.
+
+ -- Clint Adams <clint at debian.org>  Wed, 30 May 2018 18:34:37 -0400
+
+ghc (8.4.2-1) experimental; urgency=medium
+
+  * New upstream release
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Mon, 23 Apr 2018 10:28:43 +0200
+
+ghc (8.4.1-2) experimental; urgency=medium
+
+  * Refresh armel patch, but do not apply it, to see
+    if upstream changes are enough to make it build again
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Tue, 10 Apr 2018 08:58:07 +0200
+
+ghc (8.4.1-1) experimental; urgency=medium
+
+  * New upstream release, patch refresh
+  * Bump std-version to 4.1.4, no changes required
+  * d/{rules,control}: switch to llvm 5.0 on arm*
+  * Drop patches included in new upstream release:
+    - reproducible-tmp-names
+    - do-not-use-SHELL
+    - build-unlit-and-hp2ps-twice.patch
+    - fix-hssplicety.patch
+    - lower-optimization-for-unreg.patch
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org>  Mon, 09 Apr 2018 15:54:00 +0200
+
 ghc (8.2.2-6) unstable; urgency=medium
 
   * debian/patches/{risc-support,e175aaf6918bb2b497b83618dc4c270a0d231a1c}.patch


=====================================
p/ghc/debian/control
=====================================
@@ -3,7 +3,7 @@ Section: haskell
 Priority: optional
 Maintainer: Debian Haskell Group <pkg-haskell-maintainers at lists.alioth.debian.org>
 Uploaders: Joachim Breitner <nomeata at debian.org>, Clint Adams <clint at debian.org>
-Standards-Version: 4.1.4
+Standards-Version: 4.2.1
 Rules-Requires-Root: no
 Build-Depends:
   debhelper (>= 10),
@@ -13,26 +13,23 @@ Build-Depends:
   pkg-config,
   ghc:native (>= 7.8),
   libgmp-dev,
-  llvm-3.9 [arm64 armel armhf],
+  llvm-6.0 [arm64 armel armhf],
   libffi-dev,
-  binutils [arm64 armel armhf],
   libncurses5-dev,
   python-sphinx <!cross>,
   dpkg-dev (>= 1.16.1.1)
 Build-Depends-Indep:
   hscolour,
   fop
-Build-Conflicts:
-  ccache,
-  ghc (= 8.0.0.20160111-3),
-Homepage: http://haskell.org/ghc/
+Build-Conflicts: ccache
+Homepage: https://haskell.org/ghc/
 Vcs-Git: https://salsa.debian.org/haskell-team/DHG_packages.git [p/ghc]
 Vcs-Browser: https://salsa.debian.org/haskell-team/DHG_packages/tree/master/p/ghc
 
 Package: ghc
 Architecture: any
 Depends:
-  llvm-3.9 [arm64 armel armhf],
+  llvm-6.0 [arm64 armel armhf],
   gcc,
   libgmp-dev,
   libffi-dev,
@@ -54,7 +51,7 @@ Provides:
 Replaces: ghc6 (<< 7), ghc-dynamic (<< 7.8), ghc-haddock (<< 7.10)
 Conflicts: ghc6 (<< 7), ghc-dynamic (<< 7.8), libghc-cabal-dev (<< 1.24.2.1), ${conflicting-devs}
 Breaks: cabal-install (<< 1.22), haskell-devscripts (<< 0.8.13), ghc-doc (<< 7.10), ghc-haddock (<< 7.10)
-Suggests: perl, ghc-prof, ghc-doc, haskell-doc, llvm-3.9
+Suggests: perl, ghc-prof, ghc-doc, haskell-doc, llvm-6.0
 Description: The Glasgow Haskell Compilation system
  The Glorious Glasgow Haskell Compilation system (GHC) is a compiler for
  Haskell.


=====================================
p/ghc/debian/copyright
=====================================
@@ -2,6 +2,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: ghc
 Upstream-Contact: Simon Marlow <marlowsd at gmail.com>
 Source: https://downloads.haskell.org/~ghc/
+Files-Excluded: libraries/bytestring/tests/data
 
 Files: *
 License: BSD-3-clause


=====================================
p/ghc/debian/patches/ARM-VFPv3D16
=====================================
@@ -6,9 +6,11 @@ Author: Jani Monoses <jani at ubuntu.com>
 Upstream-Bug: https://ghc.haskell.org/trac/ghc/ticket/5914
 Launchpad-Bug: https://ghc.haskell.org/trac/ghc/ticket/5914
 
+Index: b/aclocal.m4
+===================================================================
 --- a/aclocal.m4
 +++ b/aclocal.m4
-@@ -417,7 +417,7 @@ AC_DEFUN([GET_ARM_ISA],
+@@ -423,7 +423,7 @@ AC_DEFUN([GET_ARM_ISA],
                  )],
                  [changequote(, )dnl
                   ARM_ISA=ARMv7


=====================================
p/ghc/debian/patches/add_-latomic_to_ghc-prim
=====================================
@@ -0,0 +1,128 @@
+commit ec9aacf3eb2975fd302609163aaef429962ecd87
+Author: Moritz Angermann <moritz.angermann at gmail.com>
+Date:   Thu Feb 8 16:07:07 2018 +0800
+
+    adds -latomic to. ghc-prim
+    
+    Reviewers: bgamari, hvr
+    
+    Reviewed By: bgamari
+    
+    Subscribers: erikd, hvr, rwbarton, thomie, carter
+    
+    Differential Revision: https://phabricator.haskell.org/D4378
+
+    iliastsi: The original patch fails to correctly detect and use C11
+    atomics, so I modified it based on https://phabricator.haskell.org/D5154.
+
+Index: b/aclocal.m4
+===================================================================
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -1284,24 +1284,6 @@ AC_SUBST(GccIsClang)
+ rm -f conftest.txt
+ ])
+ 
+-# FP_GCC_SUPPORTS__ATOMICS
+-# ------------------------
+-# Does gcc support the __atomic_* family of builtins?
+-AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS],
+-[
+-   AC_REQUIRE([AC_PROG_CC])
+-   AC_MSG_CHECKING([whether GCC supports __atomic_ builtins])
+-   echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; }' > conftest.c
+-   if $CC -c conftest.c > /dev/null 2>&1; then
+-       CONF_GCC_SUPPORTS__ATOMICS=YES
+-       AC_MSG_RESULT([yes])
+-   else
+-       CONF_GCC_SUPPORTS__ATOMICS=NO
+-       AC_MSG_RESULT([no])
+-   fi
+-   rm -f conftest.c conftest.o
+-])
+-
+ # FP_GCC_SUPPORTS_NO_PIE
+ # ----------------------
+ # Does gcc support the -no-pie option? If so we should pass it to gcc when
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -714,11 +714,6 @@ FP_GCC_VERSION
+ dnl ** See whether gcc supports -no-pie
+ FP_GCC_SUPPORTS_NO_PIE
+ 
+-dnl ** Used to determine how to compile ghc-prim's atomics.c, used by
+-dnl    unregisterised, Sparc, and PPC backends.
+-FP_GCC_SUPPORTS__ATOMICS
+-AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic primitives?])
+-
+ FP_GCC_EXTRA_FLAGS
+ 
+ dnl ** look to see if we have a C compiler using an llvm back end.
+Index: b/libraries/ghc-prim/Setup.hs
+===================================================================
+--- a/libraries/ghc-prim/Setup.hs
++++ b/libraries/ghc-prim/Setup.hs
+@@ -18,7 +18,7 @@ import System.Exit
+ import System.Directory
+ 
+ main :: IO ()
+-main = do let hooks = simpleUserHooks {
++main = do let hooks = autoconfUserHooks {
+                   regHook = addPrimModule
+                           $ regHook simpleUserHooks,
+                   buildHook = build_primitive_sources
+Index: b/libraries/ghc-prim/aclocal.m4
+===================================================================
+--- /dev/null
++++ b/libraries/ghc-prim/aclocal.m4
+@@ -0,0 +1,17 @@
++# FP_GCC_SUPPORTS__ATOMICS
++# ------------------------
++# Does gcc support the __atomic_* family of builtins?
++AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS],
++[
++   AC_REQUIRE([AC_PROG_CC])
++   AC_MSG_CHECKING([whether GCC supports __atomic_ builtins])
++   echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST); return y; }' > conftest.c
++   if $CC -c conftest.c > /dev/null 2>&1; then
++       CONF_GCC_SUPPORTS__ATOMICS=YES
++       AC_MSG_RESULT([yes])
++   else
++       CONF_GCC_SUPPORTS__ATOMICS=NO
++       AC_MSG_RESULT([no])
++   fi
++   rm -f conftest.c conftest.o
++])
+Index: b/libraries/ghc-prim/configure.ac
+===================================================================
+--- /dev/null
++++ b/libraries/ghc-prim/configure.ac
+@@ -0,0 +1,18 @@
++AC_INIT([ghc-prim package], [2.1], [glasgow-haskell-bugs at haskell.org], [ghc-prim])
++
++AC_CONFIG_SRCDIR([ghc-prim.cabal])
++
++# -------------------------------------------------------------------------
++dnl ** Used to determine how to compile ghc-prim's atomics.c, used by
++dnl    unregisterised, Sparc, and PPC backends.
++FP_GCC_SUPPORTS__ATOMICS
++AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic primitives?])
++
++if test "$CONF_GCC_SUPPORTS__ATOMICS" = "YES"
++then PRIM_CFLAGS=-DHAVE_C11_ATOMICS
++     PRIM_EXTRA_LIBRARIES=atomic
++fi
++AC_SUBST([PRIM_CFLAGS])
++AC_SUBST([PRIM_EXTRA_LIBRARIES])
++AC_CONFIG_FILES([ghc-prim.buildinfo])
++AC_OUTPUT
+Index: b/libraries/ghc-prim/ghc-prim.buildinfo.in
+===================================================================
+--- /dev/null
++++ b/libraries/ghc-prim/ghc-prim.buildinfo.in
+@@ -0,0 +1,2 @@
++cc-options: @PRIM_CFLAGS@
++extra-libraries: @PRIM_EXTRA_LIBRARIES@
+\ No newline at end of file


=====================================
p/ghc/debian/patches/armel-revert-ghci-fixes.patch
=====================================
@@ -1,68 +1,74 @@
-Description: Revert ghci ARM improvements (ticket #10375) on armel
- This patch reverts a change which improved ghci on ARM (see
- ghc ticket #10375). While the change fixed ghci on armhf, it
- actually resulted in the ghc package FTBFS on armel since the
- changes introduced made ghc incompatible with this architecture
- (ticket #11058). As a temporary workaround, we revert this particular
- change when ghc is built on armel. For this reason, this patch
- is not applied using the series file but only selectively on
- armel with the help of debian/rules.
- .
-
---- ghc-8.2.1.orig/aclocal.m4	2017-09-17 10:46:45.000000000 +0200
-+++ ghc-8.2.1/aclocal.m4	2017-09-17 11:57:40.681870101 +0200
-@@ -621,16 +621,8 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
-         $3="$$3 -D_HPUX_SOURCE"
-         $5="$$5 -D_HPUX_SOURCE"
-         ;;
--    arm*linux*)
--        # On arm/linux and arm/android, tell gcc to generate Arm
--        # instructions (ie not Thumb) and to link using the gold linker.
--        # Forcing LD to be ld.gold is done in FIND_LD m4 macro.
--        $2="$$2 -marm"
--        $3="$$3 -Wl,-z,noexecstack"
--        $4="$$4 -z noexecstack"
--        ;;
--
--    aarch64*linux*)
-+    arm*linux*		| \
-+    aarch64*linux*	)
-         $3="$$3 -Wl,-z,noexecstack"
-         $4="$$4 -z noexecstack"
-         ;;
---- ghc-7.10.3.orig/libraries/ghci/GHCi/InfoTable.hsc
-+++ ghc-7.10.3/libraries/ghci/GHCi/InfoTable.hsc
-@@ -245,17 +245,17 @@ mkJumpToAddr dflags a = case platformArc
-                  , fromIntegral ((w64 `shiftR` 32) .&. 0x0000FFFF) ]
- 
-     ArchARM { } ->
--        -- Generates Arm sequence,
-+        -- Generates Thumb sequence,
-         --      ldr r1, [pc, #0]
-         --      bx r1
-         --
-         -- which looks like:
-         --     00000000 <.addr-0x8>:
--        --     0:       00109fe5    ldr    r1, [pc]      ; 8 <.addr>
--        --     4:       11ff2fe1    bx     r1
-+        --     0:       4900        ldr    r1, [pc]      ; 8 <.addr>
-+        --     4:       4708        bx     r1
-         let w32 = fromIntegral (funPtrToInt a) :: Word32
--        in Left [ 0x00, 0x10, 0x9f, 0xe5
--                , 0x11, 0xff, 0x2f, 0xe1
-+        in Left [ 0x49, 0x00
-+                , 0x47, 0x08
-                 , byte0 w32, byte1 w32, byte2 w32, byte3 w32]
- 
-     ArchARM64 { } ->
---- ghc-7.10.3.orig/compiler/llvmGen/LlvmCodeGen/Ppr.hs
-+++ ghc-7.10.3/compiler/llvmGen/LlvmCodeGen/Ppr.hs
-@@ -52,7 +52,7 @@ moduleLayout = sdocWithPlatform $ \platform ->
-         $+$ text "target triple = \"x86_64-linux-gnu\""
-     Platform { platformArch = ArchARM {}, platformOS = OSLinux } ->
-         text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\""
--        $+$ text "target triple = \"armv6-unknown-linux-gnueabihf\""
-+        $+$ text "target triple = \"arm-unknown-linux-gnueabi\""
-     Platform { platformArch = ArchARM {}, platformOS = OSAndroid } ->
-         text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\""
-         $+$ text "target triple = \"arm-unknown-linux-androideabi\""
+Description: with new ghc 8.4.3, the armel situation seems to have improved,
+ apply this patch unconditionally.
+#Description: Revert ghci ARM improvements (ticket #10375) on armel
+# This patch reverts a change which improved ghci on ARM (see
+# ghc ticket #10375). While the change fixed ghci on armhf, it
+# actually resulted in the ghc package FTBFS on armel since the
+# changes introduced made ghc incompatible with this architecture
+# (ticket #11058). As a temporary workaround, we revert this particular
+# change when ghc is built on armel. For this reason, this patch
+# is not applied using the series file but only selectively on
+# armel with the help of debian/rules.
+# .
+#
+#Index: ghc-8.4.1/aclocal.m4
+#===================================================================
+#--- ghc-8.4.1.orig/aclocal.m4
+#+++ ghc-8.4.1/aclocal.m4
+#@@ -651,15 +651,8 @@
+#         $3="$$3 -D_HPUX_SOURCE"
+#         $5="$$5 -D_HPUX_SOURCE"
+#         ;;
+#-    arm*linux*)
+#-        # On arm/linux and arm/android, tell gcc to generate Arm
+#-        # instructions (ie not Thumb).
+#-        $2="$$2 -marm"
+#-        $3="$$3 -Wl,-z,noexecstack"
+#-        $4="$$4 -z noexecstack"
+#-        ;;
+#-
+#-    aarch64*linux*)
+#+    arm*linux*		| \
+#+    aarch64*linux*	)
+#         $3="$$3 -Wl,-z,noexecstack"
+#         $4="$$4 -z noexecstack"
+#         ;;
+#Index: ghc-8.4.1/libraries/ghci/GHCi/InfoTable.hsc
+#===================================================================
+#--- ghc-8.4.1.orig/libraries/ghci/GHCi/InfoTable.hsc
+#+++ ghc-8.4.1/libraries/ghci/GHCi/InfoTable.hsc
+#@@ -245,17 +245,17 @@
+#                  , fromIntegral ((w64 `shiftR` 32) .&. 0x0000FFFF) ]
+# 
+#     ArchARM { } ->
+#-        -- Generates Arm sequence,
+#+        -- Generates Thumb sequence,
+#         --      ldr r1, [pc, #0]
+#         --      bx r1
+#         --
+#         -- which looks like:
+#         --     00000000 <.addr-0x8>:
+#-        --     0:       00109fe5    ldr    r1, [pc]      ; 8 <.addr>
+#-        --     4:       11ff2fe1    bx     r1
+#+        --     0:       4900        ldr    r1, [pc]      ; 8 <.addr>
+#+        --     4:       4708        bx     r1
+#         let w32 = fromIntegral (funPtrToInt a) :: Word32
+#-        in Left [ 0x00, 0x10, 0x9f, 0xe5
+#-                , 0x11, 0xff, 0x2f, 0xe1
+#+        in Left [ 0x49, 0x00
+#+                , 0x47, 0x08
+#                 , byte0 w32, byte1 w32, byte2 w32, byte3 w32]
+# 
+#     ArchARM64 { } ->
+Index: b/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"))
+ ,("armv6-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1136jf-s", "+strict-align"))
++,("arm-unknown-linux-gnueabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1136jf-s", "+strict-align"))
+ ,("armv6l-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align"))
+ ,("armv7-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
+ ,("armv7a-unknown-linux-gnueabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))


=====================================
p/ghc/debian/patches/bsymbolic-only-for-registerised.patch
=====================================
@@ -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
-@@ -1741,9 +1741,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
-@@ -1800,3 +1803,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 ]


=====================================
p/ghc/debian/patches/build-unlit-and-hp2ps-twice.patch deleted
=====================================
@@ -1,76 +0,0 @@
-Description: Build unlit and hp2ps twice
-Author: Thomas Miedema <thomasmiedema at gmail.com>
-        John Paul Adrian Glaubitz <glaubitz at physik.fu-berlin.de>
-
---- a/utils/ghc-pkg/ghc.mk
-+++ b/utils/ghc-pkg/ghc.mk
-@@ -27,7 +27,7 @@ utils/ghc-pkg_PACKAGE = ghc-pkg
- # Note [Why build certain utils twice?]
- #
- # We build certain utils twice: once with stage0, and once with stage1.
--# Examples are ghc-pkg and hsc2hs.
-+# Examples are ghc-pkg, hsc2hs, hp2ps and unlit.
- #
- # These tools are needed during the bootstrapping process, so we have to use
- # stage0 to build them at first (stage1 doesn't exist yet). (side note: they're
-@@ -38,6 +38,11 @@ utils/ghc-pkg_PACKAGE = ghc-pkg
- # dynamically linked. But the stage0 copies are either statically linked, or
- # linked against libraries on the build machine.
- #
-+# Another reason why we can't install the stage0 copies is that they are
-+# built to run on the build(=host) platform, but when installing a
-+# "cross-compiled stage2 compiler" we need copies that run on the target
-+# platform.
-+#
- # Therefore we build fresh copies, using the stage1 compiler, and install them
- # when you run 'make install'. They are not used for any other purpose.
- 
---- a/utils/hp2ps/ghc.mk
-+++ b/utils/hp2ps/ghc.mk
-@@ -17,7 +17,7 @@ utils/hp2ps_dist_C_SRCS          = AreaB
-                                    Utilities.c
- utils/hp2ps_dist_EXTRA_LIBRARIES = m
- utils/hp2ps_dist_PROGNAME        = hp2ps
--utils/hp2ps_dist_INSTALL         = YES
-+utils/hp2ps_dist_INSTALL         = NO
- utils/hp2ps_dist_INSTALL_INPLACE = YES
- utils/hp2ps_dist_SHELL_WRAPPER              = YES
- utils/hp2ps_dist_INSTALL_SHELL_WRAPPER_NAME = hp2ps
-@@ -25,3 +25,17 @@ utils/hp2ps_dist_INSTALL_SHELL_WRAPPER_N
- utils/hp2ps_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
- 
- $(eval $(call build-prog,utils/hp2ps,dist,0))
-+
-+utils/hp2ps_dist-install_C_SRCS  = AreaBelow.c Curves.c Error.c Main.c \
-+                                   Reorder.c TopTwenty.c AuxFile.c Deviation.c \
-+                                   HpFile.c Marks.c Scale.c TraceElement.c \
-+                                   Axes.c Dimensions.c Key.c PsFile.c Shade.c \
-+                                   Utilities.c
-+utils/hp2ps_dist-install_EXTRA_LIBRARIES = m
-+utils/hp2ps_dist-install_PROGNAME = hp2ps
-+utils/hp2ps_dist-install_TOPDIR  = YES
-+utils/hp2ps_dist-install_INSTALL = YES
-+utils/hp2ps_dist-install_INSTALL_INPLACE = NO
-+
-+# See Note [Why build certain utils twice?].
-+$(eval $(call build-prog,utils/hp2ps,dist-install,1))
---- a/utils/unlit/ghc.mk
-+++ b/utils/unlit/ghc.mk
-@@ -13,8 +13,16 @@
- utils/unlit_dist_C_SRCS  = unlit.c
- utils/unlit_dist_PROGNAME = unlit
- utils/unlit_dist_TOPDIR  = YES
--utils/unlit_dist_INSTALL = YES
-+utils/unlit_dist_INSTALL = NO
- utils/unlit_dist_INSTALL_INPLACE = YES
- 
- $(eval $(call build-prog,utils/unlit,dist,0))
- 
-+utils/unlit_dist-install_C_SRCS  = unlit.c
-+utils/unlit_dist-install_PROGNAME = unlit
-+utils/unlit_dist-install_TOPDIR  = YES
-+utils/unlit_dist-install_INSTALL = YES
-+utils/unlit_dist-install_INSTALL_INPLACE = NO
-+
-+# See Note [Why build certain utils twice?].
-+$(eval $(call build-prog,utils/unlit,dist-install,1))


=====================================
p/ghc/debian/patches/buildpath-abi-stability.patch
=====================================
@@ -1,8 +1,10 @@
 Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
 
+Index: b/compiler/iface/MkIface.hs
+===================================================================
 --- a/compiler/iface/MkIface.hs
 +++ b/compiler/iface/MkIface.hs
-@@ -681,7 +681,7 @@ addFingerprints hsc_env mb_old_fingerpri
+@@ -689,7 +689,7 @@ addFingerprints hsc_env mb_old_fingerpri
     iface_hash <- computeFingerprint putNameLiterally
                        (mod_hash,
                         ann_fn (mkVarOcc "module"),  -- See mkIfaceAnnCache
@@ -11,7 +13,7 @@ Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
                         sorted_deps,
                         mi_hpc iface0)
  
-@@ -714,6 +714,9 @@ addFingerprints hsc_env mb_old_fingerpri
+@@ -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)


=====================================
p/ghc/debian/patches/do-not-use-SHELL deleted
=====================================
@@ -1,65 +0,0 @@
-Description: Do not use $SHELL
- as $SHELL is the user's preferred interactive shell. We do not want this to
- leak into the wrapper scripts.
-Author: Joachim Breitner <nomeata at debian.org>
-
---- a/driver/ghci/ghc.mk
-+++ b/driver/ghci/ghc.mk
-@@ -21,7 +21,7 @@ install_driver_ghci:
- 	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
- 	$(call removeFiles,                                "$(WRAPPER)")
- 	$(CREATE_SCRIPT)                                   "$(WRAPPER)"
--	echo '#!$(SHELL)'                               >> "$(WRAPPER)"
-+	echo '#!/bin/sh'                                >> "$(WRAPPER)"
- 	echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
- 	$(EXECUTABLE_FILE)                                 "$(WRAPPER)"
- 	$(call removeFiles,"$(DESTDIR)$(bindir)/ghci")
-@@ -56,7 +56,7 @@ install_driver_ghcii: GHCII_SCRIPT_VERSI
- install_driver_ghcii:
- 	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
- 	$(call removeFiles,"$(GHCII_SCRIPT)")
--	echo "#!$(SHELL)"                                  >> $(GHCII_SCRIPT)
-+	echo "#!/bin/sh"                                        >> $(GHCII_SCRIPT)
- 	echo 'exec "$$(dirname "$$0")"/ghc --interactive "$$@"' >> $(GHCII_SCRIPT)
- 	$(EXECUTABLE_FILE) $(GHCII_SCRIPT)
- 	cp $(GHCII_SCRIPT) $(GHCII_SCRIPT_VERSIONED)
---- a/rules/shell-wrapper.mk
-+++ b/rules/shell-wrapper.mk
-@@ -41,7 +41,7 @@ $$($1_$2_INPLACE_WRAPPER): $$($1_$2_SHEL
- endif
- $$($1_$2_INPLACE_WRAPPER): $$($1_$2_INPLACE)
- 	$$(call removeFiles,                                                    $$@)
--	echo '#!$$(SHELL)'                                                   >> $$@
-+	echo '#!/bin/sh'                                                     >> $$@
- 	echo 'executablename="$$(TOP)/$$<"'                                  >> $$@
- 	echo 'datadir="$$(TOP)/$$(INPLACE_LIB)"'                             >> $$@
- 	echo 'bindir="$$(TOP)/$$(INPLACE_BIN)"'                              >> $$@
-@@ -80,7 +80,7 @@ install_$1_$2_wrapper:
- 	$$(INSTALL_DIR) "$$(DESTDIR)$$(bindir)"
- 	$$(call removeFiles,                                        "$$(WRAPPER)")
- 	$$(CREATE_SCRIPT)                                           "$$(WRAPPER)"
--	echo '#!$$(SHELL)'                                       >> "$$(WRAPPER)"
-+	echo '#!/bin/sh'                                         >> "$$(WRAPPER)"
- 	echo 'exedir="$$(ghclibexecdir)/bin"'                    >> "$$(WRAPPER)"
- 	echo 'exeprog="$$($1_$2_PROG)"'                          >> "$$(WRAPPER)"
- 	echo 'executablename="$$$$exedir/$$$$exeprog"'           >> "$$(WRAPPER)"
-@@ -106,7 +106,7 @@ BINDIST_EXTRAS += $$($1_$2_BINDIST_WRAPP
- 
- $$($1_$2_BINDIST_WRAPPER): $1/$2/build/tmp/$$($1_$2_PROG)
- 	$$(call removeFiles,                                                  $$@)
--	echo '#!$$(SHELL)'                                                 >> $$@
-+	echo '#!/bin/sh'                                                    >> $$@
- ifeq "$$(DYNAMIC_GHC_PROGRAMS)" "YES"
- 	echo '$$(call prependLibraryPath,$$($1_$2_DEP_LIB_REL_DIRS_SEARCHPATH))' >> $$@
- endif
---- a/utils/mkdirhier/ghc.mk
-+++ b/utils/mkdirhier/ghc.mk
-@@ -14,7 +14,7 @@ $(MKDIRHIER) : utils/mkdirhier/mkdirhier
- 	mkdir -p $(INPLACE_BIN)
- 	mkdir -p $(INPLACE_LIB)
- 	$(call removeFiles,$@)
--	echo '#!$(SHELL)'  		 >> $@
-+	echo '#!/bin/sh'		 >> $@
- 	cat utils/mkdirhier/mkdirhier.sh >> $@
- 	$(EXECUTABLE_FILE) $@
- 


=====================================
p/ghc/debian/patches/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
=====================================
@@ -39,11 +39,11 @@ Subscribers: rwbarton, thomie, carter
 Differential Revision: https://phabricator.haskell.org/D4982
 ---
 
-Index: ghc-8.2.2/rts/posix/OSMem.c
+Index: b/rts/posix/OSMem.c
 ===================================================================
---- ghc-8.2.2.orig/rts/posix/OSMem.c
-+++ ghc-8.2.2/rts/posix/OSMem.c
-@@ -422,6 +422,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.2.2/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 */
-@@ -489,6 +491,8 @@
+@@ -502,6 +504,8 @@ void *osReserveHeapMemory(void *startAdd
  
      attempt = 0;
      while (1) {


=====================================
p/ghc/debian/patches/fix-build-using-unregisterized-v8.2
=====================================
@@ -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 <iliastsi at 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
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


=====================================
p/ghc/debian/patches/fix-hssplicety.patch deleted
=====================================
@@ -1,39 +0,0 @@
-From: Alec Theriault <alec.theriault at gmail.com>
-Date: Mon, 5 Feb 2018 13:45:47 -0800
-Subject: [PATCH] Don't barf on 'HsSpliceTy'
-Applied-Upstream: https://github.com/haskell/haddock/commit/76d0f9b90a7b2f65ae12e1ce5dd0552909493252
-
-This handles 'HsSpliceTy's by replacing them with what they expand to.
-IIUC everything that is happening, 'renameHsSpliceTy' should not be
-able to fail for the inputs we feed it from GHC.
-
-This fixes #574.
----
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs | 13 ++++++++++++-
- 1 file changed, 12 insertions(+), 1 deletion(-)
-
---- a/utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
-+++ b/utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
-@@ -264,10 +264,21 @@
-   HsCoreTy a              -> pure (HsCoreTy a)
-   HsExplicitListTy i a b  -> HsExplicitListTy i a <$> mapM renameLType b
-   HsExplicitTupleTy a b   -> HsExplicitTupleTy a <$> mapM renameLType b
--  HsSpliceTy _ _          -> error "renameType: HsSpliceTy"
-+  HsSpliceTy s _          -> renameHsSpliceTy s
-   HsWildCardTy a          -> HsWildCardTy <$> renameWildCardInfo a
-   HsAppsTy _              -> error "renameType: HsAppsTy"
- 
-+-- | Rename splices, but _only_ those that turn out to be for types.
-+-- I think this is actually safe for our possible inputs:
-+--
-+--  * the input is from after GHC's renamer, so should have an 'HsSpliced'
-+--  * the input is typechecked, and only 'HsSplicedTy' should get through that
-+--
-+renameHsSpliceTy :: HsSplice Name -> RnM (HsType DocName)
-+renameHsSpliceTy (HsSpliced _ (HsSplicedTy t)) = renameType t
-+renameHsSpliceTy (HsSpliced _ _) = error "renameHsSpliceTy: not an HsSplicedTy"
-+renameHsSpliceTy _ = error "renameHsSpliceTy: not an HsSpliced"
-+
- renameLHsQTyVars :: LHsQTyVars Name -> RnM (LHsQTyVars DocName)
- renameLHsQTyVars (HsQTvs { hsq_implicit = _, hsq_explicit = tvs })
-   = do { tvs' <- mapM renameLTyVarBndr tvs


=====================================
p/ghc/debian/patches/haddock-out-of-memory.patch
=====================================
@@ -0,0 +1,248 @@
+commit 18cb44dfae3f0847447da33c9d7a25d2709d838f
+Author: Alec Theriault <alec.theriault at gmail.com>
+Date:   Tue Aug 21 16:03:40 2018 -0400
+
+    Explicitly tell 'getNameToInstances' mods to load
+    
+    Calculating which modules to load based on the InteractiveContext means
+    maintaining a potentially very large GblRdrEnv.
+    
+    In Haddock's case, it is much cheaper (from a memory perspective) to
+    just keep track of which modules interfaces we want loaded then hand
+    these off explicitly to 'getNameToInstancesIndex'.
+    
+    Bumps haddock submodule (commit 40eb5aabed0ae)
+    
+    Reviewers: alexbiehl, bgamari
+    
+    Reviewed By: alexbiehl
+    
+    Subscribers: rwbarton, thomie, carter
+    
+    Differential Revision: https://phabricator.haskell.org/D5003
+    
+    (cherry picked from commit c971e1193fa44bb507d1806d5bb61768670dc912)
+
+Index: b/compiler/main/GHC.hs
+===================================================================
+--- a/compiler/main/GHC.hs
++++ b/compiler/main/GHC.hs
+@@ -117,6 +117,7 @@ module GHC (
+         showModule,
+         moduleIsBootOrNotObjectLinkable,
+         getNameToInstancesIndex,
++        getNameToInstancesIndex2,
+ 
+         -- ** Inspecting types and kinds
+         exprType, TcRnExprMode(..),
+@@ -297,7 +298,8 @@ import HscMain
+ import GhcMake
+ import DriverPipeline   ( compileOne' )
+ import GhcMonad
+-import TcRnMonad        ( finalSafeMode, fixSafeInstances )
++import TcRnMonad        ( finalSafeMode, fixSafeInstances, initIfaceTcRn )
++import LoadIface        ( loadSysInterface )
+ import TcRnTypes
+ import Packages
+ import NameSet
+@@ -1247,10 +1249,27 @@ getNameToInstancesIndex :: GhcMonad m
+   => [Module]  -- ^ visible modules. An orphan instance will be returned if and
+                -- only it is visible from at least one module in the list.
+   -> m (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
+-getNameToInstancesIndex visible_mods = do
++getNameToInstancesIndex visible_mods =
++  getNameToInstancesIndex2 visible_mods Nothing
++
++-- | Retrieve all type and family instances in the environment, indexed
++-- by 'Name'. Each name's lists will contain every instance in which that name
++-- is mentioned in the instance head.
++getNameToInstancesIndex2 :: GhcMonad m
++  => [Module]        -- ^ visible modules. An orphan instance will be returned
++                     -- if it is visible from at least one module in the list.
++  -> Maybe [Module]  -- ^ modules to load. If this is not specified, we load
++                     -- modules for everything that is in scope unqualified.
++  -> m (Messages, Maybe (NameEnv ([ClsInst], [FamInst])))
++getNameToInstancesIndex2 visible_mods mods_to_load = do
+   hsc_env <- getSession
+   liftIO $ runTcInteractive hsc_env $
+-    do { loadUnqualIfaces hsc_env (hsc_IC hsc_env)
++    do { case mods_to_load of
++           Nothing -> loadUnqualIfaces hsc_env (hsc_IC hsc_env)
++           Just mods ->
++             let doc = text "Need interface for reporting instances in scope"
++             in initIfaceTcRn $ mapM_ (loadSysInterface doc) mods
++
+        ; InstEnvs {ie_global, ie_local} <- tcGetInstEnvs
+        ; let visible_mods' = mkModuleSet visible_mods
+        ; (pkg_fie, home_fie) <- tcGetFamInstEnvs
+Index: b/utils/haddock/haddock-api/src/Haddock/Interface.hs
+===================================================================
+--- a/utils/haddock/haddock-api/src/Haddock/Interface.hs
++++ b/utils/haddock/haddock-api/src/Haddock/Interface.hs
+@@ -1,4 +1,4 @@
+-{-# LANGUAGE CPP, OverloadedStrings #-}
++{-# LANGUAGE CPP, OverloadedStrings, BangPatterns #-}
+ -----------------------------------------------------------------------------
+ -- |
+ -- Module      :  Haddock.Interface
+@@ -51,6 +51,7 @@ import System.Directory
+ import System.FilePath
+ import Text.Printf
+ 
++import Module (mkModuleSet, emptyModuleSet, unionModuleSet, ModuleSet)
+ import Digraph
+ import DynFlags hiding (verbosity)
+ import Exception
+@@ -59,7 +60,9 @@ import HscTypes
+ import FastString (unpackFS)
+ import MonadUtils (liftIO)
+ import TcRnTypes (tcg_rdr_env)
+-import RdrName (plusGlobalRdrEnv)
++import Name (nameIsFromExternalPackage, nameOccName)
++import OccName (isTcOcc)
++import RdrName (unQualOK, gre_name, globalRdrEnvElts)
+ import ErrUtils (withTiming)
+ 
+ #if defined(mingw32_HOST_OS)
+@@ -87,7 +90,7 @@ processModules verbosity modules flags e
+   out verbosity verbose "Creating interfaces..."
+   let instIfaceMap =  Map.fromList [ (instMod iface, iface) | ext <- extIfaces
+                                    , iface <- ifInstalledIfaces ext ]
+-  interfaces <- createIfaces0 verbosity modules flags instIfaceMap
++  (interfaces, ms) <- createIfaces0 verbosity modules flags instIfaceMap
+ 
+   let exportedNames =
+         Set.unions $ map (Set.fromList . ifaceExports) $
+@@ -96,7 +99,7 @@ processModules verbosity modules flags e
+   out verbosity verbose "Attaching instances..."
+   interfaces' <- {-# SCC attachInstances #-}
+                  withTiming getDynFlags "attachInstances" (const ()) $ do
+-                   attachInstances (exportedNames, mods) interfaces instIfaceMap
++                   attachInstances (exportedNames, mods) interfaces instIfaceMap ms
+ 
+   out verbosity verbose "Building cross-linking environment..."
+   -- Combine the link envs of the external packages into one
+@@ -120,7 +123,7 @@ processModules verbosity modules flags e
+ --------------------------------------------------------------------------------
+ 
+ 
+-createIfaces0 :: Verbosity -> [String] -> [Flag] -> InstIfaceMap -> Ghc [Interface]
++createIfaces0 :: Verbosity -> [String] -> [Flag] -> InstIfaceMap -> Ghc ([Interface], ModuleSet)
+ createIfaces0 verbosity modules flags instIfaceMap =
+   -- Output dir needs to be set before calling depanal since depanal uses it to
+   -- compute output file names that are stored in the DynFlags of the
+@@ -150,43 +153,52 @@ createIfaces0 verbosity modules flags in
+       depanal [] False
+ 
+ 
+-createIfaces :: Verbosity -> [Flag] -> InstIfaceMap -> ModuleGraph -> Ghc [Interface]
++createIfaces :: Verbosity -> [Flag] -> InstIfaceMap -> ModuleGraph -> Ghc ([Interface], ModuleSet)
+ createIfaces verbosity flags instIfaceMap mods = do
+   let sortedMods = flattenSCCs $ topSortModuleGraph False mods Nothing
+   out verbosity normal "Haddock coverage:"
+-  (ifaces, _) <- foldM f ([], Map.empty) sortedMods
+-  return (reverse ifaces)
++  (ifaces, _, !ms) <- foldM f ([], Map.empty, emptyModuleSet) sortedMods
++  return (reverse ifaces, ms)
+   where
+-    f (ifaces, ifaceMap) modSummary = do
++    f (ifaces, ifaceMap, !ms) modSummary = do
+       x <- {-# SCC processModule #-}
+            withTiming getDynFlags "processModule" (const ()) $ do
+              processModule verbosity modSummary flags ifaceMap instIfaceMap
+       return $ case x of
+-        Just iface -> (iface:ifaces, Map.insert (ifaceMod iface) iface ifaceMap)
+-        Nothing    -> (ifaces, ifaceMap) -- Boot modules don't generate ifaces.
++        Just (iface, ms') -> ( iface:ifaces
++                             , Map.insert (ifaceMod iface) iface ifaceMap
++                             , unionModuleSet ms ms' )
++        Nothing           -> ( ifaces
++                             , ifaceMap
++                             , ms ) -- Boot modules don't generate ifaces.
+ 
+ 
+-processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe Interface)
++processModule :: Verbosity -> ModSummary -> [Flag] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe (Interface, ModuleSet))
+ processModule verbosity modsum flags modMap instIfaceMap = do
+   out verbosity verbose $ "Checking module " ++ moduleString (ms_mod modsum) ++ "..."
+   tm <- {-# SCC "parse/typecheck/load" #-} loadModule =<< typecheckModule =<< parseModule modsum
+ 
+-  -- We need to modify the interactive context's environment so that when
+-  -- Haddock later looks for instances, it also looks in the modules it
+-  -- encountered while typechecking.
+-  --
+-  -- See https://github.com/haskell/haddock/issues/469.
+-  hsc_env at HscEnv{ hsc_IC = old_IC } <- getSession
+-  let new_rdr_env = tcg_rdr_env . fst . GHC.tm_internals_ $ tm
+-  setSession hsc_env{ hsc_IC = old_IC {
+-    ic_rn_gbl_env = ic_rn_gbl_env old_IC `plusGlobalRdrEnv` new_rdr_env
+-  } }
+-
+   if not $ isBootSummary modsum then do
+     out verbosity verbose "Creating interface..."
+     (interface, msg) <- {-# SCC createIterface #-}
+                         withTiming getDynFlags "createInterface" (const ()) $ do
+                           runWriterGhc $ createInterface tm flags modMap instIfaceMap
++
++    -- We need to modify the interactive context's environment so that when
++    -- Haddock later looks for instances, it also looks in the modules it
++    -- encountered while typechecking.
++    --
++    -- See https://github.com/haskell/haddock/issues/469.
++    hsc_env <- getSession
++    let new_rdr_env = tcg_rdr_env . fst . GHC.tm_internals_ $ tm
++        this_pkg = thisPackage (hsc_dflags hsc_env)
++        !mods = mkModuleSet [ nameModule name
++                            | gre <- globalRdrEnvElts new_rdr_env
++                            , let name = gre_name gre
++                            , nameIsFromExternalPackage this_pkg name
++                            , isTcOcc (nameOccName name)   -- Types and classes only
++                            , unQualOK gre ]               -- In scope unqualified
++
+     liftIO $ mapM_ putStrLn msg
+     dflags <- getDynFlags
+     let (haddockable, haddocked) = ifaceHaddockCoverage interface
+@@ -220,7 +232,7 @@ processModule verbosity modsum flags mod
+         unless header $ out verbosity normal "    Module header"
+         mapM_ (out verbosity normal . ("    " ++)) undocumentedExports
+     interface' <- liftIO $ evaluate interface
+-    return (Just interface')
++    return (Just (interface', mods))
+   else
+     return Nothing
+ 
+Index: b/utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs
+===================================================================
+--- a/utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs
++++ b/utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs
+@@ -1,4 +1,4 @@
+-{-# LANGUAGE CPP, MagicHash #-}
++{-# LANGUAGE CPP, MagicHash, BangPatterns #-}
+ {-# LANGUAGE TypeFamilies #-}
+ -----------------------------------------------------------------------------
+ -- |
+@@ -34,6 +34,7 @@ import FamInstEnv
+ import FastString
+ import GHC
+ import InstEnv
++import Module ( ModuleSet, moduleSetElts )
+ import MonadUtils (liftIO)
+ import Name
+ import NameEnv
+@@ -51,11 +52,13 @@ type Modules = Set.Set Module
+ type ExportInfo = (ExportedNames, Modules)
+ 
+ -- Also attaches fixities
+-attachInstances :: ExportInfo -> [Interface] -> InstIfaceMap -> Ghc [Interface]
+-attachInstances expInfo ifaces instIfaceMap = do
+-  (_msgs, mb_index) <- getNameToInstancesIndex (map ifaceMod ifaces)
++attachInstances :: ExportInfo -> [Interface] -> InstIfaceMap -> ModuleSet -> Ghc [Interface]
++attachInstances expInfo ifaces instIfaceMap mods = do
++  (_msgs, mb_index) <- getNameToInstancesIndex2 (map ifaceMod ifaces) mods'
+   mapM (attach $ fromMaybe emptyNameEnv mb_index) ifaces
+   where
++    mods' = Just (moduleSetElts mods)
++
+     -- TODO: take an IfaceMap as input
+     ifaceMap = Map.fromList [ (ifaceMod i, i) | i <- ifaces ]
+ 


=====================================
p/ghc/debian/patches/hurd.diff
=====================================
@@ -1,8 +1,10 @@
 Provided by “Pino” via Samuel Thibault. Not yet pushed upstream.
 
+Index: b/aclocal.m4
+===================================================================
 --- a/aclocal.m4
 +++ b/aclocal.m4
-@@ -274,7 +274,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
+@@ -272,12 +272,15 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
          nto-qnx)
              test -z "[$]2" || eval "[$]2=OSQNXNTO"
              ;;
@@ -11,9 +13,7 @@ Provided by “Pino” via Samuel Thibault. Not yet pushed upstream.
              test -z "[$]2" || eval "[$]2=OSUnknown"
              ;;
          aix)
-@@ -283,6 +283,9 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
-         linux-android)
-             test -z "[$]2" || eval "[$]2=OSAndroid"
+             test -z "[$]2" || eval "[$]2=OSAIX"
              ;;
 +        gnu)
 +            test -z "[$]2" || eval "[$]2=OSHurd"
@@ -21,19 +21,21 @@ Provided by “Pino” via Samuel Thibault. Not yet pushed upstream.
          *)
              echo "Unknown OS '[$]1'"
              exit 1
+Index: b/compiler/utils/Platform.hs
+===================================================================
 --- a/compiler/utils/Platform.hs
 +++ b/compiler/utils/Platform.hs
-@@ -88,6 +88,7 @@ data OS
+@@ -87,6 +87,7 @@ data OS
+         | OSHaiku
          | OSQNXNTO
-         | OSAndroid
          | OSAIX
 +        | OSHurd
          deriving (Read, Show, Eq)
  
  -- | ARM Instruction Set Architecture, Extensions and ABI
-@@ -139,6 +140,7 @@ osElfTarget OSHaiku     = True
+@@ -136,6 +137,7 @@ osElfTarget OSKFreeBSD  = True
+ osElfTarget OSHaiku     = True
  osElfTarget OSQNXNTO    = False
- osElfTarget OSAndroid   = True
  osElfTarget OSAIX       = False
 +osElfTarget OSHurd      = True
  osElfTarget OSUnknown   = False


=====================================
p/ghc/debian/patches/llvm-targets-Add-versioned-ARM-targets.patch
=====================================
@@ -0,0 +1,43 @@
+From e4003b6dc6a84d870116de9f47057c15b1576f36 Mon Sep 17 00:00:00 2001
+From: Guillaume GARDET <guillaume.gardet at opensuse.org>
+Date: Fri, 18 May 2018 08:56:28 +0200
+Subject: [PATCH] llvm-targets: Add versioned ARM targets
+
+Namely armv6l-unknown-linux-gnueabihf and
+armv7l-unknown-linux-gnueabihf.
+---
+ llvm-targets                          | 4 +++-
+ 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 @@
+ ,("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"))
+ ,("armv6-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1136jf-s", "+strict-align"))
++,("armv6l-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align"))
+ ,("armv7-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
++,("armv7a-unknown-linux-gnueabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
++,("armv7l-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
+ ,("aarch64-unknown-linux-gnu", ("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "generic", "+neon"))
+ ,("aarch64-unknown-linux", ("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "generic", "+neon"))
+-,("armv7a-unknown-linux-gnueabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
+ ,("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 @@
+ 
+ # Target sets
+ WINDOWS_x86="i386-unknown-windows i686-unknown-windows x86_64-unknown-windows"
+-LINUX_ARM="arm-unknown-linux-gnueabihf armv6-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf aarch64-unknown-linux-gnu aarch64-unknown-linux armv7a-unknown-linux-gnueabi"
++LINUX_ARM="arm-unknown-linux-gnueabihf armv6-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf aarch64-unknown-linux-gnu aarch64-unknown-linux armv7a-unknown-linux-gnueabi armv7l-unknown-linux-gnueabihf"
+ LINUX_x86="i386-unknown-linux-gnu i386-unknown-linux x86_64-unknown-linux-gnu x86_64-unknown-linux"
+ ANDROID="armv7-unknown-linux-androideabi aarch64-unknown-linux-android"
+ QNX="arm-unknown-nto-qnx-eabi"


=====================================
p/ghc/debian/patches/lower-optimization-for-unreg.patch deleted
=====================================
@@ -1,40 +0,0 @@
-Description: mk/config.mk.in: lower GhcLibHcOpts -O2 optimization down to -O1 on UNREG
-Last-Update: 2018-04-07
-
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -70,16 +70,6 @@
- GhcStage2HcOpts=-O2
- GhcStage3HcOpts=-O2
- 
--# Disable -O2 optimization. Otherwise amount of generated C code
--# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.hs')
--# and sometimes not compile at all (powerpc64 overflows something
--# on 'compiler/hsSyn/HsExpr.hs').
--ifeq "$(GhcUnregisterised)" "YES"
--GhcStage1HcOpts=
--GhcStage2HcOpts=
--GhcStage3HcOpts=
--endif
--
- # Note [Stage number in build variables].
- #
- # There are (unfortunately) two different naming schemes for build variables
-@@ -326,6 +316,17 @@
- 
- GhcLibHcOpts=-O2
- 
-+# Disable -O2 optimization. Otherwise amount of generated C code
-+# makes things very slow to compile (~5 minutes on core-i7 for 'compiler/hsSyn/HsExpr.hs')
-+# and sometimes not compile at all (powerpc64 overflows something
-+# on 'compiler/hsSyn/HsExpr.hs').
-+ifeq "$(GhcUnregisterised)" "YES"
-+GhcStage1HcOpts=
-+GhcStage2HcOpts=
-+GhcStage3HcOpts=
-+GhcLibHcOpts=
-+endif
-+
- # Strip local symbols from libraries?  This can make the libraries smaller,
- # but makes debugging somewhat more difficult.  Doesn't work with all ld's.
- #


=====================================
p/ghc/debian/patches/no-missing-haddock-file-warning
=====================================
@@ -3,9 +3,11 @@ Description: Do not emit a warning if the .haddock file is missing
  without the -doc package.
 Author: Joachim Breitner <nomeata at debian.org>
 
+Index: b/utils/ghc-pkg/Main.hs
+===================================================================
 --- a/utils/ghc-pkg/Main.hs
 +++ b/utils/ghc-pkg/Main.hs
-@@ -1773,8 +1773,10 @@ checkPackageConfig pkg verbosity db_stac
+@@ -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)


=====================================
p/ghc/debian/patches/powerpcspe-disable-FPU-code.patch deleted
=====================================
@@ -1,66 +0,0 @@
-Description: Disable FPU code on powerpspe
- powerpcspe CPUs don't have an FPU, so the FPU PPC assembly
- code has to be disabled on this architecture.
- See: https://ghc.haskell.org/trac/ghc/ticket/12075
- .
-
---- ghc-8.0.1.orig/aclocal.m4
-+++ ghc-8.0.1/aclocal.m4
-@@ -185,6 +185,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
-             test -z "[$]2" || eval "[$]2=ArchX86_64"
-             ;;
-         powerpc)
-+            FP_CHECK_FOR_SOFT_FLOAT_POWERPC()
-             test -z "[$]2" || eval "[$]2=ArchPPC"
-             ;;
-         powerpc64)
-@@ -458,6 +459,25 @@ AC_DEFUN([GET_ARM_ISA],
-         AC_SUBST(ARM_ISA)
- ])
- 
-+# CHECK_FOR_SOFT_FLOAT_POWERPC
-+# ----------------------------------
-+# Check whether we have hardware floating point support. See #12075
-+AC_DEFUN([FP_CHECK_FOR_SOFT_FLOAT_POWERPC],
-+[
-+  AC_COMPILE_IFELSE(
-+    [AC_LANG_PROGRAM(
-+    [],
-+    [#if defined(__NO_FPRS__)
-+     softfloat
-+     #else
-+     return 0;
-+     #endif
-+    ])],
-+    [value=NO],
-+    [value=YES])
-+
-+  AC_DEFINE(powerpc_HOST_ARCH_SOFT_FLOAT, $value, [soft-float PowerPC])
-+])
- 
- # FP_SETTINGS
- # ----------------------------------
---- ghc-8.0.1.orig/mk/project.mk.in
-+++ ghc-8.0.1/mk/project.mk.in
-@@ -162,3 +162,6 @@ GHC_LLVM_AFFECTED_BY_9439 = @GHC_LLVM_AF
- ifeq "$(TargetArch_CPP)" "arm"
- ARM_ISA=@ARM_ISA@
- endif
-+ifeq "$(TargetArch_CPP)" "powerpc"
-+POWERPC_SOFT_FLOAT=@powerpc_HOST_ARCH_SOFT_FLOAT@
-+endif
---- ghc-8.0.1.orig/rts/ghc.mk
-+++ ghc-8.0.1/rts/ghc.mk
-@@ -55,9 +55,12 @@ rts_S_SRCS += rts/AdjustorAsm.S
- endif
- # this matches substrings of powerpc64le, including "powerpc" and "powerpc64"
- ifneq "$(findstring $(TargetArch_CPP), powerpc64le)" ""
-+# and this matches soft-float PPC (#12075)
-+ifneq "$(POWERPC_NO_FPRS)" "YES"
- rts_S_SRCS += rts/StgCRunAsm.S
- endif
- endif
-+endif
- 
- ifeq "$(GhcUnregisterised)" "YES"
- GENAPPLY_OPTS = -u


=====================================
p/ghc/debian/patches/reproducible-tmp-names deleted
=====================================
@@ -1,41 +0,0 @@
-This is an attempt to make GHC build reproducible. The name of .c files may end
-up in the resulting binary (in the debug section), but not the directory.
-
-Instead of using the process id, create a hash from the command line arguments,
-and assume that is going to be unique.
-
---- a/compiler/main/SysTools.hs
-+++ b/compiler/main/SysTools.hs
-@@ -68,6 +68,7 @@ import Platform
- import Util
- import DynFlags
- import Exception
-+import Fingerprint
- 
- import LlvmCodeGen.Base (llvmVersionStr, supportedLlvmVersion)
- 
-@@ -1121,8 +1122,8 @@ getTempDir dflags = do
-     mapping <- readIORef dir_ref
-     case Map.lookup tmp_dir mapping of
-         Nothing -> do
--            pid <- getProcessID
--            let prefix = tmp_dir </> "ghc" ++ show pid ++ "_"
-+            pid <- getStableProcessID
-+            let prefix = tmp_dir </> "ghc" ++ pid ++ "_"
-             mask_ $ mkTempDir prefix
-         Just dir -> return dir
-   where
-@@ -1558,6 +1559,13 @@ getProcessID :: IO Int
- getProcessID = System.Posix.Internals.c_getpid >>= return . fromIntegral
- #endif
- 
-+-- Debian-specific hack to get reproducible output, by not using the "random"
-+-- pid, but rather something determinisic
-+getStableProcessID :: IO String
-+getStableProcessID = do
-+    args <- getArgs
-+    return $ take 4 $ show $ fingerprintString $ unwords args
-+
- -- Divvy up text stream into lines, taking platform dependent
- -- line termination into account.
- linesPlatform :: String -> [String]


=====================================
p/ghc/debian/patches/risc-support.patch
=====================================
@@ -3,9 +3,11 @@ Description: cherry-pick of upstream commits
  5e63a25249f3cb07300258e115af9ff55079d2ea.patch:
 Last-Update: 2018-07-19
 
---- ghc-8.2.2.orig/aclocal.m4
-+++ ghc-8.2.2/aclocal.m4
-@@ -216,7 +216,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
+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"
              ;;
@@ -14,7 +16,7 @@ Last-Update: 2018-07-19
              test -z "[$]2" || eval "[$]2=ArchUnknown"
              ;;
          *)
-@@ -1898,6 +1898,12 @@ case "$1" in
+@@ -1884,6 +1884,12 @@ case "$1" in
    powerpc*)
      $2="powerpc"
      ;;


=====================================
p/ghc/debian/patches/series
=====================================
@@ -3,13 +3,14 @@ ARM-VFPv3D16
 no-missing-haddock-file-warning
 hurd.diff
 buildpath-abi-stability.patch
-reproducible-tmp-names
-do-not-use-SHELL
 x32-use-native-x86_64-insn.patch
 use-stage1-binaries-for-install.patch
-build-unlit-and-hp2ps-twice.patch
-fix-hssplicety.patch
-lower-optimization-for-unreg.patch
+llvm-targets-Add-versioned-ARM-targets.patch
 bsymbolic-only-for-registerised.patch
-risc-support.patch
+use-llvm-6.0.patch
 e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
+risc-support.patch
+armel-revert-ghci-fixes.patch
+fix-build-using-unregisterized-v8.2
+add_-latomic_to_ghc-prim
+haddock-out-of-memory.patch


=====================================
p/ghc/debian/patches/use-debian-gen_contents_index
=====================================
@@ -1,6 +1,8 @@
+Index: b/ghc.mk
+===================================================================
 --- a/ghc.mk
 +++ b/ghc.mk
-@@ -829,7 +829,6 @@ endif
+@@ -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)
@@ -8,7 +10,7 @@
  ifeq "$(phase)" "final"
  $(eval $(call all-target,library_doc_index,libraries/dist-haddock/index.html))
  endif
-@@ -950,12 +949,8 @@ endif
+@@ -953,12 +952,8 @@ endif
  	$(INSTALL_DIR) "$(DESTDIR)$(docdir)/html"
  	$(INSTALL_DOC) $(INSTALL_OPTS) docs/index.html "$(DESTDIR)$(docdir)/html"
  ifneq "$(INSTALL_LIBRARY_DOCS)" ""
@@ -22,7 +24,7 @@
  endif
  ifneq "$(INSTALL_HTML_DOC_DIRS)" ""
  	for i in $(INSTALL_HTML_DOC_DIRS); do \
-@@ -1067,7 +1062,6 @@ $(eval $(call bindist-list,.,\
+@@ -1078,7 +1073,6 @@ $(eval $(call bindist-list,.,\
      mk/project.mk \
      mk/install.mk.in \
      bindist.mk \


=====================================
p/ghc/debian/patches/use-llvm-6.0.patch
=====================================
@@ -0,0 +1,17 @@
+Description: Use llvm 6.0 on arm*
+Author: Gianfranco Costamagna <locutusofborg at debian.org>
+Last-Update: 2018-07-19
+
+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
+ # 3.5/3.6 release of LLVM.
+-LlvmVersion=5.0
++LlvmVersion=6.0
+ AC_SUBST([LlvmVersion])
+ sUPPORTED_LLVM_VERSION=$(echo \($LlvmVersion\) | sed 's/\./,/')
+ AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION], ${sUPPORTED_LLVM_VERSION}, [The supported LLVM version number])


=====================================
p/ghc/debian/patches/use-stage1-binaries-for-install.patch
=====================================
@@ -7,9 +7,11 @@ Description: Use the stage1 binaries for install
 Author: John Paul Adrian Glaubitz <glaubitz at physik.fu-berlin.de>
 Last-Update: 2017-01-29
 
+Index: b/ghc.mk
+===================================================================
 --- a/ghc.mk
 +++ b/ghc.mk
-@@ -963,8 +963,12 @@ INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdi
+@@ -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"


=====================================
p/ghc/debian/patches/x32-use-native-x86_64-insn.patch
=====================================
@@ -12,9 +12,11 @@ Description: Use native x86_64 instructions on x32
  See: https://ghc.haskell.org/trac/ghc/ticket/11571
  .
 
+Index: b/rts/RtsSymbols.c
+===================================================================
 --- a/rts/RtsSymbols.c
 +++ b/rts/RtsSymbols.c
-@@ -917,7 +917,7 @@
+@@ -919,7 +919,7 @@
  
  
  // 64-bit support functions in libgcc.a


=====================================
p/ghc/debian/rules
=====================================
@@ -23,9 +23,10 @@ export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 export DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
+EXTRA_CONFIGURE_FLAGS += --target $(DEB_HOST_GNU_TYPE)
 # We're cross-building if DEB_BUILD_GNU_TYPE != DEB_HOST_GNU_TYPE
 ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-  confflags += --target $(DEB_HOST_GNU_TYPE) --enable-unregisterised
+  EXTRA_CONFIGURE_FLAGS += --enable-unregisterised
   BUILD_CROSS=YES
 else
   BUILD_CROSS=NO
@@ -34,7 +35,7 @@ endif
 ProjectVersion=$(shell cat VERSION)
 
 GHC=$(firstword $(shell bash -c "type -p ghc"))
-EXTRA_CONFIGURE_FLAGS=--with-ghc="$(GHC)"
+EXTRA_CONFIGURE_FLAGS +=--with-ghc="$(GHC)"
 
 DEB_HOOGLE_TXT_DIR = /usr/lib/ghc-doc/hoogle/
 
@@ -48,7 +49,8 @@ endif
 # NOTE: This should probably be removed, and revert back to using ld.gold,
 # once #901947 has been fixed.
 # Do the same for powerpcspe, due to https://bugs.debian.org/904915
-ifneq (,$(filter mips mipsel powerpcspe, $(DEB_HOST_ARCH)))
+# Do the same for sparc64, due to https://bugs.debian.org/908998
+ifneq (,$(filter mips mipsel powerpcspe sparc64, $(DEB_HOST_ARCH)))
   EXTRA_CONFIGURE_FLAGS += --disable-ld-override
 endif
 
@@ -80,9 +82,6 @@ endif
 ifeq (armhf,$(DEB_HOST_ARCH))
 	echo "SRC_HC_OPTS += -D__ARM_PCS_VFP" >> mk/build.mk
 endif
-ifeq (armel,$(DEB_HOST_ARCH))
-	patch -p1 < debian/patches/armel-revert-ghci-fixes.patch
-endif
 ifneq (,$(filter mips mipsel, $(DEB_HOST_ARCH)))
 	echo "SRC_HC_OPTS     += -optc--param -optcggc-min-expand=10" >> mk/build.mk
 endif
@@ -125,11 +124,9 @@ endif
 	echo 'RANLIB_CMD = $(DEB_HOST_GNU_TYPE)-ranlib'>> mk/build.mk
 	# We want verbose builds
 	echo 'V=1'                                     >> mk/build.mk
-	./configure $(confflags) --prefix=/usr \
+	dh_auto_configure -- \
 		$(EXTRA_CONFIGURE_FLAGS) \
-		--with-system-libffi \
-		--with-llc=llc-3.9 \
-		--with-opt=opt-3.9
+		--with-system-libffi --libdir=/usr/lib
 
 override_dh_auto_build:
 	dh_auto_build


=====================================
p/ghc/debian/watch
=====================================
@@ -1,4 +1,4 @@
 version=3
-opts=pgpsigurlmangle=s/$/.sig/,dirversionmangle=s/-rc/~rc/ \
+opts="pgpsigurlmangle=s/$/.sig/,dirversionmangle=s/-rc/~rc/,repacksuffix=+dfsg1,dversionmangle=s/\+dfsg\d*$//" \
 https://downloads.haskell.org/~ghc/(\d[\d.rc-]*)/ghc-(\d[\d.]*)-src.tar.(?:bz2|xz|gz)
 



View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/compare/b1aa16e523b241ca63a97e921f921806e1cf2214...0d47dfa99f2978071dce51e9f0a6b1719334d100

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/compare/b1aa16e523b241ca63a97e921f921806e1cf2214...0d47dfa99f2978071dce51e9f0a6b1719334d100
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20180926/5f17ee14/attachment-0001.html>


More information about the Pkg-haskell-commits mailing list