Merge remote-tracking branch 'upstream/master' into hardened-stdenv

This commit is contained in:
Robin Gloster
2016-02-27 00:08:08 +00:00
504 changed files with 28750 additions and 13232 deletions
@@ -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
}