summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-09-15 15:04:35 +0400
committerIvan Maidanski <ivmai@mail.ru>2013-09-15 15:17:36 +0400
commita9b7a778ed00c93c0efc328f2ecfad726b29dfbd (patch)
tree382f27573417efefe090577e3ef7f0b23b90cf49 /pthread_support.c
parenta6ee769034470f41f6f7573127a37e0e58e2bb70 (diff)
downloadbdwgc-a9b7a778ed00c93c0efc328f2ecfad726b29dfbd.tar.gz
Adjust 'pthread_[un]register_cancel undefined ref' workaround (Pthreads)
* misc.c (__pthread_register_cancel, __pthread_unregister_cancel): Move prototypes to pthread_support.c. * pthread_support.c (__pthread_unregister_cancel, __pthread_unregister_cancel): Declare only if PTHREAD_REGISTER_CANCEL_WEAK_STUBS defined.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pthread_support.c b/pthread_support.c
index 957408d8..c00b93d5 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -2049,4 +2049,12 @@ GC_INNER void GC_notify_all_marker(void)
#endif /* PARALLEL_MARK */
+#ifdef PTHREAD_REGISTER_CANCEL_WEAK_STUBS
+ /* Workaround "undefined reference" linkage errors on some targets. */
+ void __pthread_register_cancel() __attribute__((__weak__));
+ void __pthread_unregister_cancel() __attribute__((__weak__));
+ void __pthread_register_cancel() {}
+ void __pthread_unregister_cancel() {}
+#endif
+
#endif /* GC_PTHREADS */