summaryrefslogtreecommitdiff
path: root/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch
blob: 7e4ea7a9f61055b37f810e1acbec550bcdfa52c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
commit f2685df3b10e13f142736f28835e9064334bc143
Author: Sergei Trofimovich <slyfox@gentoo.org>
Date:   Wed Apr 5 22:31:37 2017 +0100

    avoid $(CrossCompilerPrefix) for stage2 install
    
    Suppose we are crossbuilding ghc (when ghc-stage2
    is a normal compiler for $target):
    
    For this case 'make install' should install unprefixed
    stage2 'ghc' and not '$(CorssCompilePrefix)-ghc'.
    
    That way cross-built ghc is installable and
    usable on target as if it would be built natively
    on a target.
    
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

diff --git a/mk/config.mk.in b/mk/config.mk.in
index 4d5d82aa80..5e274bb71f 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -530,7 +530,7 @@ SUPPORTS_THIS_UNIT_ID = @SUPPORTS_THIS_UNIT_ID@
 # needs to know which gcc you're using in order to perform its tests.
 
 GccVersion            = @GccVersion@
-CrossCompilePrefix    = @CrossCompilePrefix@
+
 # TargetPlatformFull retains the string passed to configure so we have it in
 # the necessary format to pass to libffi's configure.
 TargetPlatformFull    = @TargetPlatformFull@
@@ -567,6 +567,11 @@ CrossCompiling        = @CrossCompiling@
 # See Note [Stage1Only vs stage=1]
 Stage1Only = NO
 
+# Installed tools prefix:
+#    we add prefix to crosscompiler GHC only (ghc-stage1),
+#    not cross-built GHC (not ghc-stage2).
+CrossCompilePrefix    = $(if $(filter YES,$(Stage1Only)),@CrossCompilePrefix@,)
+
 # Install stage 2 by default, or stage 1 in the cross compiler
 # case. Can be changed to 3
 INSTALL_GHC_STAGE= $(if $(filter YES,$(Stage1Only)),1,2)