[Slackbuilds-users] Stripping executables

spaceman spaceman at antispaceman.com
Fri Feb 5 16:06:45 UTC 2021


Hi,

For me at least this command:

    find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared ob=
ject" | grep ELF \
      | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

Which is used on a number of slackbuilds (rhash and cmus were the two I
tested) does not appear to strip executables. The resulting file:

    $ file /usr/bin/rhash
    /usr/bin/rhash: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV)=
, statically linked, with debug_info, not stripped

I test this on X86-64 as well with the same result (although that system
is more quirky, and therefore less reproducible).

These commands work as described:

    # Strip binaries and libraries--this can be done with "make install-st=
rip"
    # in many source trees, and that's usually acceptable if so, but if no=
t,
    # use this:
    ( cd \$PKG
      find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : |=
 \\
        xargs strip --strip-unneeded 2> /dev/null || true
      find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d =
: | \\
        xargs strip --strip-unneeded 2> /dev/null || true
    )

Lifted shamelessly from https://www.beej.us/slackware/mksb/.

Regards,
spaceman


More information about the SlackBuilds-users mailing list