summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGianfranco Costamagna <costamagnagianfranco@yahoo.it>2017-09-03 22:21:33 +0200
committerGianfranco Costamagna <costamagnagianfranco@yahoo.it>2017-09-03 22:21:33 +0200
commit47a207a5e2b92ff7b69b15a6e857782c51d49021 (patch)
treef3ce8f31311427167778fbd7b1dfd4f6e2eedabc
parent072b878685215a929185bcfadab5523de17b6f3e (diff)
downloadDHG_packages-47a207a5e2b92ff7b69b15a6e857782c51d49021.tar.gz
ghc: add missing patches
-rw-r--r--p/ghc/debian/patches/avoid-CrossCompilerPrefix-stage2.patch31
-rw-r--r--p/ghc/debian/patches/build-unlit-and-hp2ps-twice.patch80
-rw-r--r--p/ghc/debian/patches/use-stage1-binaries-for-install.patch26
3 files changed, 137 insertions, 0 deletions
diff --git a/p/ghc/debian/patches/avoid-CrossCompilerPrefix-stage2.patch b/p/ghc/debian/patches/avoid-CrossCompilerPrefix-stage2.patch
new file mode 100644
index 000000000..deeb2edf8
--- /dev/null
+++ b/p/ghc/debian/patches/avoid-CrossCompilerPrefix-stage2.patch
@@ -0,0 +1,31 @@
+Description: Don't use cross-compile prefix for stage2 cross-builds
+Origin: http://git.haskell.org/ghc.git/commitdiff/f2685df3b10e13f142736f28835e9064334bc143
+Note: Can be dropped for 8.2.0
+Last-Update: 2017-08-02
+
+--- ghc-8.0.2.orig/mk/config.mk.in
++++ ghc-8.0.2/mk/config.mk.in
+@@ -518,11 +518,6 @@ SUPPORTS_THIS_UNIT_ID = @SUPPORTS_THIS_U
+
+ WhatGccIsCalled = @WhatGccIsCalled@
+ GccVersion = @GccVersion@
+-ifeq "$(phase)" "0"
+-CrossCompilePrefix =
+-else
+-CrossCompilePrefix = @CrossCompilePrefix@
+-endif
+ # TargetPlatformFull retains the string passed to configure so we have it in
+ # the necessary format to pass to libffi's configure.
+ TargetPlatformFull = @TargetPlatformFull@
+@@ -557,6 +552,11 @@ CrossCompiling = @CrossCompiling@
+ # See Note [Stage1Only vs stage=1]
+ Stage1Only = NO
+
++# Installed tools prefix:
++# we add prefix to crosscompiler GHC only (ghc-stage1),
++# not cross-built GHC (not ghc-stage2).
++CrossCompilePrefix = $(if $(filter YES,$(Stage1Only)),@CrossCompilePrefix@,)
++
+ # Install stage 2 by default, or stage 1 in the cross compiler
+ # case. Can be changed to 3
+ INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage1Only)),1,2)
diff --git a/p/ghc/debian/patches/build-unlit-and-hp2ps-twice.patch b/p/ghc/debian/patches/build-unlit-and-hp2ps-twice.patch
new file mode 100644
index 000000000..53d6ba133
--- /dev/null
+++ b/p/ghc/debian/patches/build-unlit-and-hp2ps-twice.patch
@@ -0,0 +1,80 @@
+Description: Build unlit and hp2ps twice
+Author: Thomas Miedema <thomasmiedema@gmail.com>
+ John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+
+Index: ghc-8.0.1/utils/ghc-pkg/ghc.mk
+===================================================================
+--- ghc-8.0.1.orig/utils/ghc-pkg/ghc.mk
++++ ghc-8.0.1/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.
+
+Index: ghc-8.0.1/utils/hp2ps/ghc.mk
+===================================================================
+--- ghc-8.0.1.orig/utils/hp2ps/ghc.mk
++++ ghc-8.0.1/utils/hp2ps/ghc.mk
+@@ -17,10 +17,23 @@ utils/hp2ps_dist_C_SRCS = AreaB
+ Utilities.c
+ utils/hp2ps_dist_EXTRA_LIBRARIES = m
+ utils/hp2ps_dist_PROGNAME = $(CrossCompilePrefix)hp2ps
+-utils/hp2ps_dist_INSTALL = YES
++utils/hp2ps_dist_INSTALL = NO
+ utils/hp2ps_dist_INSTALL_INPLACE = YES
+
+ 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))
+Index: ghc-8.0.1/utils/unlit/ghc.mk
+===================================================================
+--- ghc-8.0.1.orig/utils/unlit/ghc.mk
++++ ghc-8.0.1/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))
diff --git a/p/ghc/debian/patches/use-stage1-binaries-for-install.patch b/p/ghc/debian/patches/use-stage1-binaries-for-install.patch
new file mode 100644
index 000000000..897b0ef69
--- /dev/null
+++ b/p/ghc/debian/patches/use-stage1-binaries-for-install.patch
@@ -0,0 +1,26 @@
+Description: Use the stage1 binaries for install
+ In order to be able to perform a cross-build, we need to use
+ the stage1 binaries during installation. Both ghc and ghc-pkg
+ are run during the install target and therefore must be able
+ to run on the build machine.
+ .
+Author: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Last-Update: 2017-01-29
+
+--- ghc-8.0.1.orig/ghc.mk
++++ ghc-8.0.1/ghc.mk
+@@ -958,8 +958,12 @@ INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdi
+ # Install packages in the right order, so that ghc-pkg doesn't complain.
+ # Also, install ghc-pkg first.
+ ifeq "$(Windows_Host)" "NO"
+-INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc
+-INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc-pkg
++# Use the inplace/stage1 versions for installation,
++# since the installed versions are built for the target
++#INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc
++#INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc-pkg
++INSTALLED_GHC_REAL=$(CURDIR)/inplace/bin/ghc-stage1
++INSTALLED_GHC_PKG_REAL=$(CURDIR)/utils/ghc-pkg/dist/build/tmp/ghc-pkg
+ else
+ INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
+ INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe