From 196471a96859e525643a799d4864ab0089a5ce11 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 2 Jan 2006 13:16:16 +0000 Subject: [PATCH] Linux: Re-added RTLD_GLOBAL to dlopen() with a comment since DRI drivers need it. --- src/native/linux/extgl_glx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/native/linux/extgl_glx.c b/src/native/linux/extgl_glx.c index 0ff47c10..58cd5cd6 100644 --- a/src/native/linux/extgl_glx.c +++ b/src/native/linux/extgl_glx.c @@ -154,7 +154,16 @@ bool extgl_Open(JNIEnv *env) { char buffer[BUFFER_SIZE]; if (lib_gl_handle != NULL) return true; - lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY); + /* + * Actually we don't need the RTLD_GLOBAL flag, since the symbols + * we load should be private to us. However, according to the + * documentation at + * + * http://dri.sourceforge.net/doc/DRIuserguide.html + * + * DRI drivers need this flag to work properly + */ + lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_gl_handle == NULL) { snprintf(buffer, BUFFER_SIZE, "Error loading libGL.so.1: %s", dlerror()); buffer[BUFFER_SIZE - 1] = '\0';