blob: 01007c088b8363eac504c424be018cc83cb9325d [file] [log] [blame]
Vic Yang51512c52018-11-12 20:16:26 -08001#!/bin/bash
2set -e
3
4STRIP_PATH="${1}"
5CORE="${2}"
6VENDOR="${3}"
7
8stripped_core="${CORE}.vndk_lib_check.stripped"
9stripped_vendor="${VENDOR}.vndk_lib_check.stripped"
10
11function cleanup() {
12 rm -f ${stripped_core} ${stripped_vendor}
13}
14trap cleanup EXIT
15
16function strip_lib() {
17 ${STRIP_PATH} \
18 -i ${1} \
19 -o ${2} \
20 -d /dev/null \
21 --remove-build-id
22}
23
24strip_lib ${CORE} ${stripped_core}
25strip_lib ${VENDOR} ${stripped_vendor}
26if ! cmp -s ${stripped_core} ${stripped_vendor}; then
27 echo "VNDK library not in vndkMustUseVendorVariantList but has different core and vendor variant: $(basename ${CORE})"
28 echo "If the two variants need to have different runtime behavior, consider using libvndksupport."
29 exit 1
30fi