Created
October 3, 2013 20:43
-
-
Save gpakosz/6816789 to your computer and use it in GitHub Desktop.
./checkduplicatesymbols.sh libFoo.a libBar.a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# exit the script if any statement returns a non-true return value | |
set -e | |
# exit the script on dereferencing uninitialised variables | |
set -o nounset | |
self=$(basename $0) | |
origin=$(cd "$(dirname "$0")"; pwd) | |
temp=$(mktemp -d -t ${self}) && trap 'rm -rf ${temp}' EXIT HUP INT QUIT TERM | |
# extract symbols | |
extract_symbols() { | |
$(nm -arch armv7 -o -U -j $1 2> /dev/null | cut -d \ -f 2 | sort -u > $2) | |
} | |
for lib1; do | |
basename1=$(basename ${lib1}) | |
symbols1=${temp}/${basename1}.symbols | |
[ ! -e "${symbols1}" ] && extract_symbols ${lib1} ${symbols1} | |
shift | |
for lib2; do | |
basename2=$(basename ${lib2}) | |
symbols2=${temp}/${basename2}.symbols | |
[ ! -e "${symbols2}" ] && extract_symbols ${lib2} ${symbols2} | |
echo "checking '${basename2}' against '${basename1}':" | |
comm -1 -2 ${symbols1} ${symbols2} | |
echo "--------------------------------------------------------------------------------" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment