Commit 844704b4 authored by Sergei Trofimovich's avatar Sergei Trofimovich

Use non-canocalized triple as cross-compiler prefix

I've noticed the problem when tried to install
cross-compiler using following configuration:

    $ ./configure --target=s390x-unknown-linux-gnu
    make install Stage1Only=YES

Instead of expected tool prefix
    's390x-unknown-linux-gnu-'
Result was:
    's390x-ibm-linux-gnu-'

It's problematic as installed binaries appear in
unpredictable location.

The problem is caused by use of ${target} autoconf variable.
${target} contains a canocalized triplet.

Luckily we already have non-canonucalized target triplet
in ${TargetPlatformFull} variable. The change uses that
instead.
Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
parent 819c3db7
......@@ -425,12 +425,6 @@ with a cross-compiler. To cross-compile GHC itself, set TARGET: stage
GHC.
])
fi
if test "$CrossCompiling" = "YES"
then
CrossCompilePrefix="${target}-"
else
CrossCompilePrefix=""
fi
# Despite its similarity in name to TargetPlatform, TargetPlatformFull is used
# in calls to subproject configure scripts and thus must be set to the autoconf
# triple, not the normalized GHC triple that TargetPlatform is set to.
......@@ -446,6 +440,8 @@ fi
# all be taken care of for us if we configured the subprojects using
# AC_CONFIG_DIR, but unfortunately Cabal needs to be the one to do the
# configuration.
#
# We also use non-canonicalized triple when install stage1 crosscompiler
if test -z "${target_alias}"
then
# --target wasn't given; use result from AC_CANONICAL_TARGET
......@@ -453,6 +449,13 @@ then
else
TargetPlatformFull="${target_alias}"
fi
if test "$CrossCompiling" = "YES"
then
# Use value passed by user from --target=
CrossCompilePrefix="${TargetPlatformFull}-"
else
CrossCompilePrefix=""
fi
AC_SUBST(CrossCompiling)
AC_SUBST(CrossCompilePrefix)
AC_SUBST(TargetPlatformFull)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment