Ver código fonte

directfb: Fix build on riscv32

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Khem Raj 3 anos atrás
pai
commit
57e7a27620

+ 1 - 0
meta-oe/recipes-graphics/directfb/directfb.inc

@@ -22,6 +22,7 @@ SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/DirectFB-${PV}.tar.g
            file://fix-client-gfx_state-initialisation.patch \
            file://fix-tslib-version-check.patch \
            file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \
+           file://0001-os-linux-Fix-build-when-__NR_futex-is-not-available.patch \
            "
 
 S = "${WORKDIR}/DirectFB-${PV}"

+ 54 - 0
meta-oe/recipes-graphics/directfb/directfb/0001-os-linux-Fix-build-when-__NR_futex-is-not-available.patch

@@ -0,0 +1,54 @@
+From 7df69c3a784ab2cc4770bdb366cf788cdb78099a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 15 Nov 2020 12:30:41 -0800
+Subject: [PATCH] os/linux: Fix build when __NR_futex is not available
+
+Newer architectures like riscv32 do not define __NR_futex intentionally
+since it uses 64bit time_t from very beginning, therefore only caters to
+futex_time64 syscall
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/direct/os/linux/glibc/system.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/lib/direct/os/linux/glibc/system.c b/lib/direct/os/linux/glibc/system.c
+index 373a711..d027a70 100644
+--- a/lib/direct/os/linux/glibc/system.c
++++ b/lib/direct/os/linux/glibc/system.c
+@@ -36,6 +36,7 @@
+ 
+ #include <errno.h>
+ #include <signal.h>
++#include <sys/syscall.h>
+ #include <unistd.h>
+ 
+ #include <linux/unistd.h>
+@@ -46,6 +47,10 @@
+ #include <direct/system.h>
+ #include <direct/util.h>
+ 
++#if !defined(SYS_futex) && defined(SYS_futex_time64)
++# define SYS_futex SYS_futex_time64
++#endif
++
+ D_LOG_DOMAIN( Direct_Futex, "Direct/Futex", "Direct Futex" );
+ D_LOG_DOMAIN( Direct_Trap,  "Direct/Trap",  "Direct Trap" );
+ 
+@@ -239,10 +244,9 @@ direct_futex( int *uaddr, int op, int val, const struct timespec *timeout, int *
+      }
+ #endif
+ 
+-     ret = syscall( __NR_futex, uaddr, op, val, timeout, uaddr2, val3 );
++     ret = syscall( SYS_futex, uaddr, op, val, timeout, uaddr2, val3 );
+      if (ret < 0)
+           return errno2result( errno );
+ 
+      return DR_OK;
+ }
+-
+-- 
+2.29.2
+