Permalink
Please sign in to comment.
Browse files
Fix shared library dependencies verification on some platforms (#8349)
The existing way of verifying shared library dependencies, used for System.Globalization.Native.so, doesn't work on platforms that don't have ldd or where ldd doesn't support the `-r` option. This change makes the check happen on non-Alpine Linux only for now. It also refactors the way the check is performed. Instead of doing it post build in the build.sh, it is now performed as a postbuild phase of the System.Globalization.Native target and it is also generalized so that we can easily add such verification to other build targets. The new verify-so.sh script is also used in corefx.
- Loading branch information...
Showing
with
42 additions
and 8 deletions.
- +0 −8 build.sh
- +16 −0 functions.cmake
- +6 −0 src/corefx/System.Globalization.Native/CMakeLists.txt
- +20 −0 verify-so.sh
20
verify-so.sh
| @@ -0,0 +1,20 @@ | ||
| +#!/usr/bin/env bash | ||
| +# $1 contains full path to the .so to verify | ||
| +# $2 contains message to print when the verification fails | ||
| + | ||
| +OSName=$(uname -s) | ||
| +case $OSName in | ||
| + Linux) | ||
| + source /etc/os-release | ||
| + # TODO: add support for verification on Alpine Linux | ||
| + if [ "$ID" != "alpine" ]; then | ||
| + 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)}' | ||
| + if [ $? != 0 ]; then | ||
| + echo "$2" | ||
| + exit 1 | ||
| + fi | ||
| + fi | ||
| + ;; | ||
| +esac | ||
| + | ||
| +# TODO: add support for verification on non-Linux Unixes (except of OSX) |
0 comments on commit
7481687