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
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
While testing my rewrite of gnulib's bootstrap script, I've been
unable to rebuild coreutils from git master. However, when I
reverted to a fresh checkout and used the repo bootstrap script,
the build still fails on my Mac:
../../src/sort.c:243: error: expected specifier-qualifier-list before 'pthread_spinlock_t'
../../src/sort.c: In function 'lock_node':
../../src/sort.c:3159: warning: implicit declaration of function 'pthread_spin_lock'
../../src/sort.c:3159: error: 'struct merge_node' has no member named 'lock'
../../src/sort.c: In function 'unlock_node':
../../src/sort.c:3167: warning: implicit declaration of function 'pthread_spin_unlock'
../../src/sort.c:3167: error: 'struct merge_node' has no member named 'lock'
../../src/sort.c: In function 'sortlines':
../../src/sort.c:3445: error: 'pthread_spinlock_t' undeclared (first use in this function)
../../src/sort.c:3445: error: (Each undeclared identifier is reported only once
../../src/sort.c:3445: error: for each function it appears in.)
../../src/sort.c:3445: error: expected ';' before 'lock'
../../src/sort.c:3446: warning: implicit declaration of function 'pthread_spin_init'
../../src/sort.c:3446: error: 'lock' undeclared (first use in this function)
../../src/sort.c:3448: warning: excess elements in struct initializer
../../src/sort.c:3448: warning: (near initialization for 'node')
../../src/sort.c: In function 'sort':
../../src/sort.c:3759: error: 'pthread_spinlock_t' undeclared (first use in this function)
../../src/sort.c:3759: error: expected ';' before 'lock'
../../src/sort.c:3760: error: 'lock' undeclared (first use in this function)
../../src/sort.c:3763: warning: excess elements in struct initializer
../../src/sort.c:3763: warning: (near initialization for 'node')
lib/config.h contains:
/* Define to 1 if you have the `pthread_atfork' function. */
#define HAVE_PTHREAD_ATFORK 1
/* Define to 1 if you have the <pthread.h> header file. */
#define HAVE_PTHREAD_H 1
/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
#define HAVE_PTHREAD_MUTEX_RECURSIVE 1
/* Define if the POSIX multithreading library has read/write locks. */
#define HAVE_PTHREAD_RWLOCK 1
/* Define to 1 if the system has the type `pthread_t'. */
/* #undef HAVE_PTHREAD_T */
So, in this case, 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,
even though gnulib's pthread.h makes no allowance for lack of spinlocks when
HAVE_PTHREAD_T is undefined as in my case.
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...
Cheers,
--
Gary V. Vaughan (gary <at> gnu.org)
[PGP.sig (application/pgp-signature, inline)]
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.