aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-05-23 08:37:53 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2020-05-23 08:37:53 +0100
commita9d04f80c3d5ec32168b1389a5db79cc780b05ef (patch)
tree21130601d595b67b3ba45063c7f276e3b1b2beac
parentbinutils-config: document current binary assumptions (diff)
downloadbinutils-config-a9d04f80c3d5ec32168b1389a5db79cc780b05ef.tar.gz
binutils-config-a9d04f80c3d5ec32168b1389a5db79cc780b05ef.tar.bz2
binutils-config-a9d04f80c3d5ec32168b1389a5db79cc780b05ef.zip
binutils-config: fix native link removal by cross-compilers, bug #724454v5.3.1
commit 36eba05752348258a7 ("binutils-config: add build-time and runtime switches to disable native symlinks"). Added symlink deletion for USE_NATIVE_LINKS=no mode. It had a bug: it unconditionally deleted native symlinks if binutils-config is called on a cross-binutils installation. I missed the case because I assumed that tool names in binutils' private directory match gcc' private directory. The change is not to perform symlink cleanup for unprefixed binaries for cross-binutils. Reported-by: Ionen Wolkens Bug: https://bugs.gentoo.org/724454 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rwxr-xr-xsrc/binutils-config24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/binutils-config b/src/binutils-config
index cb7b905..da99021 100755
--- a/src/binutils-config
+++ b/src/binutils-config
@@ -143,17 +143,19 @@ switch_profile() {
for x in * ; do
atomic_ln "${BINPATH}/${x}" "${ROOT}/${BINPATH_LINKS}" "${x}"
atomic_ln "${BINPATH_LINKS}/${x}" "${EROOT}/usr/bin" "${TARGET}-${x}"
- if [[ ${TARGET} == ${HOST} && ${USE_NATIVE_LINKS} == yes ]] ; then
- atomic_ln "${TARGET}-${x}" "${EROOT}/usr/bin" "${x}"
- else
- # Remove native links if exist from previous
- # installations or set by user manually. binutils-config
- # owns these symlinks.
- #
- # TODO: cleanup symlinks not just known to this
- # release/configuration of binutils, but also list
- # all possible ones.
- rm -f "${EROOT}/usr/bin/${x}"
+ if [[ ${TARGET} == ${HOST} ]] ; then
+ if [[ ${USE_NATIVE_LINKS} == yes ]]; then
+ atomic_ln "${TARGET}-${x}" "${EROOT}/usr/bin" "${x}"
+ else
+ # Remove native links if exist from previous
+ # installations or set by user manually. binutils-config
+ # owns these symlinks.
+ #
+ # TODO: cleanup symlinks not just known to this
+ # release/configuration of binutils, but also list
+ # all possible ones.
+ rm -f "${EROOT}/usr/bin/${x}"
+ fi
fi
done