[gmpi] Re: Linux C++ question

  • From: Paul Davis <paul@xxxxxxxxxxxxxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Thu, 24 Feb 2005 08:49:35 -0500

>The code is not using atexit().  The compiler is using atexit() to call
>the static objects destructor.
>
>This is a bug, and has been fixed by the creation of __cxa_atexit()
>which runs at dll unload time.

details on this can be found here:

     http://www.codesourcery.com/cxx-abi/cxx-closed.html

note the detailed discussion. note also that this discussion does
*not* cover the mechanism by which unloading the DSO ends up calling
__cxa_finalize(). this remains platform dependent. 

>I'd rather avoid reliance on platform-isms as much as possible.

i don't know if that is entirely possibly here, although the
discussion in that document is optimistic.

>The question is not whether we should use atexit or not, the question is
>whether we should jump through a (very minor) hoop to allow the plugin
>base class to run on older GNU installations (those that pre-date
>__cxa_atexit()).

No, we should not. This was clarified (according to the document cited
above) by at least November 2000. There is no reason to be pointing
backwards before that, unless it turns out that other platforms have
similar back-portability issues.

However, i think we could recommend the "no static objects, use
new/delete in constructor/destructor methods" approach.

>I'd also be fine saying that a GMPI platform must support the ability to
>load and unload dlls with static objects.  This may require compiler
>flags for people building plugins.  (and it means my RH8 era Cobalt is out
>of the game as a GMPI platform)

We can say both.

--p

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: