Commit 5195d758 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis

Merge branch 'experimental'

parents b1aa16e5 fcfb99be
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@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@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@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@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@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@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@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@debian.org> Wed, 30 May 2018 18:34:37 -0400
ghc (8.4.2-1) experimental; urgency=medium
* New upstream release
-- Gianfranco Costamagna <locutusofborg@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@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@debian.org> Mon, 09 Apr 2018 15:54:00 +0200
ghc (8.2.2-6) unstable; urgency=medium
* debian/patches/{risc-support,e175aaf6918bb2b497b83618dc4c270a0d231a1c}.patch
......
......@@ -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.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.
......
......@@ -2,6 +2,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ghc
Upstream-Contact: Simon Marlow <marlowsd@gmail.com>
Source: https://downloads.haskell.org/~ghc/
Files-Excluded: libraries/bytestring/tests/data
Files: *
License: BSD-3-clause
......
......@@ -6,9 +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: 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
......
commit ec9aacf3eb2975fd302609163aaef429962ecd87
Author: Moritz Angermann <moritz.angermann@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@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
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", ""))
......@@ -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 ]
......
Description: Build unlit and hp2ps twice
Author: Thomas Miedema <thomasmiedema@gmail.com>
John Paul Adrian Glaubitz <glaubitz@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))
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)
......
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@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) $@
......@@ -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) {
......
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: Alec Theriault <alec.theriault@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"