Skip to content

Commit

Permalink
toolchain.eclass: don't delete 'go' and 'gofmt' for cross-compilers
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Sergei Trofimovich committed Oct 23, 2018
1 parent 47087e6 commit 488929a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions eclass/toolchain.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 488929a

Please sign in to comment.