sys-devel/binutils-config: detect broken cross-compiler rpaths #562460

We've fixed newer cross-binutils builds to use the correct rpaths to find
their internal libs, but existing builds remain broken.  Add some logic to
detect & warn users, but also create the old symlinks so they keep working.
This commit is contained in:
Mike Frysinger
2015-11-23 05:19:00 -05:00
parent 03d8ab7d71
commit 7fbeab2ed7
2 changed files with 10 additions and 1 deletions

View File

@@ -149,7 +149,16 @@ switch_profile() {
mkdir -p "${dstlib}"
rm -rf "${ROOT}/${BINPATH_LINKS}"/ldscripts
atomic_ln "${LIBPATH}/ldscripts" "${dstlib}" "ldscripts"
find -L "${dstlib}" -xtype l -name 'lib*' -exec rm -f {} +
find -L "${dstlib}" -xtype l -name 'lib*' -delete
# Detect older binutils w/broken rpaths. #562460
# We can hardcode the "/lib" part since that's what the binutils
# configure scripts have. They did not include any other path.
if [[ $(scanelf -qF '%r#F' "${ROOT}/${BINPATH}/as") == */lib ]] ; then
ewarn "Old cross-binutils detected; please re-emerge to fix (see bug #562460)."
for x in lib* ; do
atomic_ln "${LIBPATH}/${x}" "${dstlib}" "${x}"
done
fi
#
# Clean out old generated include symlinks