aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2024-07-26 22:51:50 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2024-07-28 14:56:42 +0200
commit93501357fa01314bb5c7893a6fc38f927f135a96 (patch)
treee6cc5be83ba21a0187acf4672df6ab354f17389c
parentPrint error message on empty determined CHOST (diff)
downloadbinutils-config-93501357fa01314bb5c7893a6fc38f927f135a96.tar.gz
binutils-config-93501357fa01314bb5c7893a6fc38f927f135a96.tar.bz2
binutils-config-93501357fa01314bb5c7893a6fc38f927f135a96.zip
Remove bad binutils symlinks in /usr/libexec/gcc/${HOST}/v5.5.1
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rwxr-xr-xsrc/binutils-config15
1 files changed, 15 insertions, 0 deletions
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
#