From 6892c372a349ce9bc86417c866ab5e369a00e4c5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 19 Oct 2018 09:15:58 -0700 Subject: [PATCH] estrip: Fix static library index (bug 603594) After strip of a static library, call ranlib to fix the index which is needed for -lto support. Suggested-by: Sergei Trofimovich Signed-off-by: Zac Medico --- bin/estrip | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/estrip b/bin/estrip index 369755cfe..1d77493a9 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 RANLIB:ranlib READELF:readelf ; do v=${t%:*} # STRIP t=${t#*:} # strip eval ${v}=\"${!v:-${CHOST}-${t}}\" @@ -424,6 +424,8 @@ do # retain the debug info in the archive itself. if ! ${FEATURES_splitdebug} || ${RESTRICT_splitdebug} ; then ${STRIP} -g "${x}" + # Fix index removed by strip, required for -lto (bug 603594). + ${RANLIB} "${x}" fi fi elif [[ ${f} == *"SB executable"* || ${f} == *"SB pie executable"* || -- 2.18.1