commit:     93501357fa01314bb5c7893a6fc38f927f135a96
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 26 20:51:50 2024 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Jul 28 12:56:42 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/binutils-config.git/commit/?id=93501357

Remove bad binutils symlinks in /usr/libexec/gcc/${HOST}/

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 src/binutils-config | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/binutils-config b/src/binutils-config
index c8de31a..519f1f0 100755
--- a/src/binutils-config
+++ b/src/binutils-config
@@ -168,6 +168,9 @@ switch_profile() {
 
        cd "${ROOT}/${BINPATH}" || exit 1
        mkdir -p "${ROOT}/${BINPATH_LINKS}" "${EROOT}/usr/bin"
+
+       local bad_symlinks_removed="0"
+
        for x in * ; do
                atomic_ln "${BINPATH}/${x}" "${ROOT}/${BINPATH_LINKS}" "${x}"
                atomic_ln "${BINPATH_LINKS}/${x}" "${EROOT}/usr/bin" 
"${TARGET}-${x}"
@@ -184,9 +187,21 @@ switch_profile() {
                                # all possible ones.
                                rm -f "${EROOT}/usr/bin/${x}"
                        fi
+
+                       # Some stages errorneously could not figure out CHOST 
and installed
+                       # symlinks into the path 
${EROOT}/usr/libexec/gcc/${HOST}. These need
+                       # to go away.
+                       if [[ -e "${EROOT}/usr/libexec/gcc/${HOST}/${x}" ]] ; 
then
+                               rm -f "${EROOT}/usr/libexec/gcc/${HOST}/${x}"
+                               bad_symlinks_removed="1"
+                       fi
                fi
        done
 
+       if [[ ${bad_symlinks_removed} == "1" ]] ; then
+               einfo "binutils-config removed errorneous, leftover symlinks in 
${EROOT}/usr/libexec/gcc/${HOST}"
+       fi
+
        #
        # Generate library / ldscripts symlinks
        #

Reply via email to