[Mesa-dev] shared LLVM library causes program abortion

Jose Fonseca jfonseca at vmware.com
Tue May 17 12:24:31 PDT 2011


Dave,

This is a problem that popped up on our testing with Fedora 15 and swrast_dri.so, but I believe it can happen with any /usr/lib/dri/*_dri.so , and will like happen with any other distro that tries to dynamically link DRI drivers against LLVM 2.8.  Which is why I'm bring it up here instead of a bug report.


The issue is that the *_dri.so are linking against a shared LLVM library. When XCloseDisplay is called, the *_dri.so to be unloaded, but misteriously /usr/lib/dri/libllvmcore-2.8.so is not.  A later attempt to use GL will cause

  prog: for the -disable-mmx option: may only occur zero or one times!

Attached is a simple test program that illustrate this.


I believe the best alternative here is to build  *_dri.so with -z nodelete when linking against a shared libLLVM*.


Other alternatives are:
- build *_dri.so with statically linked LLVM
- get LLVM to unload (but I think it's a loosing battle, because it really relies on , it can install signal handlers in some cases, and it will likely cause leaks)


Jose
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.c
Type: text/x-csrc
Size: 1733 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110517/fe6b84c1/attachment.c>


More information about the mesa-dev mailing list