Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948657 - 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)
Summary: media-plugins/gst-plugins-v4l2-1.24.11: incompatible function pointer types v...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: GStreamer package maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2025-01-24 14:31 UTC by Bryce Copeland
Modified: 2025-01-25 14:02 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,51.03 KB, text/x-log)
2025-01-24 14:31 UTC, Bryce Copeland
Details
emerge --info (emerge-info.log,8.07 KB, text/x-log)
2025-01-24 14:31 UTC, Bryce Copeland
Details
media-libs/libv4l fix from upstream (libv4l-1.28.1-backport-posix-ioctl.patch,1.92 KB, patch)
2025-01-24 14:32 UTC, Bryce Copeland
Details | Diff
add have_posix_ioctl to gst-plugins-v4l2 (have-posix-ioctl.patch,341 bytes, patch)
2025-01-24 14:34 UTC, Bryce Copeland
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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