When people have splitdebug enabled, they want debugging info to be
available to them. Unfortunately, splitdebug doesn't work with static
archives, so we have to leave it in. Stripping of that will be delayed
to when the final ELF is linked.
if [[ ${f} == *"current ar archive"* ]] ; then
__vecho " ${x:${#ED}}"
if ${strip_this} ; then
- # hmm, can we split debug/sources for .a ?
- ${STRIP} -g "${x}"
+ # If we have split debug enabled, then do not strip this.
+ # There is no concept of splitdebug for objects not yet
+ # 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}"
+ fi
fi
elif [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* ]] ; then
process_elf "${x}" "${inode_link}" ${PORTAGE_STRIP_FLAGS}