This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
__cxa_atexit question
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 9 May 2006 13:50:10 -0700 (PDT)
- Subject: __cxa_atexit question
- Reply-to: sje at cup dot hp dot com
I have been investigating __cxa_atexit recently and I see that on Linux,
__cxa_atexit, __cxa_finalize, and atexit were put into libc intead of
into libstdc++. I assume this was done because atexit was written to
call __cxa_atexit and C programs that call atexit need to link without
including the C++ runtime library.
On HP-UX the C++ folks did something different, they put a weak
definition of atexit in libc for C programs (one that doesn't use
__cxa_atexit) and then put a regular definition of atexit (written using
__cxa_atexit) along with __cxa_atexit and __cxa_finalize into the C++
runtime library.
I was wondering if building atexit, __cxa_atexit, and __cxa_finalize
into libstdc++ would be considered reasonable? Obvious this would have
to be controllable based on platforms and/or a configure option since we
don't want these in the linux libstdc++ but other platforms (like HP-UX)
might want them in their libstdc++ libraries.
Has this idea been discussed before?
Steve Ellcey
sje@cup.hp.com