We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 238

Summary: dri doesn't work on linux (r200)
Product: SDL Reporter: Matthias Geissert <matthias.geissert>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.9   
Hardware: Other   
OS: Linux   

Description Matthias Geissert 2006-05-22 08:18:23 UTC
The file SDL_x11gl.c loads libGL.so via SDL_LoadObject(). This function adds RTLD_NOW as a second argument to dlopen. The problem is that libGL.so should be opened with RTLD_GLOBAL as well (at least to my knowledge). If you omit RTLD_GLOBAL libGL fails to load r200_dri.so with unresolved symbol _glapi_Dispatch. Hence, dri doesn't work. Adding RTLD_GLOBAL to the second argument of dlopen solves this problem. 

This is also present in 1.2.10.

Btw, I am using glibc 2.3.6, xorg 7.0, Mesa 6.4.2
Comment 1 Ryan C. Gordon 2006-05-23 22:01:22 UTC
Hmm...generally you don't want dlopen() to use RTLD_GLOBAL unless forced to (like this situation) so we shouldn't change this universally inside LoadObject. Sam, any ideas on how to approach this? Is this arguably a bug in DRI?

--ryan.

Comment 2 Matthias Geissert 2006-05-24 07:54:10 UTC
See http://dri.sourceforge.net/doc/DRIuserguide.html, section 11.5. There is written that you need to use RTLD_GLOBAL, since, otherwise, nested open of dynamic libraries doesn't work. However, This is necassary in this case, since libGL opens the hardware-specific driver/library. I hope this helps you.

  
Comment 3 Sam Lantinga 2006-06-19 23:52:29 UTC
This is fixed in subversion, thanks!