Skip to content

Instantly share code, notes, and snippets.

@Trass3r

Trass3r/copyWithDeps.sh

Last active Jul 22, 2020
Embed
What would you like to do?
copy executable with dependencies and fix rpath
#!/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
You can’t perform that action at this time.