0006-Zend-zend_call_stack.c-fix-build-without-pthread.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From c3e37c438a11d59d858fcc7b46eac00a8074972b Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 30 Mar 2024 17:51:55 +0100
  4. Subject: [PATCH] Zend/zend_call_stack.c: fix build without pthread
  5. Fix the following build failure without pthread raised since version
  6. 8.3.0 and
  7. https://github.com/php/php-src/commit/a11c8a30399e90c17c287b9656c0077bc5131c9c:
  8. /home/buildroot/instance-0/output-1/build/php-8.3.4/Zend/zend_call_stack.c:39:11: fatal error: pthread.h: No such file or directory
  9. 39 | # include <pthread.h>
  10. | ^~~~~~~~~~~
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/a4ef648a9da50b26ed56d5d490e4cf5a1bfff970
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. Upstream: https://github.com/php/php-src/pull/13843
  15. ---
  16. Zend/zend_call_stack.c | 3 ++-
  17. 1 file changed, 2 insertions(+), 1 deletion(-)
  18. diff --git a/Zend/zend_call_stack.c b/Zend/zend_call_stack.c
  19. index 97cbed9041..97de938a0f 100644
  20. --- a/Zend/zend_call_stack.c
  21. +++ b/Zend/zend_call_stack.c
  22. @@ -35,7 +35,8 @@
  23. # include <sys/types.h>
  24. # endif
  25. #endif /* ZEND_WIN32 */
  26. -#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__)
  27. +#if (defined(HAVE_PTHREAD_GETATTR_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK)) || \
  28. + defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__)
  29. # include <pthread.h>
  30. #endif
  31. #ifdef __FreeBSD__
  32. --
  33. 2.43.0