![Fabrice Fontaine](/assets/img/avatar_default.png)
uclibc on m68k defines pthread_spinlock_t but does not define pthread_spin_trylock so check for this function before using it Fixes: - http://autobuild.buildroot.org/results/0a6de11c030a4f39e402917809fc6d33fb463d1b Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
52 lines
1.6 KiB
Diff
52 lines
1.6 KiB
Diff
From 98bd6106f8c48bc8f0a27bd712ed4ba6249e9a5f Mon Sep 17 00:00:00 2001
|
|
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
Date: Sun, 13 Jan 2019 11:03:51 +0100
|
|
Subject: [PATCH] fix build on m68k with uclibc
|
|
|
|
uclibc on m68k defines pthread_spinlock_t but does not define
|
|
pthread_spin_trylock so check for this function before using it
|
|
|
|
Fixes:
|
|
- http://autobuild.buildroot.org/results/0a6de11c030a4f39e402917809fc6d33fb463d1b
|
|
|
|
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
[Upstream status: https://github.com/buytenh/ivykis/pull/17]
|
|
---
|
|
configure.ac | 3 +++
|
|
src/spinlock.h | 4 ++++
|
|
2 files changed, 7 insertions(+)
|
|
|
|
diff --git a/lib/ivykis/configure.ac b/lib/ivykis/configure.ac
|
|
index e9b10c0..24152a9 100644
|
|
--- a/lib/ivykis/configure.ac
|
|
+++ b/lib/ivykis/configure.ac
|
|
@@ -110,6 +110,9 @@ AC_CACHE_CHECK(for linux/netfilter_ipv4.h, ac_cv_header_linux_netfilter_ipv4_h,
|
|
# Check for pthread_spinlock_t.
|
|
AC_CHECK_TYPES([pthread_spinlock_t], [], [], [[#include <pthread.h>]])
|
|
|
|
+# Check for pthread_spin_trylock
|
|
+AC_CHECK_FUNCS([pthread_spin_trylock])
|
|
+
|
|
# Check which header file defines 'struct timespec'.
|
|
for hdr in sys/time.h sys/timers.h time.h pthread.h
|
|
do
|
|
diff --git a/lib/ivykis/src/spinlock.h b/lib/ivykis/src/spinlock.h
|
|
index ebcdbec..d837df8 100644
|
|
--- a/lib/ivykis/src/spinlock.h
|
|
+++ b/lib/ivykis/src/spinlock.h
|
|
@@ -76,7 +76,11 @@ static inline void fallback_spin_unlock(fallback_spinlock_t *lock)
|
|
|
|
static inline int pthread_spinlocks_available(void)
|
|
{
|
|
+#ifdef HAVE_PTHREAD_SPIN_TRYLOCK
|
|
return !!(pthread_spin_trylock != NULL);
|
|
+#else
|
|
+ return 0;
|
|
+#endif
|
|
}
|
|
|
|
|
|
--
|
|
2.14.1
|
|
|