Merge pull request #8209 from stephentoub/arraypool_perf
[platform/upstream/coreclr.git] / verify-so.sh
1 #!/usr/bin/env bash
2 # $1 contains full path to the .so to verify
3 # $2 contains message to print when the verification fails
4
5 OSName=$(uname -s)
6 case $OSName in
7     Linux)
8         source /etc/os-release
9         # TODO: add support for verification on Alpine Linux
10         if [ "$ID" != "alpine" ]; then
11             ldd -r $1 | awk 'BEGIN {count=0} /undefined symbol:/ { if (count==0) {print "Undefined symbol(s) found:"} print " " $3; count++ } END {if (count>0) exit(1)}'
12             if [ $? != 0 ]; then
13                 echo "$2"
14                 exit 1
15             fi
16         fi
17         ;;
18 esac
19
20 # TODO: add support for verification on non-Linux Unixes (except of OSX)