[patch] Use dlsym instead of glXGetProcAddress in xdriinfo

Andy Ritger aritger at nvidia.com
Wed Nov 23 17:15:42 PST 2005



On Wed, 23 Nov 2005, Vladimir Vukicevic wrote:

> On 11/21/05, Felix Kühling <fxkuehl at gmx.de> wrote:
> > The attached patches (monolithic and modular) should fix dynamic linking
> > problems with xdriinfo, that NVidia users were complaining about. Their
> > libGL doesn't define glXGetProcAddress but only glXGetProcAddressARB.
> 
> Has anyone contacted nVidia to see if they'd be willing to export the
> relevant GLX symbols (glXGetProcAddress in particular, but possibly
> others as well) from their libGL?  It seems like the least painful
> solution, especially since it can potentially lower the amount of
> support issues regarding 6.9 that they have to deal with.

Thanks for asking, Vladimir.  I apologize for not contributing to
this thread sooner.  Between Matthias, Ian, and others, most of the
major points have already been mentioned, but I'll reiterate:

    - the Linux OpenGL ABI
      (http://oss.sgi.com/projects/ogl-sample/ABI/) requires
      the GLX_ARB_get_proc_address extension (which provides
      glXGetProcAddressARB)

    - glXGetProcAddress is a part of the GLX 1.4 draft spec

    - the GLX 1.4 spec has never been ratified (it's not available,
      as far as I can tell, on opengl.org, and the only version of
      the spec I've ever seen was only labeled "Draft")

    - it is undesirable to advertise a version of GLX that is not
      ratified (if it hasn't been ratified, then it's still possible
      to change; if the spec changes, how will applications know
      if an implementation's GLX 1.4 is the ratified 1.4 or the
      earlier draft version of 1.4); in this case, this point
      is probably just academic -- Mesa has claimed GLX 1.4 long
      enough that I doubt anyone would want to try to change the
      GLX 1.4 draft spec.

    - it is undesirable to expose OpenGL API entry points if the
      version string or extension string does not properly reflect
      that the entry point is available (eg: glXGetProcAddress should
      not be expoed by an implementation unless that implementation
      also claims GLX 1.4), mostly because it encourages poor
      versioning practices in OpenGL applications.  Ulrich Drepper
      has good things to say about entry point control in his
      DSO HowTo (http://people.redhat.com/drepper/dsohowto.pdf).

I think the lesson here should be that if you want to write an OpenGL
application on Linux that will be portable to anything other than
GLX 1.4 implementations, you should use "glXGetProcAddressARB",
rather than "glXGetProcAddress".  The former is required by the
Linux OpenGL ABI, so it's a safe assumption, while the latter is
only provided by GLX 1.4 implementations.

That said, I'd like to update NVIDIA's GLX implementation to GLX 1.4.
I've pinged the GLX-ARB working group about the official status of
GLX 1.4, and hopefully we can just make GLX 1.4 official, at which
point NVIDIA's implementation will be updated, the version string
will be reved, and glXGetProcAddress entry point will be exposed.

Thanks,
- Andy


>     - Vladimir
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
> 



More information about the xorg mailing list