Vic Yang | 51512c5 | 2018-11-12 20:16:26 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | set -e |
| 3 | |
| 4 | STRIP_PATH="${1}" |
| 5 | CORE="${2}" |
| 6 | VENDOR="${3}" |
| 7 | |
| 8 | stripped_core="${CORE}.vndk_lib_check.stripped" |
| 9 | stripped_vendor="${VENDOR}.vndk_lib_check.stripped" |
| 10 | |
| 11 | function cleanup() { |
| 12 | rm -f ${stripped_core} ${stripped_vendor} |
| 13 | } |
| 14 | trap cleanup EXIT |
| 15 | |
| 16 | function strip_lib() { |
| 17 | ${STRIP_PATH} \ |
| 18 | -i ${1} \ |
| 19 | -o ${2} \ |
| 20 | -d /dev/null \ |
| 21 | --remove-build-id |
| 22 | } |
| 23 | |
| 24 | strip_lib ${CORE} ${stripped_core} |
| 25 | strip_lib ${VENDOR} ${stripped_vendor} |
| 26 | if ! 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 |
| 30 | fi |