summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/glx/egl_glx.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c
index 9082fb3bfad..bdc8a28b4f2 100644
--- a/src/egl/drivers/glx/egl_glx.c
+++ b/src/egl/drivers/glx/egl_glx.c
@@ -1069,17 +1069,22 @@ static EGLBoolean
GLX_Load(_EGLDriver *drv)
{
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
- void *handle;
-
- handle = dlopen("libGL.so", RTLD_LAZY | RTLD_LOCAL);
- if (!handle)
- goto fail;
+ void *handle = NULL;
- GLX_drv->glXGetProcAddress = dlsym(handle, "glXGetProcAddress");
+ GLX_drv->glXGetProcAddress = dlsym(RTLD_DEFAULT, "glXGetProcAddress");
if (!GLX_drv->glXGetProcAddress)
- GLX_drv->glXGetProcAddress = dlsym(handle, "glXGetProcAddressARB");
- if (!GLX_drv->glXGetProcAddress)
- goto fail;
+ GLX_drv->glXGetProcAddress = dlsym(RTLD_DEFAULT, "glXGetProcAddressARB");
+ if (!GLX_drv->glXGetProcAddress) {
+ handle = dlopen("libGL.so", RTLD_LAZY | RTLD_LOCAL);
+ if (!handle)
+ goto fail;
+
+ GLX_drv->glXGetProcAddress = dlsym(handle, "glXGetProcAddress");
+ if (!GLX_drv->glXGetProcAddress)
+ GLX_drv->glXGetProcAddress = dlsym(handle, "glXGetProcAddressARB");
+ if (!GLX_drv->glXGetProcAddress)
+ goto fail;
+ }
#define GET_PROC(proc_type, proc_name, check) \
do { \