This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__cxa_atexit question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]