Skip to content

fix(pkg): compat.ffmpeg — allow musl consumer builds (ioctl signature vs gcc>=14 default error)#110

Merged
Sunrisepeak merged 1 commit into
mainfrom
fix/compat-ffmpeg-musl-ioctl
Jul 21, 2026
Merged

fix(pkg): compat.ffmpeg — allow musl consumer builds (ioctl signature vs gcc>=14 default error)#110
Sunrisepeak merged 1 commit into
mainfrom
fix/compat-ffmpeg-musl-ioctl

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

One-line (plus comment) fix: add -Wno-error=incompatible-pointer-types to compat.ffmpeg's linux cflags.

Why: musl declares ioctl(int, int, ...) while glibc (and ffmpeg's v4l2 wrapper table) uses unsigned long. gcc >= 14 turns the resulting pointer-type mismatch in libavdevice/v4l2.c (SET_WRAPPERS) into a hard error, so any consumer doing mcpp build --target x86_64-linux-musl --static fails in the dep. -w does not help (this is a default-error, not a warning).

Scope: linux block only; glibc builds see no behavior change (diagnostic downgraded to the warning it was before gcc 14). Runtime is correct on both ABIs — v4l2 request values fit in int.

Verified (mcpp 0.0.101, gcc-musl 16.1.0, x86_64): with only this change, a full --target x86_64-linux-musl --static build of compat.ffmpeg (2282 TU) + the opencv single-repo package links statically and passes all 6 opencv-m suites including the FFmpeg mp4 videoio roundtrip.

…er-types (musl ioctl signature)

musl declares ioctl(int, int, ...) where glibc uses unsigned long, so
libavdevice/v4l2.c's SET_WRAPPERS assignment trips gcc>=14's
incompatible-pointer-types default error when a consumer cross-builds for
x86_64-linux-musl (mcpp build --target x86_64-linux-musl --static). One
flag, linux block only, downgrades it back to a warning; glibc builds are
unaffected (the code is correct for either ABI at runtime — v4l2 request
values fit in int).

Verified locally on mcpp 0.0.101 / gcc-musl 16.1.0: full compat.ffmpeg
(2282 TU) + opencv single-repo build, static link, 6/6 opencv-m tests
incl. FFmpeg mp4 videoio roundtrip.
@Sunrisepeak
Sunrisepeak merged commit e83ed49 into main Jul 21, 2026
5 checks passed
@Sunrisepeak
Sunrisepeak deleted the fix/compat-ffmpeg-musl-ioctl branch July 21, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant