Skip to content

Commit

Permalink
mesa,libxshmfence: Define __NR_futex for rv32
Browse files Browse the repository at this point in the history
Helps these nosy apps build
Fixes riscv#201

Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
kraj committed Jan 31, 2020
1 parent 687750d commit 9f0457d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
13 changes: 13 additions & 0 deletions recipes-graphics/mesa/mesa/rv32-sys-futex.patch
Original file line number Diff line number Diff line change
@@ -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>
3 changes: 3 additions & 0 deletions recipes-graphics/mesa/mesa_19.%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI_append_riscv32 = " file://rv32-sys-futex.patch"
13 changes: 13 additions & 0 deletions recipes-graphics/xorg-lib/libxshmfence/rv32_sys_futex.patch
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 4 additions & 0 deletions recipes-graphics/xorg-lib/libxshmfence_1.3.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI_append_riscv32 = " file://rv32_sys_futex.patch"

0 comments on commit 9f0457d

Please sign in to comment.