Trying to update to the latest stable ffmpeg, the package fails to compile. I am using clang-16 and musl libc but I'm not sure if they have an effect. This is the most salient part of the build output: clang -I. -Isrc/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DZLIB_CONST -DHAVE_AV_CONFIG_H -DBUILDING_avdevice -march=haswell -O2 -pipe -fomit-frame-pointer -march=haswell -std=c11 -fPIC -pthread -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/openjpeg-2.5 -I/usr/include/opus -I/usr/include/opus -D_REENTRANT -I/usr/include/librsvg-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -pthread -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/pixman-1 -I/usr/include/svt-av1 -DEB_DLL -DX264_API_IMPORTS -I/usr/include/libxml2 -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -Wno-unused-const-variable -Wno-bool-operation -Wno-char-subscripts -march=haswell -O2 -pipe -fomit-frame-pointer -fno-math-errno -fno-signed-zeros -mstack-alignment=16 -Qunused-arguments -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -MMD -MF libavdevice/v4l2.d -MT libavdevice/v4l2.o -c -o libavdevice/v4l2.o src/libavdevice/v4l2.c src/libavdevice/v4l2.c:133:9: error: incompatible function pointer types assigning to 'int (*)(int, int, ...)' from 'int (int, unsigned long, ...)' [-Wincompatible-function-pointer-types] SET_WRAPPERS(v4l2_); ^~~~~~~~~~~~~~~~~~~ src/libavdevice/v4l2.c:125:17: note: expanded from macro 'SET_WRAPPERS' s->ioctl_f = prefix ## ioctl; \ ^ ~~~~~~~~~~~~~~~ 1 error generated. Reproducible: Always Steps to Reproduce: 1. emerge ffmpeg Actual Results: emerge fails. ffmpeg reports compilation errors. Expected Results: ffmpeg builds and installs without issue. $ emerge -pqv '=media-video/ffmpeg-4.4.4-r3::gentoo' [ebuild U ] media-video/ffmpeg-4.4.4-r3 [4.4.4-r2] USE="alsa bzip2 dav1d encode fdk gnutls gpl iconv jpeg2k libaom libv4l libxml2 lzma mp3 network openssl opus postproc pulseaudio speex svg svt-av1 theora threads truetype v4l vaapi vorbis vpx vulkan webp x264 x265 xvid zlib -X (-amf) -amr -amrenc (-appkit) -bluray -bs2b -cdio -chromaprint -chromium -codec2 -cpudetection (-cuda) -debug -doc -flite -fontconfig -frei0r -fribidi -gcrypt -gme -gmp -gsm -hardcoded-tables -iec61883 -ieee1394 -jack -kvazaar -ladspa -libaribb24 -libass -libcaca -libdrm -libilbc -librtmp -libsoxr -libtesseract -lv2 (-mipsdspr1) (-mipsdspr2) (-mipsfpu) (-mmal) -modplug (-nvenc) -openal -opencl -opengl -openh264 -oss -pic (-qsv) -rav1e -rubberband -samba -sdl -snappy -sndio -srt -ssh -static-libs -test -twolame -vdpau -verify-sig -vidstab (-vmaf) -zeromq -zimg -zvbi" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3 -3dnow -3dnowext -fma4 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher" $ emerge --info '=media-video/ffmpeg-4.4.4-r3::gentoo' Portage 3.0.49 (python 3.11.4-final-0, default/linux/amd64/17.0/musl, gcc-12, musl-1.2.3-r7, 6.1.19-gentoo-njd x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.1.19-gentoo-njd-x86_64-Intel-R-_Core-TM-_i5-4250U_CPU_@_1.30GHz-with-libc KiB Mem: 3963452 total, 142932 free KiB Swap: 4194300 total, 1387904 free Timestamp of repository gentoo: Sun, 30 Jul 2023 13:30:01 +0000 Head commit of repository gentoo: 0b7fe90e6a4f5c33df503f5d2d2ecc0b5bd43cfe Timestamp of repository musl: Thu, 27 Jul 2023 06:46:29 +0000 Head commit of repository musl: 2a06ebc496dd3a6f6ab9892d5c2c434b8293e5a2 sh dash 0.5.12 ld GNU ld (Gentoo 2.40 p5) 2.40.0 app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r6::gentoo dev-lang/perl: 5.36.1-r3::gentoo dev-lang/python: 3.11.4::gentoo dev-lang/rust: 1.69.0-r1::gentoo dev-util/cmake: 3.26.4-r1::gentoo dev-util/meson: 1.1.1::gentoo sys-apps/baselayout: 2.13-r1::gentoo sys-apps/openrc: 0.47.1::gentoo sys-apps/sandbox: 2.37::gentoo sys-devel/autoconf: 2.13-r7::gentoo, 2.71-r6::gentoo sys-devel/automake: 1.16.5-r1::gentoo sys-devel/binutils: 2.40-r5::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 15.0.7-r3::gentoo, 16.0.6::gentoo sys-devel/gcc: 12.3.1_p20230526::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/libtool: 2.4.7-r1::gentoo sys-devel/lld: 15.0.7::gentoo, 16.0.6::gentoo sys-devel/llvm: 15.0.7-r3::gentoo, 16.0.6::gentoo sys-devel/make: 4.4.1-r1::gentoo sys-kernel/linux-headers: 6.1::gentoo (virtual/os-headers) sys-libs/musl: 1.2.3-r7::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 volatile: False sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: --new-compress sync-rsync-verify-max-age: 24 musl location: /var/db/repos/musl sync-type: git sync-uri: https://github.com/gentoo-mirror/musl.git masters: gentoo volatile: False njd location: /var/db/repos/njd masters: gentoo volatile: False ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" AR="llvm-ar" CBUILD="x86_64-gentoo-linux-musl" CC="clang" CFLAGS="-march=haswell -O2 -pipe -fomit-frame-pointer" CHOST="x86_64-gentoo-linux-musl" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXX="clang++" CXXFLAGS="-march=haswell -O2 -pipe -fomit-frame-pointer" DISTDIR="/var/cache/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-march=haswell -O2 -pipe -fomit-frame-pointer" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=haswell -O2 -pipe -fomit-frame-pointer" GENTOO_MIRRORS="http://distfiles.gentoo.org" INSTALL_MASK="charset.alias /usr/share/locale/locale.alias" LANG="en_CA.UTF-8" LDFLAGS="-Wl,--as-needed" LEX="reflex" MAKEOPTS="-j4" NM="llvm-nm" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="--new-compress" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" RANLIB="llvm-ranlib" RUSTFLAGS="-C target-cpu=haswell" SHELL="/bin/zsh" USE="acl alsa amd64 bluetooth brotli bzip2 clang cli colord crypt cxx dbus dri elogind exif fdk ffmpeg flac fortran gif gles2 gles2-only gles3 gstreamer heif iconv icu idn ipv6 jpeg jpeg2k lcms libaom libedit libsamplerate libtirpc lvm lz4 lzip lzma lzo magic mp3 ncurses nls nptl ogg openmp opus pam pcre png pulseaudio readline seccomp sndfile speex split-usr ssl svg test-rust theora tiff truetype udev unicode v4l vaapi vim-syntax vorbis vpx vulkan wayland webp x264 x265 xattr xvid xxhash zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="abm acpi aes aperfmperf apic arat arch_perfmon avx avx2 bmi1 bmi2 bts clflush cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fma3 fpu fsgsbase fxsr ht ibpb ibrs ida invpcid invpcid_single lahf_lm lm mca mce md_clear mmx mmxext monitor movbe msr mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pti pts rdrand rdtscp rep_good sdbg sep smep ss ssbd sse sse2 sse3 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi vpid x2apic xsave xsaveopt xtopology xtpr" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-CA en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF WebAssembly X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" YACC="byacc" Unset: ADDR2LINE, ARFLAGS, AS, ASFLAGS, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, READELF, SIZE, STRINGS, STRIP, YFLAGS
Created attachment 866676 [details] build.log
Fixed by upstream: https://github.com/FFmpeg/FFmpeg/commit/00b64fca55a3a009c9d0e391c85f4fd3291e5d12
(In reply to 12101111 from comment #2) > Fixed by upstream: > https://github.com/FFmpeg/FFmpeg/commit/00b64fca55a3a009c9d0e391c85f4fd3291e5d12 It actually isn't (tested with ffmpeg-7.1.1 and musl), there's two issues. First to clarify, USE=v4l and USE=libv4l are different, the former only uses linux-headers, the latter uses media-libs/libv4l. USE=v4l's issue (bug #940733) is indeed fixed by the above commit which properly detects it (7.1 ebuild is trying to pass -DHAVE_POSIX_IOCTL like it did for -D__musl__ but it actually does not need to, it works). By doing so, struct video_data uses the one without unsigned long int: int (*ioctl_f)(int fd, int request, ...) Then, if USE=libv4l is enabled, that SET_WRAPPERS(v4l2_) macro will create: s->ioctl_f = v4l2_ioctl 's' is a video_data struct, and if we look at v42l_ioctl in system's libv4l2.h: LIBV4L_PUBLIC int v4l2_ioctl(int fd, unsigned long int request, ...); ... and that's a mismatch with the POSIX one that got enabled.
Might add that this also happens with gcc14 nowadays which does not like this either.
Also, given this can use both types at same time, without HAVE_POSIX_IOCTL it'll just fail on the 2nd one. if (s->use_libv4l2) { SET_WRAPPERS(v4l2_); } else { SET_WRAPPERS(); May opt to simply mask the USE until we have a proper solution.