0001-configure.ac-check-if-libatomic-is-needed.patch 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. From f020fe05a20dfcd16cd7df833dcf3cdeef770538 Mon Sep 17 00:00:00 2001
  2. From: Carlos Santos <casantos@datacom.ind.br>
  3. Date: Thu, 11 Feb 2016 10:58:35 -0200
  4. Subject: [PATCH 2/2] configure.ac: check if libatomic is needed
  5. Compilation of protobuf for PowerPC and SPARC may fail due to missing
  6. references to __atomic_fetch_add_4 and __atomic_compare_exchange_4.
  7. The __atomic_*() intrinsics for all sizes are provided by libatomic when
  8. gcc is >= 4.8. This can be achieved by adding this to configure.ac:
  9. AC_SEARCH_LIBS([__atomic_fetch_add_4], [atomic])
  10. Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
  11. ---
  12. configure.ac | 2 ++
  13. 1 file changed, 2 insertions(+)
  14. diff --git a/configure.ac b/configure.ac
  15. index c07067c..88d4a0d 100644
  16. --- a/configure.ac
  17. +++ b/configure.ac
  18. @@ -160,6 +160,8 @@ AM_CONDITIONAL([HAVE_PTHREAD], [test "x$acx_pthread_ok" = "xyes"])
  19. # We still keep this for improving pbconfig.h for unsupported platforms.
  20. AC_CXX_STL_HASH
  21. +AC_SEARCH_LIBS([__atomic_load_4], [atomic])
  22. +
  23. case "$target_os" in
  24. mingw* | cygwin* | win*)
  25. ;;
  26. --
  27. 2.5.0