[Lsb-infrastructure] atexit

Denis Silakov silakov at ispras.ru
Wed Apr 23 01:11:22 PDT 2008


Wichmann, Mats D wrote:
> I've read the messages and I'm confused what
> we should be doing with atexit.  Seems like we
> can't have both the stub/prototype *and* the
> define which revectors to __cxa_atexit at
> the same time, right?  (that would be legal
> in the ordinary sense, POSIX has wording for
> things which have both a macro and a function
> definition).
>   

Well, theoretically we can simply add 'atexit' macro to the Constant
table, but I don't see any reasons to do this, indeed.

> If we go with just the macro it seems it's more
> reliable; since the email on this noted that
> the gcc revectoring sometimes doesn't work.
>   

As far as I understand, gcc >= 4.0.3 should have no problems at all. And
even earlier versions work fine if glibc provides __cxa_atexit, which
means that everything should be ok even on such systems as RHEL 4.

> And with just the macro, the C++ concept of
> undefining all crucial maros so it can get at
> the underlying implementation will fall over
> flat - unless we get the lsb-base-c++ header
> package not to do that for atexit.
>   

Not sure if it is good to remove undef. I still prefer to declare atexit
prototype and leave revectoring for compiler.

> Do we need the mentioned gcc flag?

It could be useful for older gcc versions; at least it will do no harm.

> Does this flag work and/or have any effect with
> non-gcc compilers?  
>   

I've checked this with Intel 10.1 compiler. It understands
-fuse-cxa-atexit, though even without this option it uses __cxa_atexit.

-- 
Regards,
Denis.



More information about the lsb-infrastructure mailing list