This is an archive of the discontinued LLVM Phabricator instance.

[AIX] Default AIX to using -fno-use-cxa-atexit
ClosedPublic

Authored by Xiangling_L on Jun 18 2020, 5:11 PM.

Details

Summary

On AIX, we use __atexit to register dtor functions rather than __cxa_atexit.
So a driver change is needed to default AIX to using -fno-use-cxa-atexit.

Windows platform does not uses __cxa_atexit either. Following its precedent, we remove the assertion for when -fuse-cxa-atexit is specified by the user, do not produce a message and silently default to -fno-use-cxa-atexit behavior.

Diff Detail

Event Timeline

Xiangling_L created this revision.Jun 18 2020, 5:11 PM

LGTM with minor comments.

clang/lib/CodeGen/ItaniumCXXABI.cpp
4532

Okay, the observation is that the Windows implementation doesn't implement a similar assertion for when -fuse-cxa-atexit is specified by the user and it neither uses __cxa_atexit nor produces a message about the option. This provides some amount of rationale for why AIX does not need to take extra precautions.

Can you update the patch description to cover the removal of said precautions and a bit of the rationale (that Windows didn't take similar precautions)?

clang/test/Driver/cxa-atexit.cpp
20

Can we add an extra line for 64-bit AIX?

This revision is now accepted and ready to land.Jun 18 2020, 6:40 PM
Xiangling_L edited the summary of this revision. (Show Details)Jun 19 2020, 4:41 AM
Xiangling_L edited the summary of this revision. (Show Details)Jun 19 2020, 5:26 AM
This revision was automatically updated to reflect the committed changes.
Xiangling_L marked 2 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2020, 5:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript