Bug #262
Spinlock Not Compiling During Install
Description
While trying to install strongswan, the make install script fails when trying to compile src/libstrongswan/testing/spinlock.c. I receive the following errors before the script fails:
threading/spinlock.c:47: error: expected specifier-qualifier-list before 'pthread_spinlock_t'
threading/spinlock.c: In function 'lock':
threading/spinlock.c:71: warning: implicit declaration of function 'pthread_spin_lock'
threading/spinlock.c:71: error: 'private_spinlock_t' has no member named 'spinlock'
threading/spinlock.c: In function 'unlock':
threading/spinlock.c:88: warning: implicit declaration of function 'pthread_spin_unlock'
threading/spinlock.c:88: error: 'private_spinlock_t' has no member named 'spinlock'
threading/spinlock.c: In function 'destroy':
threading/spinlock.c:103: warning: implicit declaration of function 'pthread_spin_destroy'
threading/spinlock.c:103: error: 'private_spinlock_t' has no member named 'spinlock'
threading/spinlock.c: In function 'spinlock_create':
threading/spinlock.c:126: warning: implicit declaration of function 'pthread_spin_init'
threading/spinlock.c:126: error: 'private_spinlock_t' has no member named 'spinlock'
History
#1 Updated by Martin Willi almost 13 years ago
- Category set to libstrongswan
- Status changed from New to Assigned
- Assignee set to Martin Willi
There was a bug in 5.0.0 where the fallback to a mutex didn't work if spinlocks are not available. Are you in fact using 5.0.1? The bug has been fixed in this release.
What C library are you using? What's the output of:
find /usr/include/ | xargs grep _POSIX_SPIN_LOCKS
#2 Updated by Sean J almost 13 years ago
Thanks for the quick response. I confirmed that I am using 5.0.1. I am using glibc (libc6 on Debian), package version is 2.3.6.ds1-8. The output is as follows:
user@host:/# find /usr/include/ | xargs grep _POSIX_SPIN_LOCKS
grep: /usr/include/asm/proc: No such file or directory
/usr/include/bits/posix_opt.h:#define _POSIX_SPIN_LOCKS 200112L
#3 Updated by Martin Willi over 12 years ago
Seems that _POSIX_SPIN_LOCKS is defined on your system, but spinlocks are actually not available.
I pushed a patch [1] that uses a ./configure check instead, that should work more reliably. After applying the patch, you'll need autoconf and friends to update the build system.
Please let me know if this works for you, I'll then push the patch to master.
[1]http://git.strongswan.org/?p=strongswan.git;a=commitdiff;h=12863b35
#4 Updated by Martin Willi over 12 years ago
- Status changed from Assigned to Closed
- Target version set to 5.0.2