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