[commit: ghc] ghc-8.0: Fix configure detection. (682518d)

git at git.haskell.org git at git.haskell.org
Tue Sep 20 11:15:08 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/682518d410a4c522be5d10550c5c915b1f56084d/ghc

>---------------------------------------------------------------

commit 682518d410a4c522be5d10550c5c915b1f56084d
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
    
    (cherry picked from commit 18f06878ed5d8cb0cf366a876f2bfea29647e5f0)


>---------------------------------------------------------------

682518d410a4c522be5d10550c5c915b1f56084d
 configure.ac | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7d176dd..20ee711 100644
--- a/configure.ac
+++ b/configure.ac
@@ -419,20 +419,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
@@ -446,7 +446,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