toolchain.eclass: don't delete 'go' and 'gofmt' for cross-compilers
authorSergei Trofimovich <slyfox@gentoo.org>
Tue, 23 Oct 2018 22:40:29 +0000 (23:40 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Tue, 23 Oct 2018 22:43:21 +0000 (23:43 +0100)
gcc does not build final 'go' and 'gofmt' tools when cross-compiler
is built (CHOST != CTARGET).

This change fixes gcc-stage2 building for USE=go case.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/toolchain.eclass

index 0e44d922ebe679cb347028c666c49ace2793fda9..47620e5ae5da203c41f732f98b3751ec96de4c97 100644 (file)
@@ -1815,12 +1815,17 @@ toolchain_src_install() {
                        ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER}
                fi
        done
-       # Rename the main go binaries as we don't want to clobber dev-lang/go
-       # when gcc-config runs. #567806
-       if tc_version_is_at_least 5 && is_go ; then
-               for x in go gofmt; do
-                       mv ${x} ${x}-${GCCMAJOR} || die
-               done
+
+       # When gcc builds a crosscompiler it does not install unprefixed tools.
+       # When cross-building gcc does install native tools.
+       if ! is_crosscompile; then
+               # Rename the main go binaries as we don't want to clobber dev-lang/go
+               # when gcc-config runs. #567806
+               if tc_version_is_at_least 5 && is_go ; then
+                       for x in go gofmt; do
+                               mv ${x} ${x}-${GCCMAJOR} || die
+                       done
+               fi
        fi
 
        # Now do the fun stripping stuff