diff --git a/libitm/eh_cpp.cc b/libitm/eh_cpp.cc index 4909427b405..57beb1a147f 100644 --- a/libitm/eh_cpp.cc +++ b/libitm/eh_cpp.cc @@ -178,7 +178,11 @@ GTM::gtm_thread::init_cpp_exceptions () { // Only save and restore the number of uncaught exceptions if this is // actually used in the program. - if (__cxa_get_globals != NULL && __cxa_get_globals () != 0) + if ( +#if HAVE_ELF_STYLE_WEAKREF + __cxa_get_globals != NULL && +#endif + __cxa_get_globals () != 0) cxa_uncaught_count_ptr = &__cxa_get_globals ()->uncaughtExceptions; else cxa_uncaught_count_ptr = 0;