2
1

0001-fix-build-on-uclibc.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 98bd6106f8c48bc8f0a27bd712ed4ba6249e9a5f Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 13 Jan 2019 11:03:51 +0100
  4. Subject: [PATCH] fix build on m68k with uclibc
  5. uclibc on m68k defines pthread_spinlock_t but does not define
  6. pthread_spin_trylock so check for this function before using it
  7. Fixes:
  8. - http://autobuild.buildroot.org/results/0a6de11c030a4f39e402917809fc6d33fb463d1b
  9. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  10. [Upstream status: https://github.com/buytenh/ivykis/pull/17]
  11. ---
  12. configure.ac | 3 +++
  13. src/spinlock.h | 4 ++++
  14. 2 files changed, 7 insertions(+)
  15. diff --git a/lib/ivykis/configure.ac b/lib/ivykis/configure.ac
  16. index e9b10c0..24152a9 100644
  17. --- a/lib/ivykis/configure.ac
  18. +++ b/lib/ivykis/configure.ac
  19. @@ -110,6 +110,9 @@ AC_CACHE_CHECK(for linux/netfilter_ipv4.h, ac_cv_header_linux_netfilter_ipv4_h,
  20. # Check for pthread_spinlock_t.
  21. AC_CHECK_TYPES([pthread_spinlock_t], [], [], [[#include <pthread.h>]])
  22. +# Check for pthread_spin_trylock
  23. +AC_CHECK_FUNCS([pthread_spin_trylock])
  24. +
  25. # Check which header file defines 'struct timespec'.
  26. for hdr in sys/time.h sys/timers.h time.h pthread.h
  27. do
  28. diff --git a/lib/ivykis/src/spinlock.h b/lib/ivykis/src/spinlock.h
  29. index ebcdbec..d837df8 100644
  30. --- a/lib/ivykis/src/spinlock.h
  31. +++ b/lib/ivykis/src/spinlock.h
  32. @@ -76,7 +76,11 @@ static inline void fallback_spin_unlock(fallback_spinlock_t *lock)
  33. static inline int pthread_spinlocks_available(void)
  34. {
  35. +#ifdef HAVE_PTHREAD_SPIN_TRYLOCK
  36. return !!(pthread_spin_trylock != NULL);
  37. +#else
  38. + return 0;
  39. +#endif
  40. }
  41. --
  42. 2.14.1