diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-10-29 17:41:45 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-10-31 17:37:35 +0100 |
commit | 2404ddca9d5db7992bf6853cbde8ca944224560c (patch) | |
tree | 5be6db5e16c47d73bb32fc04ffc353d917086f2e | |
parent | tests: Drop unittest skip shim (diff) | |
download | portage-2404ddca9d5db7992bf6853cbde8ca944224560c.tar.gz portage-2404ddca9d5db7992bf6853cbde8ca944224560c.tar.bz2 portage-2404ddca9d5db7992bf6853cbde8ca944224560c.zip |
estrip: Run RANLIB after stripping static archives to fix LTO
Run RANLIB after stripping static archives in order to fix potentially
mangled LTO symbol indexes. According to the user's report, strip lacks
support for LTO symbols (and for binutils plugins that could add
the missing support) and breaks them. Upstream suggests fixing
the archive by running ranlib -- and since there should be no harm
in doing that, we can do that unconditionally.
Suggested-by: Shane Peelar
Bug: https://github.com/mgorny/portage-mgorny/issues/21
Bug: https://bugs.gentoo.org/603594
Reviewed-by: Zac Medico <zmedico@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rwxr-xr-x | bin/estrip | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/estrip b/bin/estrip index 369755cfe..f72341da9 100755 --- a/bin/estrip +++ b/bin/estrip @@ -113,7 +113,7 @@ if [[ ${KERNEL} == linux ]] && ${FEATURES_xattr} ; then fi # look up the tools we might be using -for t in STRIP:strip OBJCOPY:objcopy READELF:readelf ; do +for t in STRIP:strip OBJCOPY:objcopy READELF:readelf RANLIB:ranlib ; do v=${t%:*} # STRIP t=${t#*:} # strip eval ${v}=\"${!v:-${CHOST}-${t}}\" @@ -423,7 +423,8 @@ do # linked in (only for finally linked ELFs), so we have to # retain the debug info in the archive itself. if ! ${FEATURES_splitdebug} || ${RESTRICT_splitdebug} ; then - ${STRIP} -g "${x}" + ${STRIP} -g "${x}" && + ${RANLIB} "${x}" fi fi elif [[ ${f} == *"SB executable"* || ${f} == *"SB pie executable"* || |