commit:     ee120105fcf78fec48e6b1860fee06b729d7d86f
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 13 04:41:18 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sun Dec 13 04:45:46 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee120105

toolchain.eclass: fix warnings when progs are linked

When gcc installs programs into BINPATH, it sometimes links them so that
the $CHOST-xxx and xxx progs are the same.  The logic to standardize the
naming in BINPATH then triggers a warning as they're the same file.

Manually delete the target before running the mv to avoid that business.

 eclass/toolchain.eclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 82b77ad..eb6c4a1 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1663,7 +1663,12 @@ toolchain_src_install() {
        for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do
                # For some reason, g77 gets made instead of ${CTARGET}-g77...
                # this should take care of that
-               [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x}
+               if [[ -f ${x} ]] ; then
+                       # In case they're hardlinks, clear out the target first
+                       # otherwise the mv below will complain.
+                       rm -f ${CTARGET}-${x}
+                       mv ${x} ${CTARGET}-${x}
+               fi
 
                if [[ -f ${CTARGET}-${x} ]] ; then
                        if ! is_crosscompile ; then

Reply via email to