aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-12-03 17:09:35 +0000
committerIain Sandoe <iain@sandoe.co.uk>2022-12-04 14:55:07 +0000
commita044c9d25972b22c6b4c8ec27f2de5fd622573cc (patch)
treec8ab5410bebe81b3dd0aaa227b3fa6c409919b46
parente76a44bf68b79278cb2c20e4ce87657a247adcfe (diff)
downloadgcc-a044c9d25972b22c6b4c8ec27f2de5fd622573cc.zip
gcc-a044c9d25972b22c6b4c8ec27f2de5fd622573cc.tar.gz
gcc-a044c9d25972b22c6b4c8ec27f2de5fd622573cc.tar.bz2
libstdc++, Darwin: Limit recursive mutex init to OS versions needing it.
The problem described in pr 51906 was fixed in the next OS release. Limit the workaround to systems that need it. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> libstdc++-v3/ChangeLog: * config/os/bsd/darwin/os_defines.h (_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC): Limit use of this macro to OS versions that need it.
-rw-r--r--libstdc++-v3/config/os/bsd/darwin/os_defines.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/config/os/bsd/darwin/os_defines.h b/libstdc++-v3/config/os/bsd/darwin/os_defines.h
index 38fdfb5..5b611d3 100644
--- a/libstdc++-v3/config/os/bsd/darwin/os_defines.h
+++ b/libstdc++-v3/config/os/bsd/darwin/os_defines.h
@@ -39,8 +39,12 @@
// implementation is not itself a weak definition).
#define _GLIBCXX_WEAK_DEFINITION __attribute__ ((__weak__))
-// Static initializer macro is buggy in darwin, see libstdc++/51906
+#if defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \
+ && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1080)
+// Static initializer macro is absent for Darwin < 11 and buggy in Darwin 11,
+// see libstdc++/51906. Fixed in Darwin 12 (OS X 10.8).
#define _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC
+#endif
// Configure checks for nanosleep fail on Darwin, but nanosleep and
// sched_yield are always available, so use them.