summaryrefslogtreecommitdiff
path: root/ghc.mk
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2017-04-07 10:08:58 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2017-04-08 10:58:21 +0100
commit54895c90440cb81f18657537b91f2aa35bd54173 (patch)
tree081df980cff45c261372ac1d0cbc92f5ade61b21 /ghc.mk
parentf0d98fc6cdde26bf43a04d9f01b6ad2f4c88f0b9 (diff)
downloadhaskell-54895c90440cb81f18657537b91f2aa35bd54173.tar.gz
fix 'make install' for cross-stage2
When cross-built GHC is being installed one of latest steps is to register installed libraries with 'ghc-pkg'. GHC uses freshly installed 'ghc-pkg' and 'ghc-stage2' for that. Tested as: ./configure --target=aarch64-unknown-linux-gnu make install DESTDIR=$(pwd)/__s2 STRIP_CMD=: Before the change install failed on ghc-pkg execution phase: ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg" \ --force \ --global-package-db \ ".../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/package.conf.d" \ update rts/dist/package.conf.install /bin/sh: .../ghc-cross/__s2/usr/local/lib/ghc-8.3.20170406/bin/ghc-pkg: \ No such file or directory To avoid breakage we use 'ghc' and 'ghc-pkg' built by stage0. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: run 'make install' on stage2 crosscompiler Reviewers: rwbarton, austin, bgamari Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3432
Diffstat (limited to 'ghc.mk')
-rw-r--r--ghc.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/ghc.mk b/ghc.mk
index caa6c38fbb..8971f25981 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -962,6 +962,12 @@ endif
INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
+ifeq "$(CrossCompiling)" "YES"
+# when installing ghc-stage2 we can't run target's
+# 'ghc-pkg' and 'ghc-stage2' but those are needed for registration.
+INSTALLED_GHC_REAL=$(TOP)/inplace/bin/ghc-stage1
+INSTALLED_GHC_PKG_REAL=$(TOP)/$(ghc-pkg_DIST_BINARY)
+else # CrossCompiling
# Install packages in the right order, so that ghc-pkg doesn't complain.
# Also, install ghc-pkg first.
ifeq "$(Windows_Host)" "NO"
@@ -971,6 +977,7 @@ else
INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe
endif
+endif # CrossCompiling
# Set the INSTALL_DISTDIR_p for each package; compiler is special
$(foreach p,$(filter-out compiler,$(INSTALL_PACKAGES)),\