From 93501357fa01314bb5c7893a6fc38f927f135a96 Mon Sep 17 00:00:00 2001 From: "Andreas K. Hüttel" Date: Fri, 26 Jul 2024 22:51:50 +0200 Subject: Remove bad binutils symlinks in /usr/libexec/gcc/${HOST}/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas K. Hüttel --- 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 # -- cgit v1.2.3-65-gdbad