1 |
commit: a9d04f80c3d5ec32168b1389a5db79cc780b05ef |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 23 07:37:53 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 23 07:37:53 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/binutils-config.git/commit/?id=a9d04f80 |
7 |
|
8 |
binutils-config: fix native link removal by cross-compilers, bug #724454 |
9 |
|
10 |
commit 36eba05752348258a7 ("binutils-config: add build-time |
11 |
and runtime switches to disable native symlinks"). |
12 |
|
13 |
Added symlink deletion for USE_NATIVE_LINKS=no mode. |
14 |
It had a bug: it unconditionally deleted native symlinks |
15 |
if binutils-config is called on a cross-binutils installation. |
16 |
|
17 |
I missed the case because I assumed that tool names |
18 |
in binutils' private directory match gcc' private directory. |
19 |
|
20 |
The change is not to perform symlink cleanup for unprefixed |
21 |
binaries for cross-binutils. |
22 |
|
23 |
Reported-by: Ionen Wolkens |
24 |
Bug: https://bugs.gentoo.org/724454 |
25 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
26 |
|
27 |
src/binutils-config | 24 +++++++++++++----------- |
28 |
1 file changed, 13 insertions(+), 11 deletions(-) |
29 |
|
30 |
diff --git a/src/binutils-config b/src/binutils-config |
31 |
index cb7b905..da99021 100755 |
32 |
--- a/src/binutils-config |
33 |
+++ b/src/binutils-config |
34 |
@@ -143,17 +143,19 @@ switch_profile() { |
35 |
for x in * ; do |
36 |
atomic_ln "${BINPATH}/${x}" "${ROOT}/${BINPATH_LINKS}" "${x}" |
37 |
atomic_ln "${BINPATH_LINKS}/${x}" "${EROOT}/usr/bin" "${TARGET}-${x}" |
38 |
- if [[ ${TARGET} == ${HOST} && ${USE_NATIVE_LINKS} == yes ]] ; then |
39 |
- atomic_ln "${TARGET}-${x}" "${EROOT}/usr/bin" "${x}" |
40 |
- else |
41 |
- # Remove native links if exist from previous |
42 |
- # installations or set by user manually. binutils-config |
43 |
- # owns these symlinks. |
44 |
- # |
45 |
- # TODO: cleanup symlinks not just known to this |
46 |
- # release/configuration of binutils, but also list |
47 |
- # all possible ones. |
48 |
- rm -f "${EROOT}/usr/bin/${x}" |
49 |
+ if [[ ${TARGET} == ${HOST} ]] ; then |
50 |
+ if [[ ${USE_NATIVE_LINKS} == yes ]]; then |
51 |
+ atomic_ln "${TARGET}-${x}" "${EROOT}/usr/bin" "${x}" |
52 |
+ else |
53 |
+ # Remove native links if exist from previous |
54 |
+ # installations or set by user manually. binutils-config |
55 |
+ # owns these symlinks. |
56 |
+ # |
57 |
+ # TODO: cleanup symlinks not just known to this |
58 |
+ # release/configuration of binutils, but also list |
59 |
+ # all possible ones. |
60 |
+ rm -f "${EROOT}/usr/bin/${x}" |
61 |
+ fi |
62 |
fi |
63 |
done |