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