在 GCC docs中,
-fuse-cxa-atexit
Register destructors for objects with static storage duration with the __cxa_atexit
function rather than the atexit
function. This option is required for fully standards-compliant handling of static destructors, but only works if your C library supports __cxa_atexit
.
在clang的参考手册Clang command line argument reference — Clang 13 documentation中,
Override the default ABI to return small structs in registers
-fregister-global-dtors-with-atexit
,
-fno-register-global-dtors-with-atexit
Use atexit or __cxa_atexit to register global destructors
-fuse-cxa-atexit
,
-fno-use-cxa-atexit