Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 948657

Summary: media-plugins/gst-plugins-v4l2-1.24.11: incompatible function pointer types v4l2object->ioctl = v4l2_ioctl, on musl/llvm (needs media-libs/libv4l patching too)
Product: Gentoo Linux Reporter: Bryce Copeland <truffle074>
Component: Current packagesAssignee: GStreamer package maintainers <gstreamer>
Status: UNCONFIRMED ---    
Severity: normal CC: chewi, truffle074
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=896418
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
emerge --info
media-libs/libv4l fix from upstream
add have_posix_ioctl to gst-plugins-v4l2

Description Bryce Copeland 2025-01-24 14:31:17 UTC
Created attachment 917399 [details]
build.log

media-plugins/gst-plugins-v4l2-1.24.11 fails to compile on musl clang because of an incompatible pointer type error

this is similar to https://bugs.gentoo.org/show_bug.cgi?id=896418, but affects a different pointer.

Looks like the issue stems from the fact that musl defines the ioctl function as "int ioctl(int, int, ...)", compared to glibc's "int ioctl(int, unsigned long, ...)

the issue on 896418 has been fixed upstream in the current stable version, however this new error seems to trace back a struct in <libv4l2.h>, provided by media-libs/libv4l, rather than gst-plugins itself

I've checked and there is currently an upstream fix, but it is newer than the current stable version 1.28.1, and relies on HAS_POSIX_IOCTL being defined:
https://git.linuxtv.org/v4l-utils.git/commit/?id=fd882f9e77b13cbc6a669e6836c3943393b44152

applying the commit as a patch doesn't fix the issue, but additionally adding a "#define HAVE_POSIX_IOCTL" to gst-plugins-good just before it "#include <libv4l2.h>" fixed the issue on mine

(I also experimented with just typecasting the function pointer, but that felt a bit too hacky)
Comment 1 Bryce Copeland 2025-01-24 14:31:42 UTC
Created attachment 917400 [details]
emerge --info
Comment 2 Bryce Copeland 2025-01-24 14:32:58 UTC
Created attachment 917401 [details, diff]
media-libs/libv4l fix from upstream
Comment 3 Bryce Copeland 2025-01-24 14:34:26 UTC
Created attachment 917402 [details, diff]
add have_posix_ioctl to gst-plugins-v4l2