From 18f06878ed5d8cb0cf366a876f2bfea29647e5f0 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Sat, 13 Aug 2016 16:27:30 +0100 Subject: 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 --- configure.ac | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index e9569e93d8..acd33cf22c 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) -- cgit v1.2.1