Last active
July 22, 2020 12:35
-
-
Save Trass3r/143bffd3599af1c7100d3bc19943fa7b to your computer and use it in GitHub Desktop.
copy executable with dependencies and fix rpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
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