[commit: hsc2hs] master: Build utilities with the bootstrap compiler when cross compiling (ecdac06)
git at git.haskell.org
git at git.haskell.org
Fri Sep 29 06:57:19 UTC 2017
Repository : ssh://git@git.haskell.org/hsc2hs
On branch : master
Link : http://git.haskell.org/hsc2hs.git/commitdiff/ecdac062b5cf1d284906487849c56f4e149b3c8e
>---------------------------------------------------------------
commit ecdac062b5cf1d284906487849c56f4e149b3c8e
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date: Fri Sep 29 14:50:15 2017 +0800
Build utilities with the bootstrap compiler when cross compiling
This should fix Trac #14297. When building a cross compiler, we have rather little use
of utilities that do not run on the host, where the compiler runs. As such we should
build the utilities with the bootstrap (stage 0) compiler rather than witht he
in-tree (stage 1) compiler when CrossCompiling.
This used to results in the utilities we ship in the binary distribution to be built for
the wrong host. This diff tries to rectify the situation and allow the binary distribution
to contain the utilities for the host when CrossCompiling.
See also https://phabricator.haskell.org/D4048
>---------------------------------------------------------------
ecdac062b5cf1d284906487849c56f4e149b3c8e
ghc.mk | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/ghc.mk b/ghc.mk
index f12aea5..c5f7473 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -13,7 +13,18 @@ utils/hsc2hs_dist-install_INSTALL = YES
utils/hsc2hs_dist-install_INSTALL_INPLACE = NO
$(eval $(call build-prog,utils/hsc2hs,dist,0))
+
+# When CrossCompiling, we want to ship the binary for the
+# host, not for the target. As such we need to compile
+# with the Bootstrap compiler rather than with the in-tree
+# stage1 compiler, which would result in a binary that
+# won't run on the host.
+ifeq "$(CrossCompiling)" "YES"
+# compile with stage 0 (bootstrap compiler)
+$(eval $(call build-prog,utils/hsc2hs,dist-install,0))
+else
$(eval $(call build-prog,utils/hsc2hs,dist-install,1))
+endif
# After build-prog above
utils/hsc2hs_dist_MODULES += Paths_hsc2hs
More information about the ghc-commits
mailing list