| Server IP : 5.83.47.51 / Your IP : 216.73.217.19 Web Server : Apache System : Linux hosting.nxthost.com 5.14.0-687.44.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Sep 9 11:11:28 EDT 2026 x86_64 User : esteemro ( 1261) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/rpm/ |
Upload 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}
# 32 was chosen as a compromise between reducing the overhead of starting new
# processes and distributing the work load evenly over as much processors as
# possible
MAX_ARGS=32
case `uname -a` in
Darwin*) exit 0 ;;
*) ;;
esac
# Below is the explanation of commands in the order of their appearance
# Ignore /usr/lib/debug entries
# Ignore all go(guile objects & golang) files
# Consider files with only single link
# Run the file command to find relevant non-stripped binaries, with bundle size of 32
# Ignore all 'no machine' files
# Only operate on non-stripped binaries
strip_elf_binaries()
{
local nlinks="${1}"
local nprocs="${2}"
find "$RPM_BUILD_ROOT" -type f \
! -regex "${RPM_BUILD_ROOT}/*usr/lib/debug.*" \
-links "${nlinks}" -print0 | \
xargs -0 -r -P${nprocs} -n${MAX_ARGS} sh -c "file \"\$@\" | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped.*/\1/p' | \
xargs -I\{\} $STRIP -g \{\}" ARG0
}
# strip all binaries with single link
strip_elf_binaries "1" "${NCPUS}"
# strip all binaries with more than 1 link
strip_elf_binaries "+1" "1"