File: test-static-symbols-leak.sh

package info (click to toggle)
libevdev 1.13.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,704 kB
  • sloc: ansic: 9,518; sh: 4,516; makefile: 221; python: 178; xml: 171; javascript: 53
file content (21 lines) | stat: -rwxr-xr-x 615 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
#
# 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"

test -z "$RUNNING_ON_VALGRIND" || exit 77

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