[commit: ghc] master: Fix configure detection. (18f0687)
git at git.haskell.org
git at git.haskell.org
Sun Aug 14 17:41:29 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/18f06878ed5d8cb0cf366a876f2bfea29647e5f0/ghc
>---------------------------------------------------------------
commit 18f06878ed5d8cb0cf366a876f2bfea29647e5f0
Author: Tamar Christina <tamar at zhox.com>
Date: Sat Aug 13 16:27:30 2016 +0100
Fix configure detection.
Summary:
GHC's configure script seems to normalize the values returned from config.guess.
So for Windows it turns x86_64-pc-mingw64 into x86_64-unknown-mingw32.
These mangled names are stored in the values $BuildPlatform, $HostPlatform
and $TargetPlatform.
However further down the file when the comparison is done between the stage0
compiler and the host the normalized versions are not used.
So when normalization actually changes the triple this check will fail.
Not sure why it's worked for all this time.. Nor if this is the right fix?
Does it still work for cross compiling correctly?
Test Plan: ./configure
Reviewers: hvr, austin, thomie, bgamari, erikd
Reviewed By: erikd
Subscribers: erikd, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D2452
GHC Trac Issues: #12487
>---------------------------------------------------------------
18f06878ed5d8cb0cf366a876f2bfea29647e5f0
configure.ac | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index e9569e9..acd33cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -410,20 +410,20 @@ dnl ** Building a cross compiler?
dnl --------------------------------------------------------------
CrossCompiling=NO
# If 'host' and 'target' differ, then this means we are building a cross-compiler.
-if test "$target" != "$host" ; then
+if test "$TargetPlatform" != "$HostPlatform" ; then
CrossCompiling=YES
cross_compiling=yes # This tells configure that it can accept just 'target',
# otherwise you get
# configure: error: cannot run C compiled programs.
# If you meant to cross compile, use `--host'.
fi
-if test "$build" != "$host" ; then
+if test "$BuildPlatform" != "$host" ; then
AC_MSG_ERROR([
You've selected:
- BUILD: $build (the architecture we're building on)
- HOST: $host (the architecture the compiler we're building will execute on)
- TARGET: $target (the architecture the compiler we're building will produce code for)
+ BUILD: $BuildPlatform (the architecture we're building on)
+ HOST: $HostPlatform (the architecture the compiler we're building will execute on)
+ TARGET: $TargetPlatform (the architecture the compiler we're building will produce code for)
BUILD must equal HOST; that is, we do not support building GHC itself
with a cross-compiler. To cross-compile GHC itself, set TARGET: stage
@@ -437,7 +437,7 @@ then
else
CrossCompilePrefix=""
fi
-TargetPlatformFull="${target}"
+TargetPlatformFull="${TargetPlatform}"
AC_SUBST(CrossCompiling)
AC_SUBST(CrossCompilePrefix)
AC_SUBST(TargetPlatformFull)
More information about the ghc-commits
mailing list