Commit 2c9223f8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

EGL: superb hack around Mesa EGL damaged linking

parent d60221ca
......@@ -91,6 +91,9 @@ libegl_plugin_la_CFLAGS = $(AM_CFLAGS) \
$(EGL_CFLAGS) $(GL_CFLAGS)
libegl_plugin_la_LIBADD = $(AM_LIBADD) \
$(EGL_LIBS) $(GL_LIBS)
if !HAVE_WIN32
libegl_plugin_la_LIBADD += -ldl
endif
libegl_plugin_la_DEPENDENCIES =
EXTRA_LTLIBRARIES += libegl_plugin.la
libvlc_LTLIBRARIES += $(LTLIBegl)
......
......@@ -48,6 +48,10 @@
# define VLC_RENDERABLE_BIT EGL_OPENGL_BIT
#endif
#ifdef __unix__
# include <dlfcn.h>
#endif
/* Plugin callbacks */
static int Open (vlc_object_t *);
static void Close (vlc_object_t *);
......@@ -151,6 +155,17 @@ static int Open (vlc_object_t *obj)
sys->gl.sys = NULL;
sys->pool = NULL;
/* XXX Explicit hack!
* Mesa EGL plugins (as of version 7.8.2) are not properly linked to
* libEGL.so even though they import some of its symbols. This is
* typically not a problem. Unfortunately, LibVLC loads plugins as
* RTLD_LOCAL so that they do not pollute the namespace. Then the
* libEGL symbols are not visible to EGL plugins, and the run-time
* linker exits the whole process. */
#ifdef __unix__
dlopen ("libEGL.so", RTLD_GLOBAL|RTLD_LAZY);
#endif
EGLint major, minor;
if (eglInitialize (dpy, &major, &minor) != EGL_TRUE)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment