diff options
author | Marty E. Plummer <[email protected]> | 2019-05-21 17:02:04 -0500 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-05-22 10:30:33 +0200 |
commit | 7db1a953a39dc89585ae12fb6632a05fd04be5cd (patch) | |
tree | 7ee1c663bfb4e98c714d4009a26f5f01fc565136 /abi-check | |
parent | a30185610beb815648854207cb2a29d0fa9303dc (diff) | |
download | mate-desktop-7db1a953a39dc89585ae12fb6632a05fd04be5cd.tar.bz2 mate-desktop-7db1a953a39dc89585ae12fb6632a05fd04be5cd.tar.xz |
add abi check
Signed-off-by: Marty E. Plummer <[email protected]>
Diffstat (limited to 'abi-check')
-rwxr-xr-x | abi-check | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/abi-check b/abi-check new file mode 100755 index 0000000..666557b --- /dev/null +++ b/abi-check @@ -0,0 +1,45 @@ +#!/bin/bash +set -eu + +RET=0 + +if ! [[ -f "${LIB}" ]]; then + echo "Test library \"${LIB}\" does not exist" + exit 99; +fi + +if ! [[ -n "${NM}" ]]; then + echo "NM environment variable not set" + exit 99; +fi + +AVAIL_FUNCS="$(${NM} -D --format=bsd --defined-only ${LIB} | awk '{print $3}')" + +REQ_FUNCS="$(cat ${ABI})" + +NEW_ABI=$(echo "$AVAIL_FUNCS" | while read func; do + echo "$func" | grep -q "^_" && continue + echo "${REQ_FUNCS}" | grep -q "^${func}$" && continue + + echo "$func" +done) + +if [[ -n ${NEW_ABI} ]]; then + echo "New ABI detected - If intentional, update ${ABI}." + echo "${NEW_ABI}" + RET=1; +fi + +REMOVED_ABI=$(echo "${REQ_FUNCS}" | while read func; do + echo "${AVAIL_FUNCS}" | grep -q "^${func}$" && continue + + echo "${func}" +done) + +if [[ -n ${REMOVED_ABI} ]]; then + echo "ABI break detected - required symbols no longer exported!" + echo "${REMOVED_ABI}" + RET=1 +fi + +exit ${RET} |