fix(pkg): compat.ffmpeg — allow musl consumer builds (ioctl signature vs gcc>=14 default error)#110
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One-line (plus comment) fix: add
-Wno-error=incompatible-pointer-typesto compat.ffmpeg's linux cflags.Why: musl declares
ioctl(int, int, ...)while glibc (and ffmpeg's v4l2 wrapper table) usesunsigned long. gcc >= 14 turns the resulting pointer-type mismatch inlibavdevice/v4l2.c(SET_WRAPPERS) into a hard error, so any consumer doingmcpp build --target x86_64-linux-musl --staticfails in the dep.-wdoes 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 --staticbuild 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.