summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-02-13 13:04:19 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-15 10:20:44 +0000
commit840d55a4bf8e908e2b2841496232ffa7c00799e4 (patch)
tree33fbb775949f2000d7c4b2d1b2444ea8b2b5d0e7
parent216e5b0e450c7b3f6f096c2892256e1bc1ec4781 (diff)
downloadopenembedded-core-840d55a4bf8e908e2b2841496232ffa7c00799e4.tar.gz
gstreamer1.0-plugins-good: Fix build with musl
musl's definition of ioctl() API is different from glibc's and gst has built upon definition from glibc which was being warned about but now compilers can check signatures of funciton pointers, means it becomes an error with clang16+ Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2-Define-ioctl_req_t-for-posix-linux-case.patch40
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.0.bb2
2 files changed, 41 insertions, 1 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2-Define-ioctl_req_t-for-posix-linux-case.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2-Define-ioctl_req_t-for-posix-linux-case.patch
new file mode 100644
index 0000000000..fbbf029a2c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-v4l2-Define-ioctl_req_t-for-posix-linux-case.patch
@@ -0,0 +1,40 @@
+From 5ce1e410965ed047a03c09b17796162f0363e396 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Feb 2023 12:47:31 -0800
+Subject: [PATCH] v4l2: Define ioctl_req_t for posix/linux case
+
+this is an issue seen with musl based linux distros e.g. alpine [1]
+musl is not going to change this since it breaks ABI/API interfaces
+Newer compilers are stringent ( e.g. clang16 ) which can now detect
+signature mismatches in function pointers too, existing code warned but
+did not error with older clang
+
+Fixes
+gstv4l2object.c:544:23: error: incompatible function pointer types assigning to 'gint (*)(gint, ioctl_req_t, ...)' (aka 'int (*)(int, unsigned long, ...)') from 'int (int, int, ...)' [-Wincompatible-function-pointer-types]
+ v4l2object->ioctl = ioctl;
+ ^ ~~~~~
+
+[1] https://gitlab.alpinelinux.org/alpine/aports/-/issues/7580
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3950]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sys/v4l2/gstv4l2object.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h
+index 3a5c961..4f43008 100644
+--- a/sys/v4l2/gstv4l2object.h
++++ b/sys/v4l2/gstv4l2object.h
+@@ -76,6 +76,8 @@ typedef gboolean (*GstV4l2UpdateFpsFunction) (GstV4l2Object * v4l2object);
+ * 'unsigned long' for the 2nd parameter */
+ #ifdef __ANDROID__
+ typedef unsigned ioctl_req_t;
++#elif defined(__linux__) && !defined(__GLIBC__) /* musl/linux */
++typedef int ioctl_req_t;
+ #else
+ typedef gulong ioctl_req_t;
+ #endif
+--
+2.39.1
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.0.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.0.bb
index 85f8a247b1..ef4d82c598 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.0.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.22.0.bb
@@ -6,7 +6,7 @@ BUGTRACKER = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues
SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \
file://0001-qt-include-ext-qt-gstqtgl.h-instead-of-gst-gl-gstglf.patch \
- "
+ file://0001-v4l2-Define-ioctl_req_t-for-posix-linux-case.patch"
SRC_URI[sha256sum] = "582e617271e7f314d1a2211e3e3856ae2e4303c8c0d6114e9c4a5ea5719294b0"