[gmpi] Re: Linux C++ question
- From: "Angus F. Hewlett" <angus@xxxxxxxxxxxxx>
- To: gmpi@xxxxxxxxxxxxx
- Date: Thu, 24 Feb 2005 09:41:55 +0000
In my experience, on the Mac OS X gcc platform at least, everything
works correctly for statics at file-scope - they are, correctly,
destroyed from the dynamic-library's unload handler. Only function-scope
and block-scope statics are affected. Anyone know if things are the same
on Linux?
Also, seeing as how this problem doesn't happen on CodeWarrior or MSVC++
DLLs - is it in fact a bug in GCC, or is it intended design?
Regards,
Angus.
Jeff McClintock wrote:
> I'm fine with the new/delete approach (don't use a static object). It
> is minor overhead, minor complexity, and enables my old Cobalt to
use as a testbed :)
OK, Just make a note.
"No GMPI Plugin may use the static keyword on any Object".
Jeff
Tim Hockin wrote:
On Wed, Feb 23, 2005 at 09:53:16PM -0500, Paul Davis wrote:
On Thu, Feb 24, 2005 at 03:14:21PM +1300, Jeff McClintock wrote:
`-fuse-cxa-atexit'
Register destructors for objects with static storage duration
with
the `__cxa_atexit' function rather than the `atexit' function.
This option is required for fully standards-compliant handling of
static destructors, but will only work if your C library supports
`__cxa_atexit'.
Would be nice to have standard-complient code.
Sorry, update: I found a small doc for it. What's not clear is
what to
do if it is NOT supported?
plugins should not use atexit(). period.
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.
each platform that supports shared objects/runtime linkage has its own
rules about what happens when the shared object is "unlinked". on
linux, if there is an entry point called "_fini" in the object, it
will be executed. similar conventions exist for win32 and cocoa/darwin.
I'd rather avoid reliance on platform-isms as much as possible.
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()).
I'm fine with the new/delete approach (don't use a static object). It
is minor overhead, minor complexity, and enables my old Cobalt to use as
a testbed :)
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)
Tim
----------------------------------------------------------------------
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: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe
----------------------------------------------------------------------
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: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe
--
=========================================================
Angus F. Hewlett, Managing Director (CEO)
FXpansion Audio UK Ltd - http://www.fxpansion.com
Registered in the UK - #4455834 - VAT: GB 798 7782 33
=========================================================
----------------------------------------------------------------------
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: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe
- Follow-Ups:
- [gmpi] Re: Linux C++ question
- From: Paul Davis
- References:
- [gmpi] Re: Linux C++ question
- From: Tim Hockin
- [gmpi] Re: Linux C++ question
- From: Paul Davis
- [gmpi] Re: Linux C++ question
- From: Tim Hockin
- [gmpi] Re: Linux C++ question
- From: Jeff McClintock
Other related posts:
- » [gmpi] Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
- » [gmpi] Re: Linux C++ question
> is minor overhead, minor complexity, and enables my old Cobalt to use as a testbed :)
OK, Just make a note.
"No GMPI Plugin may use the static keyword on any Object".
Jeff
Tim Hockin wrote:
On Wed, Feb 23, 2005 at 09:53:16PM -0500, Paul Davis wrote:
On Thu, Feb 24, 2005 at 03:14:21PM +1300, Jeff McClintock wrote:
`-fuse-cxa-atexit'
Register destructors for objects with static storage duration with
the `__cxa_atexit' function rather than the `atexit' function.
This option is required for fully standards-compliant handling of
static destructors, but will only work if your C library supports
`__cxa_atexit'.
Would be nice to have standard-complient code.
Sorry, update: I found a small doc for it. What's not clear is what to
do if it is NOT supported?
plugins should not use atexit(). period.
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.
each platform that supports shared objects/runtime linkage has its own rules about what happens when the shared object is "unlinked". on linux, if there is an entry point called "_fini" in the object, it will be executed. similar conventions exist for win32 and cocoa/darwin.
I'd rather avoid reliance on platform-isms as much as possible.
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()).
I'm fine with the new/delete approach (don't use a static object). It is minor overhead, minor complexity, and enables my old Cobalt to use as a testbed :)
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)
Tim
----------------------------------------------------------------------
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: http://www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe
---------------------------------------------------------------------- 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: http://www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe
---------------------------------------------------------------------- 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.
- [gmpi] Re: Linux C++ question
- From: Paul Davis
- [gmpi] Re: Linux C++ question
- From: Tim Hockin
- [gmpi] Re: Linux C++ question
- From: Paul Davis
- [gmpi] Re: Linux C++ question
- From: Tim Hockin
- [gmpi] Re: Linux C++ question
- From: Jeff McClintock