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. > However, the standard isn't very strict about the order in which global > objects > have to be destroyed and that might be a reason of segfault if there > is some hidden dependency between global objects. That would be > something that should be fixed regardless of whether we are going to > switch to clang or not. Yes, this could very well be that either the order is wrong or that the code was compiled with -fno-use-cxa-atexit and the different behaviour stated above applies. -- Jonathan