summaryrefslogtreecommitdiff
path: root/arch/iphoneos-arm/550.58/strip
diff options
context:
space:
mode:
Diffstat (limited to 'arch/iphoneos-arm/550.58/strip')
-rw-r--r--arch/iphoneos-arm/550.58/strip26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/iphoneos-arm/550.58/strip b/arch/iphoneos-arm/550.58/strip
new file mode 100644
index 000000000..11c38c6d9
--- /dev/null
+++ b/arch/iphoneos-arm/550.58/strip
@@ -0,0 +1,26 @@
+find "${PKG_DEST}" -type f \( -perm -0100 -o -name '*.dylib' -o -name '*.so' \) -print0 | while read -r -d $'\0' bin; do
+ ENTITLEMENT=""
+ case "$(file "${bin}")" in (\
+ *': Mach-O fat file with '*([0-9])' architecture' |\
+ *': '*(setuid |setgid )'Mach-O executable acorn' |\
+ *': Mach-O '?(64-bit )'executable '@(arm64|arm_v[67]|acorn) |\
+ *': Mach-O bundle acorn'\
+ )
+ ;;
+ (*': Mach-O '?(64-bit )'dynamically linked shared library '@(acorn|arm_v[67]|arm64))
+ ;;
+ (*) continue
+ ;;
+ esac
+
+ if ${PKG_BASE}/util/arm-apple-darwin11-otool -hv "${bin}" | grep DYLIB_STUB &>/dev/null; then
+ continue; fi
+ if grep $'\xfa\xde\x0c\x01' "${bin}" &>/dev/null; then
+ continue; fi
+
+ perms=$(stat -f %p "${bin}" | sed -e s/^1//)
+ chmod 755 "${bin}"
+ echo "${PKG_BASE}/util/ldid" -S "${bin}"
+ "${PKG_BASE}/util/ldid" -S "${bin}"
+ chmod "${perms}" "${bin}"
+done