2020-08-10 22:47:09 +02:00
|
|
|
#!/usr/bin/env bash
|
2020-02-18 19:21:47 +10:00
|
|
|
#
|
|
|
|
|
# Hack to check for leaking symbols in the static library.
|
|
|
|
|
# See https://bugs.freedesktop.org/show_bug.cgi?id=82785
|
|
|
|
|
# Note the spaces in the expressions! After the first grep, each line
|
|
|
|
|
# is " T symbol_name"
|
|
|
|
|
|
2020-02-18 19:31:43 +10:00
|
|
|
test -z "$RUNNING_ON_VALGRIND" || exit 77
|
|
|
|
|
|
2020-02-18 19:21:47 +10:00
|
|
|
builddir="$1"
|
|
|
|
|
|
|
|
|
|
test -f "$builddir/test-static-link" || (echo "Unable to find test file" && exit 1)
|
|
|
|
|
nm --extern-only "$builddir/test-static-link" |
|
|
|
|
|
grep -o -e " T .*" | \
|
|
|
|
|
grep -v -e " main\$" \
|
|
|
|
|
-e " atexit" \
|
|
|
|
|
-e " mangle_path" \
|
|
|
|
|
-e " *gcov.*" \
|
|
|
|
|
-e " _.*" \
|
|
|
|
|
-e " libevdev_*" && \
|
|
|
|
|
echo "Leaking symbols found" && exit 1 || exit 0
|