--- binutils-config-5.orig 2015-09-26 21:31:02.000000000 +0300 +++ binutils-config-5 2015-10-08 10:29:49.569079711 +0300 @@ -143,13 +143,20 @@ switch_profile() { dstlib=${ROOT}/usr/${HOST}/${TARGET}/lib fi # When upgrading, we need to clean up ldscripts and libs. - # Don't symlink back in the libs -- the binutils-lib package handles - # these now. - # TODO: Stop requiring even the ldscripts symlink. 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 {} + + if [[ ${TARGET} != ${HOST} ]] ; then + find -L "${dstlib}" -type l -exec rm -v {} + + for x in lib* ; do + atomic_ln "${LIBPATH}/${x}" "${dstlib}" "${x}" + done + else + # Don't symlink back in the libs -- the binutils-lib package handles + # these now. + # TODO: Stop requiring even the ldscripts symlink. + find -L "${dstlib}" -xtype l -name 'lib*' -exec rm -f {} + + fi # # Clean out old generated include symlinks