GNU bug report logs -
#7073
no pthread_spinlock_t on Mac OS 10.6.4
Previous Next
Reported by: "Gary V. Vaughan" <gary <at> gnu.org>
Date: Mon, 20 Sep 2010 05:52:01 UTC
Severity: normal
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
On 09/19/2010 07:43 PM, Gary V. Vaughan wrote:
> my system headers have no pthread_spinlock_t definition, but
> gnulib sees /usr/include/pthread.h and uses that instead of generating it's own,
> ...
> I don't know enough about pthreads to tell whether gnulib should paper over
> the lack of spinlocks on Mac OS, or whether coreutils should be more careful
> about using spinlocks without having tested for them first...
If MacOS doesn't have spinlocks, then from coreutils' point of view MacOS
doesn't have proper thread support. The simplest fix is for coreutils
to use the substitute pthread.h on MacOS. Does the following patch
work for you?
diff --git a/m4/pthread.m4 b/m4/pthread.m4
index 69866cb..121d84d 100644
--- a/m4/pthread.m4
+++ b/m4/pthread.m4
@@ -6,19 +6,22 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_PTHREAD_CHECK],
[AC_CHECK_HEADERS_ONCE([pthread.h])
+ AC_CHECK_TYPES([pthread_t])
LIB_PTHREAD=
- PTHREAD_H=
- if test "$ac_cv_header_pthread_h" = yes; then
- gl_saved_libs=$LIBS
- AC_SEARCH_LIBS([pthread_create], [pthread],
- [if test "$ac_cv_search_pthread_create" != "none required"; then
- LIB_PTHREAD="$ac_cv_search_pthread_create"
- fi])
- LIBS="$gl_saved_libs"
- else
- AC_CHECK_TYPES([pthread_t])
- PTHREAD_H='pthread.h'
+ PTHREAD_H='pthread.h'
+ if test "$ac_cv_header_pthread_h" = yes &&
+ test "$ac_cv_type_pthread_t" = yes; then
+ AC_CHECK_TYPE([pthread_spinlock_t])
+ if test "$ac_cv_type_pthread_spinlock_t" = yes; then
+ PTHREAD_H=
+ gl_saved_libs=$LIBS
+ AC_SEARCH_LIBS([pthread_create], [pthread],
+ [if test "$ac_cv_search_pthread_create" != "none required"; then
+ LIB_PTHREAD="$ac_cv_search_pthread_create"
+ fi])
+ LIBS="$gl_saved_libs"
+ fi
fi
AC_SUBST([LIB_PTHREAD])
This bug report was last modified 6 years and 201 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.