summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-10-16 11:30:23 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-20 11:11:46 +0100
commitfbc879c351df6b467bc0309f75657641d868e1ae (patch)
tree8fe5615666b8e81fad392bf731877ce7a69e9d5b
parent8f03a64eddf5a81a303aa9445f876643b46a6146 (diff)
downloadpoky-fbc879c351df6b467bc0309f75657641d868e1ae.tar.gz
mesa: Fix build on 32bit arches supporting 64bit time_t only
Fixes ../mesa-20.1.8/src/util/futex.h:47:19: error: use of undeclared identifier 'SYS_futex'; did you mean 'sys_futex'? return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3); ^~~~~~~~~ sys_futex (From OE-Core rev: 21bdff510a7673ccf7f27f551b641a5ba84d656c) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch31
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc1
2 files changed, 32 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch b/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch
new file mode 100644
index 0000000000..8bedbac669
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch
@@ -0,0 +1,31 @@
1From 8973e297f2f9b17498b9dc0e37a19481d4bb7df9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 16 Oct 2020 11:03:47 -0700
4Subject: [PATCH] futex.h: Define __NR_futex if it does not exist
5
6__NR_futex is not defines by newer architectures e.g. arc, riscv32 as
7they only have 64bit variant of time_t. Glibc defines SYS_futex interface based on
8__NR_futex, since this is used in applications, such applications start
9to fail to build for these newer architectures. This patch defines a
10fallback to alias __NR_futex to __NR_futex_tim64 so SYS_futex keeps
11working
12
13Upstream-Status: Pending
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 src/util/futex.h | 4 ++++
17 1 file changed, 4 insertions(+)
18
19--- a/src/util/futex.h
20+++ b/src/util/futex.h
21@@ -34,6 +34,10 @@
22 #include <sys/syscall.h>
23 #include <sys/time.h>
24
25+#if !defined(SYS_futex) && defined(SYS_futex_time64)
26+# define SYS_futex SYS_futex_time64
27+#endif
28+
29 static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
30 {
31 return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index dd4619a06b..9fc62e95e1 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -21,6 +21,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
21 file://0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch \ 21 file://0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch \
22 file://0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch \ 22 file://0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch \
23 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ 23 file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
24 file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \
24 " 25 "
25 26
26SRC_URI[sha256sum] = "df21351494f7caaec5a3ccc16f14f15512e98d2ecde178bba1d134edc899b961" 27SRC_URI[sha256sum] = "df21351494f7caaec5a3ccc16f14f15512e98d2ecde178bba1d134edc899b961"