[Mesa-dev] [PATCH 16/22] targets/dri: automake: add test for exported symbols

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


dri targets should export the following
 - __driDriverExtensions
 - __dri2ConfigOptions
and
 - *winsys_create > for gl-vdpau interop

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/Automake.inc                     |  1 -
 src/gallium/targets/dri-i915/Makefile.am     |  5 +++++
 src/gallium/targets/dri-ilo/Makefile.am      |  5 +++++
 src/gallium/targets/dri-nouveau/Makefile.am  |  6 ++++++
 src/gallium/targets/dri-swrast/Makefile.am   |  5 +++++
 src/gallium/targets/dri-symbols-check        | 15 +++++++++++++++
 src/gallium/targets/dri-vmwgfx/Makefile.am   |  5 +++++
 src/gallium/targets/r300/dri/Makefile.am     |  6 ++++++
 src/gallium/targets/r600/dri/Makefile.am     |  6 ++++++
 src/gallium/targets/radeonsi/dri/Makefile.am |  6 ++++++
 10 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100755 src/gallium/targets/dri-symbols-check

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 57ac9fd..0ba7e57 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -51,7 +51,6 @@ GALLIUM_VIDEO_CFLAGS = \
 	$(VISIBILITY_CFLAGS)
 
 
-# TODO: add -export-symbols-regex
 GALLIUM_DRI_LINKER_FLAGS = \
 	-module \
 	-avoid-version \
diff --git a/src/gallium/targets/dri-i915/Makefile.am b/src/gallium/targets/dri-i915/Makefile.am
index 3f8468f..1155b8b 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -59,6 +59,11 @@ AM_CPPFLAGS += -DGALLIUM_LLVMPIPE
 i915_dri_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=i915;
+
+TESTS = ../dri-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: i915_dri.la
diff --git a/src/gallium/targets/dri-ilo/Makefile.am b/src/gallium/targets/dri-ilo/Makefile.am
index 418e2ea..d24228e 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -59,6 +59,11 @@ ilo_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 ilo_dri_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=ilo;
+
+TESTS = ../dri-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: ilo_dri.la
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am b/src/gallium/targets/dri-nouveau/Makefile.am
index 1988067..79a839b 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -54,6 +54,12 @@ nouveau_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 nouveau_dri_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=nouveau; \
+	export WINSYS_FUNC=nouveau_drm_screen_create;
+
+TESTS = ../dri-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: nouveau_dri.la
diff --git a/src/gallium/targets/dri-swrast/Makefile.am b/src/gallium/targets/dri-swrast/Makefile.am
index ec1576b..3635edf 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -62,6 +62,11 @@ swrast_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 swrast_dri_la_LIBADD += $(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=swrast;
+
+TESTS = ../dri-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: swrast_dri.la
diff --git a/src/gallium/targets/dri-symbols-check b/src/gallium/targets/dri-symbols-check
new file mode 100755
index 0000000..1100421
--- /dev/null
+++ b/src/gallium/targets/dri-symbols-check
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/${TARGET}_dri.so} | egrep -o "T .*|D .*|R .*" | cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func )  <<EOF
+${WINSYS_FUNC}
+__dri2ConfigOptions
+__driDriverExtensions
+_edata
+_fini
+_init
+EOF
+done)
+
+test ! -n "$FUNCS" || echo $FUNCS
+test ! -n "$FUNCS"
diff --git a/src/gallium/targets/dri-vmwgfx/Makefile.am b/src/gallium/targets/dri-vmwgfx/Makefile.am
index 712e570..570f469 100644
--- a/src/gallium/targets/dri-vmwgfx/Makefile.am
+++ b/src/gallium/targets/dri-vmwgfx/Makefile.am
@@ -58,6 +58,11 @@ vmwgfx_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 vmwgfx_dri_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=vmwgfx;
+
+TESTS = ../dri-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: vmwgfx_dri.la
diff --git a/src/gallium/targets/r300/dri/Makefile.am b/src/gallium/targets/r300/dri/Makefile.am
index d6d8f2d..6a4d30b 100644
--- a/src/gallium/targets/r300/dri/Makefile.am
+++ b/src/gallium/targets/r300/dri/Makefile.am
@@ -56,6 +56,12 @@ r300_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 r300_dri_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=r300; \
+	export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../dri-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: r300_dri.la
diff --git a/src/gallium/targets/r600/dri/Makefile.am b/src/gallium/targets/r600/dri/Makefile.am
index 42db72f..21964ec 100644
--- a/src/gallium/targets/r600/dri/Makefile.am
+++ b/src/gallium/targets/r600/dri/Makefile.am
@@ -58,6 +58,12 @@ r600_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 r600_dri_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=r600; \
+	export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../dri-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: r600_dri.la
diff --git a/src/gallium/targets/radeonsi/dri/Makefile.am b/src/gallium/targets/radeonsi/dri/Makefile.am
index 2c1a58d..20a2bcf 100644
--- a/src/gallium/targets/radeonsi/dri/Makefile.am
+++ b/src/gallium/targets/radeonsi/dri/Makefile.am
@@ -56,6 +56,12 @@ radeonsi_dri_la_LDFLAGS += $(LLVM_LDFLAGS)
 radeonsi_dri_la_LIBADD += $(LLVM_LIBS)
 endif
 
+AM_TESTS_ENVIRONMENT = \
+	export TARGET=radeonsi; \
+	export WINSYS_FUNC=radeon_drm_winsys_create;
+
+TESTS = ../../dri-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: radeonsi_dri.la
-- 
1.8.5.2



More information about the mesa-dev mailing list