[Mesa-dev] [PATCH 2/4] automake: egl: add symbols test
Emil Velikov
emil.l.velikov at gmail.com
Thu Nov 19 08:33:14 PST 2015
From: Emil Velikov <emil.velikov at collabora.com>
Should help us catch issues where we expose any extra symbols by
mistake. Just like the ones fixes with previous commit.
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
Ideally we'll check all symbols (not only the T ones) and parse out the
private symbols such as _init, _fini and others.
Not a big deal here and now as this approach is used elsewhere in mesa.
-Emil
src/egl/Makefile.am | 3 +++
src/egl/egl-symbols-check | 55 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
create mode 100755 src/egl/egl-symbols-check
diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
index 88fe13a..0b463c8 100644
--- a/src/egl/Makefile.am
+++ b/src/egl/Makefile.am
@@ -119,7 +119,10 @@ egl_HEADERS = \
$(top_srcdir)/include/EGL/eglmesaext.h \
$(top_srcdir)/include/EGL/eglplatform.h
+TESTS = egl-symbols-check
+
EXTRA_DIST = \
+ egl-symbols-check \
SConscript \
drivers/haiku \
docs \
diff --git a/src/egl/egl-symbols-check b/src/egl/egl-symbols-check
new file mode 100755
index 0000000..5d46fed
--- /dev/null
+++ b/src/egl/egl-symbols-check
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+FUNCS=$(nm -D --defined-only ${1-.libs/libEGL.so} | grep -o "T .*" | cut -c 3- | while read func; do
+( grep -q "^$func$" || echo $func ) <<EOF
+eglBindAPI
+eglBindTexImage
+eglChooseConfig
+eglClientWaitSync
+eglCopyBuffers
+eglCreateContext
+eglCreateImage
+eglCreatePbufferFromClientBuffer
+eglCreatePbufferSurface
+eglCreatePixmapSurface
+eglCreatePlatformPixmapSurface
+eglCreatePlatformWindowSurface
+eglCreateSync
+eglCreateWindowSurface
+eglDestroyContext
+eglDestroyImage
+eglDestroySurface
+eglDestroySync
+eglGetConfigAttrib
+eglGetConfigs
+eglGetCurrentContext
+eglGetCurrentDisplay
+eglGetCurrentSurface
+eglGetDisplay
+eglGetError
+eglGetPlatformDisplay
+eglGetProcAddress
+eglGetSyncAttrib
+eglInitialize
+eglMakeCurrent
+eglQueryAPI
+eglQueryContext
+eglQueryString
+eglQuerySurface
+eglReleaseTexImage
+eglReleaseThread
+eglSurfaceAttrib
+eglSwapBuffers
+eglSwapInterval
+eglTerminate
+eglWaitClient
+eglWaitGL
+eglWaitNative
+eglWaitSync
+_fini
+_init
+EOF
+done)
+
+test ! -n "$FUNCS" || echo $FUNCS
+test ! -n "$FUNCS"
--
2.6.2
More information about the mesa-dev
mailing list