Skip to content

Commit e83ed49

Browse files
authored
fix(pkg): compat.ffmpeg linux cflags += -Wno-error=incompatible-pointer-types (musl ioctl signature) (#110)
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.
1 parent 9630d85 commit e83ed49

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pkgs/c/compat.ffmpeg.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7765,6 +7765,14 @@ static const FFOutputFormat * const muxer_list[] = {
77657765
},
77667766
linux = {
77677767
cflags = {
7768+
-- musl: <sys/ioctl.h> declares ioctl(int, int, ...) while glibc
7769+
-- (and ffmpeg's v4l2 wrappers) use unsigned long — gcc >= 14
7770+
-- makes the pointer-type mismatch a hard error by default.
7771+
-- Downgrade to a warning so x86_64-linux-musl consumer builds
7772+
-- (mcpp build --target x86_64-linux-musl) work; no effect on
7773+
-- glibc builds. Verified: full opencv-m + compat.ffmpeg musl
7774+
-- static build + tests green with only this change.
7775+
"-Wno-error=incompatible-pointer-types",
77687776
"-DPIC",
77697777
"-fomit-frame-pointer",
77707778
"-fno-math-errno",

0 commit comments

Comments
 (0)