Skip to contentSkip to conversation

gstreamer: Fix build on 32bit arches with 64bit time_t

PATCH New Khem Raj 1 participant 1 message Nov 4, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 gstreamer: Fix build on 32bit arches with 64bit time_t

Fixes

| ../gstreamer-1.18.1/gst/gstsystemclock.c:330:1: error: static_assert failed due to requirement 'size of(struct _GstClockEntryPThread) <= sizeof(struct _GstClockEntryImpl)' "Expression evaluates to false"
| G_STATIC_ASSERT (sizeof (GstClockEntryImpl) <= | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---
 ...crese-padding-in-struct-_GstClockEnt.patch | 34 +++++++++++++++++++
 .../gstreamer/gstreamer1.0_1.18.1.bb          |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst_private.h-increse-padding-in-struct-_GstClockEnt.patch
meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst_private.h-increse-padding-in-struct-_GstClockEnt.patch new file +34 -0
new file mode 100644
index 0000000000..a2d215d72d
@@ -0,0 +1,34 @@
+From 4449246a8d788e71dfe4679fba95955cec5894c1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 3 Nov 2020 22:58:26 -0800
+Subject: [PATCH] gst_private.h: increse padding in struct _GstClockEntryImpl
+
+When compiling for 32bit architectures with 64bit time_t e.g. riscv32,
+the static assert that the GstClockEntryImpl smaller or
+equal to the struct _GstClockEntryImpl triggered.
+(they were 12bytes off).
+
+To fix this, the padding is increased by 8 bytes (on 32bit).
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/694]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ gst/gst_private.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst/gst_private.h b/gst/gst_private.h
+index a8897e1..8252ede 100644
+--- a/gst/gst_private.h
++++ b/gst/gst_private.h
+@@ -522,7 +522,7 @@ struct _GstClockEntryImpl
+   GstClockEntry entry;
+   GWeakRef clock;
+   GDestroyNotify destroy_entry;
+-  gpointer padding[19];                 /* padding for allowing e.g. systemclock
++  gpointer padding[21];                 /* padding for allowing e.g. systemclock
+                                          * to add data in lieu of overridable
+                                          * virtual functions on the clock */
+ };
+-- 
+2.29.2
+
meta/recipes-multimedia/gstreamer/gstreamer1.0_1.18.1.bb +1 -0
index d989eefd97..d55b2871e7 100644
@@ -19,6 +19,7 @@ SRC_URI = "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.x
            file://0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch \
            file://0002-Remove-unused-valgrind-detection.patch \
            file://0003-meson-Add-option-for-installed-tests.patch \
+           file://0001-gst_private.h-increse-padding-in-struct-_GstClockEnt.patch \
            "
 SRC_URI[sha256sum] = "79df8de21f284a105a5c1568527f8c559c583c85c0f2bd7bdb5b0372b8beecba"
 
Signature · 1 line
2.29.2