0001-configure.ac-fix-build-without-threads.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 77c89f62f106d88ef2b5963f4a13755c337c793d Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 15 Feb 2021 07:56:29 +0100
  4. Subject: [PATCH] configure.ac: fix build without threads
  5. Cross-compilation of libgpg-error fails on toolchain without threads
  6. since commit 988211d3d4c1f3d5cfa6b460210f65ab636763b5,
  7. 9ee011259f819a3cf50fe7019fa4366dbc437e0e and
  8. 50e62b36ea01ed25d12c443088b85d4f41a2b3e1
  9. Indeed, since that time, libgpg-error assumes that pthread.h is always
  10. available resulting in the following error at configure time:
  11. checking for arm-unknown-linux-gnueabi-objdump... (cached) /tmp/instance-1/output-1/host/bin/arm-linux-objdump
  12. conftest.c:1:10: fatal error: pthread.h: No such file or directory
  13. 1 | #include <pthread.h>
  14. | ^~~~~~~~~~~
  15. compilation terminated.
  16. configure: generated src/lock-obj-pub.native.h using arm-unknown-linux-gnueabi-objdump and gawk
  17. checking whether to enable log_clock... no
  18. This error will in turn results in a build failure because
  19. "Can't determine mutex size" is echoed by gen-lock-obj.sh:
  20. In file included from strsource-sym.c:27:
  21. ./gpg-error.h:1115:4: warning: missing terminating ' character
  22. 1115 | Can't determine mutex size
  23. | ^
  24. Full build log:
  25. http://autobuild.buildroot.org/results/334/3344c96e5627a9327b0eabe0b27f34490bbabc0d/build-end.log
  26. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  27. [Upstream status: https://dev.gnupg.org/T5296]
  28. ---
  29. configure.ac | 2 +-
  30. 1 file changed, 1 insertion(+), 1 deletion(-)
  31. diff --git a/configure.ac b/configure.ac
  32. index b9a2a3e..15d9fdc 100644
  33. --- a/configure.ac
  34. +++ b/configure.ac
  35. @@ -599,7 +599,7 @@ if test x$cross_compiling = xyes; then
  36. case $host in
  37. *-*-linux*)
  38. AC_CHECK_TOOL(OBJDUMP, [objdump])
  39. - if test -n "$OBJDUMP"; then
  40. + if test -n "$OBJDUMP" -a x"$gl_use_threads" != xno; then
  41. lock_obj_h_generated=yes
  42. if test ! -d src; then mkdir src; fi
  43. LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
  44. --
  45. 2.30.0