diff options
author | Robin Gloster <mail@glob.in> | 2016-02-27 00:08:08 +0000 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2016-02-27 00:08:08 +0000 |
commit | 3477e662e60ba80a777f9126ba65ca6e9e0fcdf8 (patch) | |
tree | 26aa99e97f980701131668a00a24fcb85c5cd8a8 /pkgs/development/tools/misc/patchelf | |
parent | b4dadff5429d0bf47bcdafff14dd3d0032039699 (diff) | |
parent | 766ad682f146a755b460dd87006912a96d915bcd (diff) | |
download | nixlib-3477e662e60ba80a777f9126ba65ca6e9e0fcdf8.tar nixlib-3477e662e60ba80a777f9126ba65ca6e9e0fcdf8.tar.gz nixlib-3477e662e60ba80a777f9126ba65ca6e9e0fcdf8.tar.bz2 nixlib-3477e662e60ba80a777f9126ba65ca6e9e0fcdf8.tar.lz nixlib-3477e662e60ba80a777f9126ba65ca6e9e0fcdf8.tar.xz nixlib-3477e662e60ba80a777f9126ba65ca6e9e0fcdf8.tar.zst nixlib-3477e662e60ba80a777f9126ba65ca6e9e0fcdf8.zip |
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'pkgs/development/tools/misc/patchelf')
-rw-r--r-- | pkgs/development/tools/misc/patchelf/setup-hook.sh | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/pkgs/development/tools/misc/patchelf/setup-hook.sh b/pkgs/development/tools/misc/patchelf/setup-hook.sh index a76fbfbd509c..563ef57fce11 100644 --- a/pkgs/development/tools/misc/patchelf/setup-hook.sh +++ b/pkgs/development/tools/misc/patchelf/setup-hook.sh @@ -5,12 +5,16 @@ fixupOutputHooks+=('if [ -z "$dontPatchELF" ]; then patchELF "$prefix"; fi') patchELF() { - header "patching ELF executables and libraries in $prefix" - if [ -e "$prefix" ]; then - find "$prefix" \( \ - \( -type f -a -name "*.so*" \) -o \ - \( -type f -a -perm -0100 \) \ - \) -print -exec patchelf --shrink-rpath '{}' \; - fi + local dir="$1" + header "shrinking RPATHs of ELF executables and libraries in $dir" + + local i + while IFS= read -r -d $'\0' i; do + if [[ "$i" =~ .build-id ]]; then continue; fi + if ! isELF "$i"; then continue; fi + echo "shrinking $i" + patchelf --shrink-rpath "$i" || true + done < <(find "$dir" -type f -print0) + stopNest } |