prepstrip: do no strip static libs when FEATURES=splitdebug
authorMike Frysinger <vapier@gentoo.org>
Sun, 5 Jan 2014 14:38:59 +0000 (09:38 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sun, 5 Jan 2014 14:40:29 +0000 (09:40 -0500)
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.

bin/ebuild-helpers/prepstrip

index 64ea80d713f6bd74d0e088b68c98c8ce45eefa41..233238889801755b62d72a38a30eb25de7e482f2 100755 (executable)
@@ -339,8 +339,13 @@ do
        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}