Ian Romanick wrote:
> 
> On Wed, Apr 24, 2002 at 04:49:34PM -0600, Brian Paul wrote:
> > Brian Paul wrote:
> >
> > Perhaps you should try out this change before I commit it to the DRI.
> >
> > Try editing build/xc/lib/GL/GL/Makefile, look for the line that has the
> > string "-Wl,-soname" and replace it with "-Wl,-Bsymbolic,-soname".
> >
> > Remove the libGL.so* files and rebuild the lib.
> 
> That does fix the "problem."  I guess now you have to decide if you want to
> help people write applications that may break in unexpected ways on other
> platforms or even old Linux installs.  The real sticking point in all of
> this is that neither the developer that wrote the bad code (me, in this
> case) or the end-user get any sort of a useful error message.  In my case, I
> just got a segfault that GDB told me was in a function that I didn't even
> call.  The reason was that it tried to execute code in my function pointer
> table, and the nearest symbol was one of the other function pointers.
> 
> This may be a stretch beyond the realm of possability, but is there any way
> to "fix" it and give some sort of a compile-time or link-time warning that
> the developer is only asking for trouble?  The big issue being backwards
> compatability.  We need to not only provide it in the DRI drivers, but we
> need to (try to) provide it in applications that use libGL.so.

Some ideas off the top of my head for detecting a "bad" libGL:

1. Use dlopen() to open libGL and dlsym() to get "glBegin".  Compare that
pointer to the result of glXGetProcAddress("glBegin").  If they're different,
something's wrong.

2. Purposely override one of the lesser-used GL functions in your application,
such as glIndexMask().  Have your glIndexMask() func just set a flag if it
gets
called.  Try calling/jumping through the pointer returned by glXGetProc-
Address("glIndexMask").  If your flag got set, you'll know the library
wasn't built with -Bsymbolic.

Both of these ideas probably have downsides that haven't occured to me yet.


> If nothing else, I'm very good at opening large cans of wriggly worms. :)

Yeah, I gotta hand it you there. :)

-Brian

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to