Initially observed on bug #799017 where glibc avoid stripping libpthread.so to allow gdb accessing it's internals. Here is the minimal reproducer ebuild: $ cat app-0.ebuild EAPI=7 inherit flag-o-matic toolchain-funcs IUSE="trigger-bug" DEPEND="" RDEPEND=${DEPEND} SLOT=0 src_unpack() { mkdir "${S}" || die cat >>"${S}"/app-tool.c<<EOF int main() { return 0; } EOF } src_compile() { tc-export CC append-flags -ggdb3 emake app-tool } src_install() { dobin app-tool use trigger-bug && dostrip -x /usr/bin/app-tool } Here is the effect: Good: $ USE=-trigger-bug FEATURES='installsources' emerge -v1 app strip: x86_64-pc-linux-gnu-strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version /usr/bin/app-tool installsources: rsyncing source files * checking 5 files for package collisions >>> Merging app/app-0 to / >>> /usr/bin/app-tool >>> /usr/src/debug/app/app-0/app-0/app-tool.c Bad: $ USE=trigger-bug FEATURES='installsources' emerge -v1 app >>> Merging app/app-0 to / --- /usr/ --- /usr/bin/ >>> /usr/bin/app-tool >>> Safely unmerging already-installed instance... No package files given... Grabbing a set. <<< obj /usr/src/debug/app/app-0/app-0/app-tool.c <<< obj /usr/lib/debug/usr/bin/app-tool.debug --- replaced obj /usr/bin/app-tool Note: app-tool.c was removed from installation. Probablya side-effect of bin/estrip implementation.
hello71, is there any chance you'd be willing to take a look?
dostrip -x results in a call to estrip --ignore, which removes the .estrip file associated with the given path. That causes estrip --dequeue to skip the file entirely. We need to introduce a new state that will cause estrip --dequeue to process the file without stripping it.