0005-src-util-futex.h-fix-build-on-32-bit-architectures-u.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From e501b7c17ada9c694d3f8302622b78d733485b38 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 21 Aug 2021 17:55:33 +0200
  4. Subject: [PATCH] src/util/futex.h: fix build on 32-bit architectures using
  5. 64-bit time_t
  6. Fix the following build failure on 32-bit architectures using 64-bit
  7. time_t (e.g. riscv32):
  8. ../src/util/futex.h: In function 'sys_futex':
  9. ../src/util/futex.h:39:19: error: 'SYS_futex' undeclared (first use in this function); did you mean 'sys_futex'?
  10. 39 | return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
  11. | ^~~~~~~~~
  12. | sys_futex
  13. Fixes:
  14. - http://autobuild.buildroot.org/results/692700a5f967760a0b8cd358b1712f1d5a7b681e
  15. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  16. [Upstream status:
  17. https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12496]
  18. ---
  19. src/util/futex.h | 4 ++++
  20. 1 file changed, 4 insertions(+)
  21. diff --git a/src/util/futex.h b/src/util/futex.h
  22. index 43097f4cd5b..221eda9db0c 100644
  23. --- a/src/util/futex.h
  24. +++ b/src/util/futex.h
  25. @@ -34,6 +34,10 @@
  26. #include <sys/syscall.h>
  27. #include <sys/time.h>
  28. +#ifndef SYS_futex
  29. +#define SYS_futex SYS_futex_time64
  30. +#endif
  31. +
  32. static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
  33. {
  34. return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
  35. --
  36. 2.32.0