From: Carl Worth Date: Wed, 3 Jul 2013 00:33:12 +0000 (-0700) Subject: glwrap: Don't hardcode "libGL.so.1" for looking up real OpenGL symbols X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=d6ac766abe401b681282cdcf273e7fb67fff99bd;hp=d6ac766abe401b681282cdcf273e7fb67fff99bd;p=fips glwrap: Don't hardcode "libGL.so.1" for looking up real OpenGL symbols As preparation for testing using GLESv2 we need to ensure that our GL wrappers are prepared for an OpenGL implementation in either the libGL.so.1 library or in libGLESv2.so.2. When the application is directly linked to an OpenGL implementation, we don't care about the name at all. In this case, we can simply call dlsym with RTLD_NEXT to find the real, underlying OpenGL symbols. But when an application uses dlopen to load the OpenGL library, we want to carefully call dlsym with a handle for the same library that the application uses. Previously, the glwrap code was unconditionally calling dlopen for "libGL.so" and that's not what we want. Instead, we now have our dlopen wrapper watch for any dlopen of a library whose name begins with "libGL" and then stashing the returned handle via a new glwrap_set_gl_handle call. The stashed handle will then be used by dlsym calls within glwrap. ---