On 24.09.2015 14:55, Emil Velikov wrote: >>>> __attribute__((destructor)) fixes the problem because such handlers are >>>> called when a library is unloaded and when the program exits. >>> Considering that atexit() (reportedly) works for Linux/Glibc, Solaris, >>> Android and Windows perhaps we should consider this as a workaround >>> for FreeBSD (and other *BSD) systems ? >> >> On one hand, my concern is this behavior is an extension to the standard >> and it could break for someone else. On the other hand, I don't like the >> standard behavior and would be glad to see FreeBSD implement this extension. >> >> I still think relying on this atexit(3) extension is fragile and I don't >> consider the use of the attribute a workaround. >> >>> Considering the multiple users (mentioned above) should one set >>> priority for the destructors ? >> >> You are right, I didn't think of the calling order of the destructors. > > Considering the way the discussion is going, perhaps it's better to > add the destructor as a {Free,*}BSD only option for now ?
I will study the code more, especially regarding calling order of destructors. If I don't find a satisfying solution, then a FreeBSD specific solution is fine for the short term. > We're quite early in the devel cycle, so the latter patch will get > some testing. And if it does not work out, we can revert it. Ok. I'm busy at the moment but will eventually come back to this later in October. > P.S. I will be revisiting the loader/libudev sometime soon, > effectively pushing the chaos into libdrm. You should get a lovely > warning (missing implementation of XXX) when compiling libdrm, for > which patches will be gladly accepted :-) Noted, thanks for the heads-up! -- Jean-Sébastien Pédron
signature.asc
Description: OpenPGP digital signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev