[Mesa-dev] [PATCH 15/22] targets/vdpau: automake: add exported symbol tests

Emil Velikov emil.l.velikov at gmail.com
Sat Feb 8 08:04:00 PST 2014


And drop the obsolete export-symbol-regex from the linker.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/Automake.inc                       |  1 -
 src/gallium/targets/r600/vdpau/Makefile.am     |  6 ++++++
 src/gallium/targets/radeonsi/vdpau/Makefile.am |  6 ++++++
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  6 ++++++
 src/gallium/targets/vdpau-symbols-check        | 13 +++++++++++++
 5 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100755 src/gallium/targets/vdpau-symbols-check

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 1e4a34f..57ac9fd 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -61,7 +61,6 @@ GALLIUM_DRI_LINKER_FLAGS = \
 GALLIUM_VDPAU_LINKER_FLAGS = \
 	-module \
 	-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-	-export-symbols-regex $(VDPAU_EXPORTS) \
 	-shared \
 	-no-undefined
 
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am b/src/gallium/targets/r600/vdpau/Makefile.am
index 7f43fbb..ad6d1c8 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -57,6 +57,12 @@ libvdpau_r600_la_LINK = $(LINK) $(libvdpau_r600_la_LDFLAGS)
 nodist_EXTRA_libvdpau_r600_la_SOURCES = dummy-c.c
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=r600; \
+	export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../vdpau-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libvdpau_r600.la
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index 0292b2b..876e1ba 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -50,6 +50,12 @@ libvdpau_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS)
 libvdpau_radeonsi_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=radeonsi; \
+	export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../vdpau-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libvdpau_radeonsi.la
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am b/src/gallium/targets/vdpau-nouveau/Makefile.am
index fbaad03..97c1952 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -50,6 +50,12 @@ libvdpau_nouveau_la_LDFLAGS += $(LLVM_LDFLAGS)
 libvdpau_nouveau_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=nouveau; \
+	export WINSYS_FUNC=nouveau_drm_screen_create;
+
+TESTS = ../vdpau-symbols-check
+
 # Provide compatibility with scripts for the old Mesa build system for
 # a while by putting a link to the driver into /lib of the build tree.
 all-local: libvdpau_nouveau.la
diff --git a/src/gallium/targets/vdpau-symbols-check b/src/gallium/targets/vdpau-symbols-check
new file mode 100755
index 0000000..79e6263
--- /dev/null
+++ b/src/gallium/targets/vdpau-symbols-check
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/libvdpau_${TARGET}.so} | grep -o "T .*" | cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  <<EOF
+vdp_imp_device_create_x11
+${WINSYS_FUNC}
+_fini
+_init
+EOF
+done)
+
+test ! -n "$FUNCS" || echo $FUNCS
+test ! -n "$FUNCS"
-- 
1.8.5.2



More information about the mesa-dev mailing list