20749d9
#!/usr/bin/sh
20749d9
# If using normal root, avoid changing anything.
20749d9
if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_BUILD_ROOT" = "/" ]; then
20749d9
	exit 0
20749d9
fi
20749d9
20749d9
STRIP=${1:-strip}
776d974
NCPUS=${RPM_BUILD_NCPUS:-1}
20749d9
20749d9
case `uname -a` in
20749d9
Darwin*) exit 0 ;;
20749d9
*) ;;
20749d9
esac
20749d9
20749d9
# Strip ELF binaries
776d974
find "$RPM_BUILD_ROOT" -type f -name '*.[ao]' \! -regex "$RPM_BUILD_ROOT/*usr/lib/debug.*" -print0 | \
9dd5528
  eu-elfclassify --not-program --not-library --not-linux-kernel-module --stdin0 --print0 | xargs -0 -r -P$NCPUS -n32 sh -c "$STRIP -p -R .gnu.lto_* -R .gnu.debuglto_* -N __gnu_lto_v1 \"\$@\"" ARG0