===================================================================
@@ -49,6 +49,7 @@ static struct object *seen_objects;
static __gthread_mutex_t object_mutex = __GTHREAD_MUTEX_INIT;
#define init_object_mutex_once()
#else
+#ifdef __GTHREAD_MUTEX_INIT_FUNCTION
static __gthread_mutex_t object_mutex;
static void
@@ -63,6 +64,12 @@ init_object_mutex_once (void)
static __gthread_once_t once = __GTHREAD_ONCE_INIT;
__gthread_once (&once, init_object_mutex);
}
+#else
+/* ??? Several targets include this file with stubbing parts of gthr.h
+ and expect no locking to be done. */
+#define init_object_mutex_once()
+static __gthread_mutex_t object_mutex;
+#endif
#endif
/* Called from crtbegin.o to register the unwind info for an object. */