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