Index: libcxxabi/src/cxa_thread_atexit.cpp =================================================================== --- libcxxabi/src/cxa_thread_atexit.cpp +++ libcxxabi/src/cxa_thread_atexit.cpp @@ -27,7 +27,15 @@ // at runtime, even if libc++ is built against an older libc _LIBCXXABI_WEAK #endif +#ifdef __MVS__ + // FIXME: No __cxa_thread_atexit_impl on z/OS. + int __cxa_thread_atexit_impl(Dtor, void*, void*) { + abort_message("__cxa_thread_atexit() is not implemented on z/OS"); + return -1; + } +#else int __cxa_thread_atexit_impl(Dtor, void*, void*); +#endif #ifndef HAVE___CXA_THREAD_ATEXIT_IMPL @@ -67,9 +75,15 @@ }; // The linked list of thread-local destructors to run - __thread DtorList* dtors = nullptr; +#ifndef __MVS__ + __thread +#endif + DtorList* dtors = nullptr; // True if the destructors are currently scheduled to run on this thread - __thread bool dtors_alive = false; +#ifndef __MVS__ + __thread +#endif + bool dtors_alive = false; // Used to trigger destructors on thread exit; value is ignored std::__libcpp_tls_key dtors_key;