From 503d035b7fa3e4d10da4d81eb4e6df0f0804e501 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 16 Jul 2020 20:53:09 +0300 Subject: [PATCH] Added a workaround for uncaught_exceptions on AIX with xlclang++. The compiler provides cxxabi.h header but doesn't have __cxa_get_globals, even in the ABI library. We have to disable __cxa_get_globals-based implementation and fall back to std::uncaught_exception. Fixes https://github.com/boostorg/core/issues/78. --- include/boost/core/uncaught_exceptions.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/boost/core/uncaught_exceptions.hpp b/include/boost/core/uncaught_exceptions.hpp index 27e2491..4643312 100644 --- a/include/boost/core/uncaught_exceptions.hpp +++ b/include/boost/core/uncaught_exceptions.hpp @@ -46,7 +46,11 @@ #if defined(BOOST_CORE_HAS_CXXABI_H) // MinGW GCC 4.4 seem to not work the same way the newer GCC versions do. As a result, __cxa_get_globals based implementation will always return 0. // Just disable it for now and fall back to std::uncaught_exception(). -#if !(defined(__MINGW32__) && (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 405)) +// On AIX, xlclang++ does have cxxabi.h but doesn't have __cxa_get_globals (https://github.com/boostorg/core/issues/78). +#if !( \ + (defined(__MINGW32__) && (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 405)) || \ + defined(__ibmxl__) \ + ) #include #include #define BOOST_CORE_HAS_CXA_GET_GLOBALS @@ -76,7 +80,7 @@ extern "C" __cxa_eh_globals* __cxa_get_globals() BOOST_NOEXCEPT_OR_NOTHROW __att #endif } // namespace __cxxabiv1 #endif -#endif // !(defined(__MINGW32__) && (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 405)) +#endif #endif // defined(BOOST_CORE_HAS_CXXABI_H) #if defined(_MSC_VER) && _MSC_VER >= 1400