GNOME Bugzilla – Bug 654593
"dlopening an unversionaed Shared Object is illegal."
Last modified: 2011-07-19 14:18:44 UTC
We try to open "libGL.so", unversioned with gmodule. Apparently that's against the law: https://bugzilla.rpmfusion.org/show_bug.cgi?id=1842 (this applies to all of the modules we try to load too, I guess)
even though the OpenGL Linux ABI mandates the existence of a libGL.so, as per standard: http://www.opengl.org/registry/ABI/ we might just use libGL.so.1 instead of dlopen()'ing libGL.so directly.
At the moment Cogl is using g_module_path("GL") and it relies on glib to tack on the right prefix and suffix for the library. If we switch to "libGL.so.1" we couldn't use g_module_path so I guess that makes it less portable. Maybe this wouldn't be a big deal though because the current platforms we support where this matters (OSX and WGL) are directly linking to the library instead.
dlopening an unversioned object is not 'illegal', thats nonsense
Created attachment 192206 [details] [review] Specify the full filename when g_module_open'ing the GL library Instead of using g_module_build_path with the short name of the GL library (eg, "GL") and relying on glib to add the suffix and prefix, the configure script now directly encodes the full name including the version number (eg, "libGL.so.1"). This is necessary because distros don't always install the non-versioned suffix for the library. The GLES libraries are left without the version suffix because it's not clear what should be placed here and I can't find any documentation from Khronos to clarify this. Mesa seems to install a file called libGLESv2.so.2 but the IMG SDK doesn't install any versioned library. There is an example of dynamically loading libGLESv2 in the Chromium source code and that does not use the version suffix even though it does use the version suffix for GL. This implies that it's at least fairly normal to load the unversioned name for GLES.
Created attachment 192207 [details] [review] configure: Add configure options to override the GL library name This adds 3 configure options to override the library name that gets dlopened for GL, GLES and GLESv2. This could be useful for distro maintainers who have an unusual name for the libraries (for example, on OpenBSD the GL library appears to be called libGL.so.4). This could at least be simpler than having to create a distro patch. The configure options would be used like this: ./configure --with-gl-libname=libGL.so \ --with-gles1-libname=libGLESv1.so \ --with-gles2-libname=libGLESv2.so
Pushed as eb578e4..9b6c1eb