IBM xlC++ compiler provides its own implementation of atexit() to
provide correct interaction between atexit() and destructors.  GCC
needs to provide the same through libgcc.

I previously added partial support based on the implementation in
GLIBC (copied with FSF permission) and confirmed that destructors
continued to function properly.  This patch completes the support with
the matching definition of atexit().

With this patch, cxa_atexit tests in the testsuite function correctly.

I plan to backport this patch to the GCC 5 branch, in which cxa_atexit
is not enabled by default.

Bootstrapped on powerpc-ibm-aix7.1.0.0 and powerpc-ibm-aix7.1.3.0.

Thanks, David

* config/rs6000/atexit.c: New file.
* config/rs6000/t-aix-cxa (LIB2ADDEH): Build atexit.c.
* config/rs6000/libgcc-aix-cxa.ver (atexit): Add symbol to exports.
* config/rs6000/cxa_finalize.c
(catomic_compare_and_exchange_bool_acq): Negate return value.

Attachment: AA
Description: Binary data

Reply via email to