summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Maennich <maennich@google.com>2019-06-03 12:07:29 +0100
committerMatthias Maennich <maennich@google.com>2019-06-03 12:11:51 +0100
commitc561e76004b4a9eef818c0f4d762798909c02e1b (patch)
tree73d2977e59221788d0930845bf55d1860a837349
parent25062fcd10583bc6b70212f997c2e48753e6537e (diff)
abi: build_abi.sh: compare against predefined ABI
If ABI_DEFINITION is set (usually via build.config), run an actual analysis with build/abi/diff_abi and create a report for any detected differences. Also return the tools error code as error code of build_abi.sh. Signed-off-by: Matthias Maennich <maennich@google.com> Change-Id: Ie744290bfd89c455d6ee966f1e5ede41050e7648
-rwxr-xr-xbuild_abi.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/build_abi.sh b/build_abi.sh
index 01e6e25..e413cf2 100755
--- a/build_abi.sh
+++ b/build_abi.sh
@@ -68,3 +68,20 @@ ln -sf ${abi_out_file} ${DIST_DIR}/abi.xml
echo "========================================================"
echo " ABI dump has been created at ${DIST_DIR}/${abi_out_file}"
+if [ -n "$ABI_DEFINITION" ]; then
+ echo "========================================================"
+ echo " Comparing ABI against expected definition ($ABI_DEFINITION)"
+ abi_report=${DIST_DIR}/abi.report
+ set +e
+ ${ROOT_DIR}/build/abi/diff_abi --baseline $KERNEL_DIR/$ABI_DEFINITION \
+ --new ${DIST_DIR}/${abi_out_file} \
+ --report ${abi_report}
+ rc=$?
+ set -e
+ echo "========================================================"
+ echo " ABI report has been created at ${abi_report}"
+ if [ $rc -ne 0 ] ; then
+ echo " ABI DIFFERENCES HAVE BEEN DETECTED! (RC=$rc)"
+ exit $rc
+ fi
+fi