support/scripts: check-host-rpath now handles $ORIGIN as well
authorWolfgang Grandegger <wg@grandegger.com>
Fri, 30 Jun 2017 08:37:07 +0000 (10:37 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 2 Jul 2017 13:49:25 +0000 (15:49 +0200)
"$ORIGIN/../../usr/lib" is also a valid RPATH for binaries in
"$hostdir/usr/bin". After RPATH sanitation, all RPATH
directories start with "$ORIGIN".

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/scripts/check-host-rpath

index 6ce547cb042388d82718e4cc6c5efa211c60f507..020c12379f17ccb59ef22c026fbe7035a08514d3 100755 (executable)
@@ -58,7 +58,7 @@ check_elf_has_rpath() {
         for dir in ${rpath//:/ }; do
             # Remove duplicate and trailing '/' for proper match
             dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
-            [ "${dir}" = "${hostdir}/usr/lib" ] && return 0
+            [ "${dir}" = "${hostdir}/usr/lib" -o "${dir}" = "\$ORIGIN/../../usr/lib" ] && return 0
         done
     done < <( readelf -d "${file}"                                              \
               |sed -r -e '/.* \(R(UN)?PATH\) +Library r(un)?path: \[(.+)\]$/!d' \