[Buildroot] [git commit branch/2025.02.x] package/libv4l: backport fix jpeg-v9x/gcc-14.x build

Titouan Christophe titouan.christophe at mind.be
Thu Sep 4 11:57:23 UTC 2025


commit: https://git.buildroot.net/buildroot/commit/?id=b3624ce42ed0b3400f37181fd26c0ac517372316
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2025.02.x

This issue seems to caused by gcc-14 (added in 2024.05) which has
become the default version in 2025.08.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/11042295052 (TestZbar)
https://autobuild.buildroot.org/results/e0f/e0fac4a10181139d975c627f22a55d6681547d33

Signed-off-by: Romain Naour <romain.naour at smile.fr>
Signed-off-by: Julien Olivain <ju.o at free.fr>
(cherry picked from commit 37741586af7696985bff7ef398581681fe6e96b9)
Signed-off-by: Titouan Christophe <titouan.christophe at mind.be>
---
 ...rt-fix-jpeg-v9x-gcc-14.x-compile-jpeg_mem.patch | 83 ++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/package/libv4l/0002-libv4lconvert-fix-jpeg-v9x-gcc-14.x-compile-jpeg_mem.patch b/package/libv4l/0002-libv4lconvert-fix-jpeg-v9x-gcc-14.x-compile-jpeg_mem.patch
new file mode 100644
index 0000000000..298eaaf888
--- /dev/null
+++ b/package/libv4l/0002-libv4lconvert-fix-jpeg-v9x-gcc-14.x-compile-jpeg_mem.patch
@@ -0,0 +1,83 @@
+From 9f0da8467183f9f647bddc4a5b4f01aad930846a Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report at gmx.net>
+Date: Mon, 2 Sep 2024 15:59:53 +0200
+Subject: [PATCH] libv4lconvert: fix jpeg-v9x/gcc-14.x compile (jpeg_mem_dest
+ argument mismatch)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+- fix jpeg_mem_dest pointer arument mismatch (long unsigned int vs. size_t)
+  with jpeg-v9x/gcc-14.x 32-bit arm compile
+
+Fixes:
+
+  ../lib/libv4lconvert/jl2005bcd.c: In function ‘v4lconvert_decode_jl2005bcd’:
+  ../lib/libv4lconvert/jl2005bcd.c:94:46: error: passing argument 3 of ‘jpeg_mem_dest’ from incompatible pointer type [-Wincompatible-pointer-types]
+     94 |         jpeg_mem_dest (&cinfo, &jpeg_header, &jpeg_header_size);
+        |                                              ^~~~~~~~~~~~~~~~~
+        |                                              |
+        |                                              long unsigned int *
+  In file included from ../lib/libv4lconvert/libv4lconvert-priv.h:26,
+                   from ../lib/libv4lconvert/jl2005bcd.c:30:
+  .../host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/jpeglib.h:979:28: note: expected ‘size_t *’ {aka ‘unsigned int *’} but argument is of type ‘long unsigned int *’
+    979 | EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
+        |                            ^~~
+
+  ../lib/libv4lconvert/jpeg.c: In function ‘init_libjpeg_cinfo’:
+  ../lib/libv4lconvert/jpeg.c:157:45: error: passing argument 3 of ‘jpeg_mem_dest’ from incompatible pointer type [-Wincompatible-pointer-types]
+    157 |         jpeg_mem_dest(&cinfo, &jpeg_header, &jpeg_header_size);
+        |                                             ^~~~~~~~~~~~~~~~~
+        |                                             |
+        |                                             long unsigned int *
+  In file included from ../lib/libv4lconvert/libv4lconvert-priv.h:26,
+                   from ../lib/libv4lconvert/jpeg.c:21:
+  .../host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/jpeglib.h:979:28: note: expected ‘size_t *’ {aka ‘unsigned int *’} but argument is of type ‘long unsigned int *’
+    979 | EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
+        |                            ^~~
+
+Signed-off-by: Peter Seiderer <ps.report at gmx.net>
+Signed-off-by: Hans Verkuil <hverkuil at xs4all.nl>
+Upstream: https://git.linuxtv.org/v4l-utils.git/commit/?id=e11e10ff7c8a4ef69526edd275c0ed92a450fbf3
+[Romain: backport to 1.28.1]
+Signed-off-by: Romain Naour <romain.naour at smile.fr>
+---
+ lib/libv4lconvert/jl2005bcd.c | 4 ++++
+ lib/libv4lconvert/jpeg.c      | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/lib/libv4lconvert/jl2005bcd.c b/lib/libv4lconvert/jl2005bcd.c
+index 707c3205..14b040f3 100644
+--- a/lib/libv4lconvert/jl2005bcd.c
++++ b/lib/libv4lconvert/jl2005bcd.c
+@@ -63,7 +63,11 @@ int v4lconvert_decode_jl2005bcd(struct v4lconvert_data *data,
+ 	struct jpeg_decompress_struct dinfo;
+ 	struct jpeg_error_mgr jcerr, jderr;
+ 	JOCTET *jpeg_header = NULL;
++#if JPEG_LIB_VERSION >= 90
++	size_t jpeg_header_size = 0;
++#else
+ 	unsigned long jpeg_header_size = 0;
++#endif
+ 	int i, x, y, x1, y1, jpeg_data_size, jpeg_data_idx, eoi, size;
+ 
+ 	/* src_size had better be bigger than 16 */
+diff --git a/lib/libv4lconvert/jpeg.c b/lib/libv4lconvert/jpeg.c
+index ebfc8149..450d0967 100644
+--- a/lib/libv4lconvert/jpeg.c
++++ b/lib/libv4lconvert/jpeg.c
+@@ -136,7 +136,11 @@ static void init_libjpeg_cinfo(struct v4lconvert_data *data)
+ {
+ 	struct jpeg_compress_struct cinfo;
+ 	unsigned char *jpeg_header = NULL;
++#if JPEG_LIB_VERSION >= 90
++	size_t jpeg_header_size = 0;
++#else
+ 	unsigned long jpeg_header_size = 0;
++#endif
+ 
+ 	if (data->cinfo_initialized)
+ 		return;
+-- 
+2.50.1
+


More information about the buildroot mailing list