g++ on recent darwin appears to be clang++ in disguise, and so
supports the TSA decorations, but the wrappers we define don't have
explicit extern "C" linkage (which perlapi.h does have).
Under C++ Time::HiRes wraps its includes in extern "C" { }, and
so references unmangled names for the perl_tsa_mutex_*() wrappers,
but since util.c never sees an extern "C" for those functions it
produces mangled names, causing undefined references in Time::HiRes.
Detected by a smoke run againt a smoke-me branch:
http://www.nntp.perl.org/group/perl.daily-build.reports/2016/03/msg190183.html
Longer term the TSA decorations should probably be probed for in Configure
and the wrapper declarations moved to embed.fnc
* TODO: however, some platforms are starting to get these clang
* thread safety annotations for pthreads, for example FreeBSD.
* Do we need a way to a bypass these wrappers? */
-int perl_tsa_mutex_lock(perl_mutex* mutex)
+EXTERN_C int perl_tsa_mutex_lock(perl_mutex* mutex)
PERL_TSA_ACQUIRE(*mutex)
PERL_TSA_NO_TSA;
-int perl_tsa_mutex_unlock(perl_mutex* mutex)
+EXTERN_C int perl_tsa_mutex_unlock(perl_mutex* mutex)
PERL_TSA_RELEASE(*mutex)
PERL_TSA_NO_TSA;
#endif