diff options
| author | Xiangling Liao <Xiangling.Liao@ibm.com> | 2020-07-16 14:29:13 -0400 |
|---|---|---|
| committer | Xiangling Liao <Xiangling.Liao@ibm.com> | 2020-07-17 16:14:49 -0400 |
| commit | ec6ada62643cf7cded8160e04cce163323112ade (patch) | |
| tree | 74772bbb6e1ad238796cd6c36fa2bc74f0359f1d /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | 502f0cc0e3889229e923e187f38dda91324ae139 (diff) | |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 4ae8ce7e5ccf..4c792520b5f3 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1209,6 +1209,9 @@ void CodeGenModule::AddGlobalCtor(llvm::Function *Ctor, int Priority, /// when the module is unloaded. void CodeGenModule::AddGlobalDtor(llvm::Function *Dtor, int Priority) { if (CodeGenOpts.RegisterGlobalDtorsWithAtExit) { + if (getCXXABI().useSinitAndSterm()) + llvm::report_fatal_error( + "register global dtors with atexit() is not supported yet"); DtorsUsingAtExit[Priority].push_back(Dtor); return; } |
