[AIX] report_fatal_error on `-fregister_global_dtors_with_atexit` for static init
authorXiangling Liao <Xiangling.Liao@ibm.com>
Thu, 16 Jul 2020 18:29:13 +0000 (14:29 -0400)
committerXiangling Liao <Xiangling.Liao@ibm.com>
Fri, 17 Jul 2020 20:14:49 +0000 (16:14 -0400)
commitec6ada62643cf7cded8160e04cce163323112ade
tree74772bbb6e1ad238796cd6c36fa2bc74f0359f1d
parent502f0cc0e3889229e923e187f38dda91324ae139
[AIX] report_fatal_error on `-fregister_global_dtors_with_atexit` for static init

On AIX, the semantic of global_dtors contains __sterm functions associated with C++
cleanup actions and user-declared __attribute__((destructor)) functions. We should
never merely register __sterm with atexit(), so currently
-fregister_global_dtors_with_atexit does not work well on AIX: It would cause
finalization actions to not occur when unloading shared libraries.  We need to figure
out a way to handle that when we start supporting user-declared
__attribute__((destructor)) functions.

Currently we report_fatal_error on this option temporarily.

Differential Revision: https://reviews.llvm.org/D83974
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGenCXX/aix-sinit-register-global-dtors-with-atexit.cpp [new file with mode: 0644]
clang/test/Driver/cxa-atexit.cpp