use-stage1-binaries-for-install.patch 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9
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

10
Index: b/ghc.mk
11
===================================================================
12 13 14
--- a/ghc.mk
+++ b/ghc.mk
@@ -972,8 +972,12 @@ else # CrossCompiling
15 16 17 18 19 20 21 22 23 24 25 26 27 28
 # 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