From 1ca1406cc8d4bfc3b069ba8fe8076d04540ea7fa Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Tue, 21 Jul 2026 18:08:07 +0800 Subject: [PATCH] fix(pkg): compat.ffmpeg linux cflags += -Wno-error=incompatible-pointer-types (musl ioctl signature) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- pkgs/c/compat.ffmpeg.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/c/compat.ffmpeg.lua b/pkgs/c/compat.ffmpeg.lua index 711ab1a..3f1cd71 100644 --- a/pkgs/c/compat.ffmpeg.lua +++ b/pkgs/c/compat.ffmpeg.lua @@ -7765,6 +7765,14 @@ static const FFOutputFormat * const muxer_list[] = { }, linux = { cflags = { + -- musl: declares ioctl(int, int, ...) while glibc + -- (and ffmpeg's v4l2 wrappers) use unsigned long — gcc >= 14 + -- makes the pointer-type mismatch a hard error by default. + -- Downgrade to a warning so x86_64-linux-musl consumer builds + -- (mcpp build --target x86_64-linux-musl) work; no effect on + -- glibc builds. Verified: full opencv-m + compat.ffmpeg musl + -- static build + tests green with only this change. + "-Wno-error=incompatible-pointer-types", "-DPIC", "-fomit-frame-pointer", "-fno-math-errno",