Bug 35560 - libOSMesa.so now (since 7.2 perhaps) contains the GL API preventing creating one executable with interchangeable libGL.so files
Summary: libOSMesa.so now (since 7.2 perhaps) contains the GL API preventing creating ...
Status: RESOLVED WONTFIX
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 7.10
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-22 12:18 UTC by Michael Saunders
Modified: 2018-03-06 04:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Michael Saunders 2011-03-22 12:18:43 UTC
With Mesa 7.2 we used to build a single application and link against libGL.so and a fake OSMesa library that contained the same dozen or so API's that OSMesa provided. Then at load time using LD_LIBRARY_PATH, rld would either pick up the native libGL.so and our fake libOSMesa.so or libGL.so from Mesa and the real libOSMesa.so. Now that libOSMesa.so has the all the GL API symbols resolved within itself we can no longer do this. We are then forced to create two different executables. One that links to native libGL.so and the other that links to libOSMesa.so. In the first case the native libGL.so can easily be swapped out at load time by changing the LD_LIBRARY_PATH but we can not use OSMesa's offscreen rendering. In the second case we can not do on-screen rendering.

We do I suppose have a workaround which is to create our own GL API that either calls the native libGL.so or the Mesa version (assuming we can decorate the API, which I think we can).

As a quick workaround we simply removed the GL objects from the command that creates the libOSMesa.so library. In addition to this we were forced to export several dozen additional functions within Mesa's libGL.so for libOSMesa.so.
Comment 1 Tom Fogal 2011-03-22 14:47:47 UTC
You might be interested in the 'sci' GLEW branch:

   http://shigeru.sci.utah.edu:1234/git/?p=glew.git;a=summary

it is essentially a library which provides all of the GL symbols but without linking against any GL implementation.  Client libraries/applications can give a path of to the GL implementation and it will dynamically load it at runtime.

I have not yet added OSMesa symbols to the default configuration, but it can use OSMesaGetProcAddress internally, and I will need to add support for OSMesa for my own purposes soon enough... perhaps you'd like to help?

We're also actively working to get this into upstream GLEW, and could always use help on that front, too.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.