mesa,libxshmfence: Define __NR_futex for rv32

Helps these nosy apps build
Fixes #201

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2020-01-30 16:57:50 -08:00
parent 687750d761
commit 8b73b069b0
4 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
--- a/src/util/futex.h
+++ b/src/util/futex.h
@@ -26,6 +26,10 @@
#if defined(HAVE_LINUX_FUTEX_H)
+#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32
+# define __NR_futex __NR_futex_time64
+#endif
+
#include <limits.h>
#include <stdint.h>
#include <unistd.h>

View File

@@ -0,0 +1,3 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append_riscv32 = " file://rv32-sys-futex.patch"

View File

@@ -0,0 +1,13 @@
--- a/src/xshmfence_futex.h
+++ b/src/xshmfence_futex.h
@@ -47,6 +47,10 @@ static inline int futex_wait(int32_t *ad
#else
+#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32
+# define __NR_futex __NR_futex_time64
+#endif
+
#include <stdint.h>
#include <values.h>
#include <linux/futex.h>

View File

@@ -0,0 +1,4 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append_riscv32 = " file://rv32_sys_futex.patch"