2014-04-25 18:42 GMT+02:00 Jonathan Schleifer <js-haiku-development@xxxxxxxxxxx>: > Am 25.04.2014 um 18:30 schrieb Pawel Dziepak <pdziepak@xxxxxxxxxxx>: > >> Could you elaborate on what was wrong with GCC handling destructors of >> global objects? It is quite precisely defined by Itanium C++ ABI >> (namely __cxa_atexit(), __cxa_finalize() and friends) so I wouldn't >> expect big difference in lower level implementation. > > Yes, however, GCC only does that if GCC has been built with the right > options. And -fno-use-cxa-atexit is handled differently: In GCC, it just > seems to disable the calls to __cxa_atexit and __cxa_finalize, whereas it > seems to turn __cxa_atexit into atexit in Clang. Though I remember that the > manpage even said something about GCC doing something different on > -fno-use-cxa-atexit depending on how GCC was configured. With -fno-use-cxa-atexit GCC relies mostly on .ctors and .dtors sections, there is nothing wrong with that. However, more important question is why are we using -fno-use-cxa-atexit at all? Paweł