2020-01-08 18:25:43 +00:00
|
|
|
#!/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}
|
2020-02-14 13:12:15 +00:00
|
|
|
NCPUS=${RPM_BUILD_NCPUS:-1}
|
2020-01-08 18:25:43 +00:00
|
|
|
|
|
|
|
case `uname -a` in
|
|
|
|
Darwin*) exit 0 ;;
|
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Strip ELF binaries
|
2020-02-14 13:12:15 +00:00
|
|
|
find "$RPM_BUILD_ROOT" -type f -name '*.[ao]' \! -regex "$RPM_BUILD_ROOT/*usr/lib/debug.*" -print0 | \
|
2020-02-20 20:40:19 +00:00
|
|
|
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
|