summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2021-04-07 16:08:24 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-18 11:37:25 +0100
commit8cf34c351772245f4f86c8b00cff3340ffef8e4e (patch)
treeda4ab9abaff92ba887e3bfd91ca2d297e171d77a /meta/recipes-graphics
parent91aa85099815eead5a6ac5f89ce1f97188aa5f28 (diff)
downloadpoky-8cf34c351772245f4f86c8b00cff3340ffef8e4e.tar.gz
libxshmfence: Build fixes for riscv32
NR_futex is not defined by newer architectures e.g. riscv32 as they only have 64bit variant of time_t. Glibc defines SYS_futex interface based on __NR_futex, since this is used in applications, such applications start to fail to build for these newer architectures. Define a fallback to alias __NR_futex to __NR_futex_time64 to make SYS_futex keep working. Reference: https://git.openembedded.org/openembedded-core/commit/?id=7a218adf9990f5e18d0b6a33eb34091969f979c7 (From OE-Core rev: 81599bf32135187b34726d41e9f619d22ca1bdd1) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r--meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch39
-rw-r--r--meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb4
2 files changed, 42 insertions, 1 deletions
diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch b/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
new file mode 100644
index 0000000000..3e87794d20
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
@@ -0,0 +1,39 @@
1From 5827f6389a227157958d14a687fb29223cb3a03a Mon Sep 17 00:00:00 2001
2From: Mingli Yu <mingli.yu@windriver.com>
3Date: Wed, 7 Apr 2021 07:48:42 +0000
4Subject: [PATCH] xshmfence_futex.h: Define SYS_futex if it does not exist
5
6_NR_futex is not defines by newer architectures e.g. riscv32 as
7they only have 64bit variant of time_t. Glibc defines SYS_futex
8interface based on __NR_futex, since this is used in applications,
9such applications start to fail to build for these newer architectures.
10This patch defines a fallback to alias __NR_futex to __NR_futex_time64
11to make SYS_futex keep working.
12
13Reference: https://git.openembedded.org/openembedded-core/commit/?id=7a218adf9990f5e18d0b6a33eb34091969f979c7
14
15Upstream-Status: Pending
16
17Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
18---
19 src/xshmfence_futex.h | 4 ++++
20 1 file changed, 4 insertions(+)
21
22diff --git a/src/xshmfence_futex.h b/src/xshmfence_futex.h
23index 673ac0e..a71efa5 100644
24--- a/src/xshmfence_futex.h
25+++ b/src/xshmfence_futex.h
26@@ -53,6 +53,10 @@ static inline int futex_wait(int32_t *addr, int32_t value) {
27 #include <sys/time.h>
28 #include <sys/syscall.h>
29
30+#if !defined(SYS_futex) && defined(SYS_futex_time64)
31+#define SYS_futex SYS_futex_time64
32+#endif
33+
34 static inline long sys_futex(void *addr1, int op, int val1, struct timespec *timeout, void *addr2, int val3)
35 {
36 return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
37--
382.29.2
39
diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb b/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
index cc45696530..d153c7a603 100644
--- a/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
+++ b/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
@@ -13,7 +13,9 @@ DEPENDS += "virtual/libx11"
13 13
14EXTRA_OECONF += "--with-shared-memory-dir=/dev/shm" 14EXTRA_OECONF += "--with-shared-memory-dir=/dev/shm"
15 15
16BBCLASSEXTEND = "native nativesdk" 16SRC_URI += "file://0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch"
17 17
18SRC_URI[md5sum] = "42dda8016943dc12aff2c03a036e0937" 18SRC_URI[md5sum] = "42dda8016943dc12aff2c03a036e0937"
19SRC_URI[sha256sum] = "b884300d26a14961a076fbebc762a39831cb75f92bed5ccf9836345b459220c7" 19SRC_URI[sha256sum] = "b884300d26a14961a076fbebc762a39831cb75f92bed5ccf9836345b459220c7"
20
21BBCLASSEXTEND = "native nativesdk"