1 |
commit: 2404ddca9d5db7992bf6853cbde8ca944224560c |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 29 16:41:45 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 31 16:37:35 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=2404ddca |
7 |
|
8 |
estrip: Run RANLIB after stripping static archives to fix LTO |
9 |
|
10 |
Run RANLIB after stripping static archives in order to fix potentially |
11 |
mangled LTO symbol indexes. According to the user's report, strip lacks |
12 |
support for LTO symbols (and for binutils plugins that could add |
13 |
the missing support) and breaks them. Upstream suggests fixing |
14 |
the archive by running ranlib -- and since there should be no harm |
15 |
in doing that, we can do that unconditionally. |
16 |
|
17 |
Suggested-by: Shane Peelar |
18 |
Bug: https://github.com/mgorny/portage-mgorny/issues/21 |
19 |
Bug: https://bugs.gentoo.org/603594 |
20 |
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org> |
21 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
22 |
|
23 |
bin/estrip | 5 +++-- |
24 |
1 file changed, 3 insertions(+), 2 deletions(-) |
25 |
|
26 |
diff --git a/bin/estrip b/bin/estrip |
27 |
index 369755cfe..f72341da9 100755 |
28 |
--- a/bin/estrip |
29 |
+++ b/bin/estrip |
30 |
@@ -113,7 +113,7 @@ if [[ ${KERNEL} == linux ]] && ${FEATURES_xattr} ; then |
31 |
fi |
32 |
|
33 |
# look up the tools we might be using |
34 |
-for t in STRIP:strip OBJCOPY:objcopy READELF:readelf ; do |
35 |
+for t in STRIP:strip OBJCOPY:objcopy READELF:readelf RANLIB:ranlib ; do |
36 |
v=${t%:*} # STRIP |
37 |
t=${t#*:} # strip |
38 |
eval ${v}=\"${!v:-${CHOST}-${t}}\" |
39 |
@@ -423,7 +423,8 @@ do |
40 |
# linked in (only for finally linked ELFs), so we have to |
41 |
# retain the debug info in the archive itself. |
42 |
if ! ${FEATURES_splitdebug} || ${RESTRICT_splitdebug} ; then |
43 |
- ${STRIP} -g "${x}" |
44 |
+ ${STRIP} -g "${x}" && |
45 |
+ ${RANLIB} "${x}" |
46 |
fi |
47 |
fi |
48 |
elif [[ ${f} == *"SB executable"* || ${f} == *"SB pie executable"* || |