summaryrefslogtreecommitdiffstats
path: root/meta-multimedia
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-11-16 12:20:03 -0800
committerKhem Raj <raj.khem@gmail.com>2020-11-16 17:13:06 -0800
commitc9ed5424d983820326a2e7b70ad37541d6073cf1 (patch)
tree8b07631b55fa2f69b6513dbecac59dc65af07188 /meta-multimedia
parent2eedfe50017fa30110e2c3564ec2e20f9ef1f6e3 (diff)
downloadmeta-openembedded-c9ed5424d983820326a2e7b70ad37541d6073cf1.tar.gz
vlc: Fix build on riscv32
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia')
-rw-r--r--meta-multimedia/recipes-multimedia/vlc/vlc/0001-linux-thread-Use-SYS_futex-instead-of-__NR_futex.patch46
-rw-r--r--meta-multimedia/recipes-multimedia/vlc/vlc_3.0.11.1.bb2
2 files changed, 48 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/vlc/vlc/0001-linux-thread-Use-SYS_futex-instead-of-__NR_futex.patch b/meta-multimedia/recipes-multimedia/vlc/vlc/0001-linux-thread-Use-SYS_futex-instead-of-__NR_futex.patch
new file mode 100644
index 000000000..405490dcf
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/vlc/vlc/0001-linux-thread-Use-SYS_futex-instead-of-__NR_futex.patch
@@ -0,0 +1,46 @@
1From f7957c35654222e5bd1038341612bbb40a88e98b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 16 Nov 2020 12:08:43 -0800
4Subject: [PATCH] linux/thread: Use SYS_futex instead of __NR_futex
5
6SYS_futex it expected from system C library.
7in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex)
8some newer 32bit architectures e.g. riscv32 are using 64bit time_t from
9get go unlike other 32bit architectures in glibc, therefore it wont have
10NR_futex defined but just NR_futex_time64 this aliases it to NR_futex so
11that SYS_futex is then defined for rv32
12
13Upstream-Status: Submitted [https://github.com/videolan/vlc/pull/117]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 src/linux/thread.c | 7 ++++++-
17 1 file changed, 6 insertions(+), 1 deletion(-)
18
19diff --git a/src/linux/thread.c b/src/linux/thread.c
20index 20da296..30639a3 100644
21--- a/src/linux/thread.c
22+++ b/src/linux/thread.c
23@@ -30,6 +30,11 @@
24 #include <sys/syscall.h>
25 #include <linux/futex.h>
26
27+/* 32bit architectures with 64bit time_t do not define __NR_futex syscall */
28+#if !defined(SYS_futex) && defined(SYS_futex_time64)
29+#define SYS_futex SYS_futex_time64
30+#endif
31+
32 #ifndef FUTEX_PRIVATE_FLAG
33 #define FUTEX_WAKE_PRIVATE FUTEX_WAKE
34 #define FUTEX_WAIT_PRIVATE FUTEX_WAIT
35@@ -50,7 +55,7 @@ unsigned long vlc_thread_id(void)
36 static int sys_futex(void *addr, int op, unsigned val,
37 const struct timespec *to, void *addr2, int val3)
38 {
39- return syscall(__NR_futex, addr, op, val, to, addr2, val3);
40+ return syscall(SYS_futex, addr, op, val, to, addr2, val3);
41 }
42
43 static int vlc_futex_wake(void *addr, int nr)
44--
452.29.2
46
diff --git a/meta-multimedia/recipes-multimedia/vlc/vlc_3.0.11.1.bb b/meta-multimedia/recipes-multimedia/vlc/vlc_3.0.11.1.bb
index 44178a10d..7902825f2 100644
--- a/meta-multimedia/recipes-multimedia/vlc/vlc_3.0.11.1.bb
+++ b/meta-multimedia/recipes-multimedia/vlc/vlc_3.0.11.1.bb
@@ -14,6 +14,7 @@ DEPENDS = "coreutils-native fribidi libtool libgcrypt libgcrypt-native \
14 tiff" 14 tiff"
15 15
16LDFLAGS_append_riscv64 = " -latomic" 16LDFLAGS_append_riscv64 = " -latomic"
17LDFLAGS_append_riscv32 = " -latomic"
17 18
18# While this item does not require it, it depends on ffmpeg which does 19# While this item does not require it, it depends on ffmpeg which does
19LICENSE_FLAGS = "commercial" 20LICENSE_FLAGS = "commercial"
@@ -24,6 +25,7 @@ SRC_URI = "http://download.videolan.org/pub/videolan/${BPN}/${PV}/${BP}.tar.xz \
24 file://0003-fix-luaL-checkint.patch \ 25 file://0003-fix-luaL-checkint.patch \
25 file://0004-Use-packageconfig-to-detect-mmal-support.patch \ 26 file://0004-Use-packageconfig-to-detect-mmal-support.patch \
26 file://0005-Fix-build-with-Qt-5.15.patch \ 27 file://0005-Fix-build-with-Qt-5.15.patch \
28 file://0001-linux-thread-Use-SYS_futex-instead-of-__NR_futex.patch \
27" 29"
28SRC_URI[sha256sum] = "189311d28aa814f106a7b3645211ac52c0b3e2b9f4b348de2f63bab3218086b8" 30SRC_URI[sha256sum] = "189311d28aa814f106a7b3645211ac52c0b3e2b9f4b348de2f63bab3218086b8"
29 31