redhat-rpm-config/brp-strip-lto
Igor Raits 776d974885
brp-strip-lto: Run strip in parallel
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
2020-02-14 14:12:15 +01:00

18 lines
453 B
Bash
Executable File

#!/usr/bin/sh
# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_BUILD_ROOT" = "/" ]; then
exit 0
fi
STRIP=${1:-strip}
NCPUS=${RPM_BUILD_NCPUS:-1}
case `uname -a` in
Darwin*) exit 0 ;;
*) ;;
esac
# Strip ELF binaries
find "$RPM_BUILD_ROOT" -type f -name '*.[ao]' \! -regex "$RPM_BUILD_ROOT/*usr/lib/debug.*" -print0 | \
xargs -0 -r -P$NCPUS -I{} $STRIP -p -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 '{}'