Skip to content

Instantly share code, notes, and snippets.



Last active Jul 22, 2020
What would you like to do?
copy executable with dependencies and fix rpath
set -e
mkdir -p $2 && cd $2
ldd $1 | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' .
cp $1 .
patchelf --set-rpath '$ORIGIN/.' *
rm libc.* libgcc* librt.* libpthread* libdl.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.