[Mesa-dev] [PATCH 17/22] targets/xvmc: add automake test to check for exported symbols

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


Drop the use of -export-symbols-regex now that xvmc drivers/backends
export only the required functions. Add a test to capture future
problems via make check.

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

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 0ba7e57..c67b612 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -67,7 +67,6 @@ GALLIUM_XVMC_LINKER_FLAGS = \
 	-module \
 	-version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
 	-shared \
-	-export-symbols-regex '^XvMC' \
 	-no-undefined
 
 GALLIUM_VDPAU_LIB_DEPS = \
diff --git a/src/gallium/targets/r600/xvmc/Makefile.am b/src/gallium/targets/r600/xvmc/Makefile.am
index 7fe9b1a..016517e 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -55,6 +55,12 @@ libXvMCr600_la_LINK = $(LINK) $(libXvMCr600_la_LDFLAGS)
 nodist_EXTRA_libXvMCr600_la_SOURCES = dummy-c.c
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=r600; \
+	export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../xvmc-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: libXvMCr600.la
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am b/src/gallium/targets/xvmc-nouveau/Makefile.am
index 4a45f41..55924a4 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -48,6 +48,12 @@ libXvMCnouveau_la_LDFLAGS += $(LLVM_LDFLAGS)
 libXvMCnouveau_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=nouveau; \
+	export WINSYS_FUNC=nouveau_drm_screen_create;
+
+TESTS = ../xvmc-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: libXvMCnouveau.la
diff --git a/src/gallium/targets/xvmc-symbols-check b/src/gallium/targets/xvmc-symbols-check
new file mode 100755
index 0000000..c6aeb02
--- /dev/null
+++ b/src/gallium/targets/xvmc-symbols-check
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/libXvMC${TARGET}.so} | grep -o "T .*" | cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  <<EOF
+${WINSYS_FUNC}
+XvMCBlendSubpicture
+XvMCBlendSubpicture2
+XvMCClearSubpicture
+XvMCCompositeSubpicture
+XvMCCreateBlocks
+XvMCCreateContext
+XvMCCreateMacroBlocks
+XvMCCreateSubpicture
+XvMCCreateSurface
+XvMCDestroyBlocks
+XvMCDestroyContext
+XvMCDestroyMacroBlocks
+XvMCDestroySubpicture
+XvMCDestroySurface
+XvMCFlushSubpicture
+XvMCFlushSurface
+XvMCGetAttribute
+XvMCGetSubpictureStatus
+XvMCGetSurfaceStatus
+XvMCHideSurface
+XvMCPutSurface
+XvMCQueryAttributes
+XvMCRenderSurface
+XvMCSetAttribute
+XvMCSetSubpicturePalette
+XvMCSyncSubpicture
+XvMCSyncSurface
+_fini
+_init
+EOF
+done)
+
+test ! -n "$FUNCS" || echo $FUNCS
+test ! -n "$FUNCS"
-- 
1.8.5.2



More information about the mesa-dev mailing list