As of sys-apps/portage-2.2.8-r1 /usr/lib/portage/bin/ebuild-helpers/prepstrip will detect stripped files by checking for non-existing section .symtab in elf header. and will skip further strip attempt. This is inaccurate because we strip more sections then only .symtab (currently -R .comment -R .GCC.command.line -R .note.gnu.gold-version) So lets strip even pre-stripped files again, to catch more removable sections. Reproducible: Always Steps to Reproduce: # emerge app-arch/xz-utils-5.0.5-r1 # tail build.log * QA Notice: Pre-stripped files found: * /usr/bin/lzmainfo * /usr/bin/xz * /usr/bin/xzdec * /usr/bin/lzmadec strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version lib64/liblzma.so.5.0.5 Actual Results: # readelf --section-headers /usr/bin/xz | grep .comment [25] .comment PROGBITS 0000000000000000 00013104 # stat /usr/bin/xz | grep Size Size: 80152 Blocks: 160 IO Block: 4096 regular file Expected Results: # readelf --section-headers /usr/bin/xz | grep .comment # stat /usr/bin/xz | grep Size Size: 79904 Blocks: 160 IO Block: 4096 regular file My (tm) solution it to watch for an always(?) existing section in elf file. Please cross check if .init section is the right choice. --- a/prepstrip 2014-04-19 00:00:00.000000000 +0000 +++ b/prepstrip 2014-04-19 00:00:00.000000000 +0000 @@ -286,7 +286,7 @@ done < <( # Use sort -u to eliminate duplicates for bug #445336. ( - scanelf -yqRBF '#k%F' -k '.symtab' "$@" + scanelf -yqRBF '#k%F' -k '.init' "$@" find "$@" -type f ! -type l -name '*.a' ) | LC_ALL=C sort -u )
Ding dong, there was a missing detail to provoke pre-stripped build. I used LDFLAGS="-s". Yes, most ebuilds will never trigger pre-stripped warning because ebuild maintainer aware of this. This bug/request should dealing with rarely cases where pre-stripped (but not fully pre-stripped) files was found.