[FFmpeg-devel] libavdevice/v4l2.c: FFmpeg 6.0 build breaks with Clang 16 (LLVM 16.0.0-rc4)

mss mss at tutanota.de
Fri Mar 17 10:02:09 EET 2023


On an x86_64 musl (version 1.2.3) linux system with a standalone complete LLVM
suite (no GCC, libstdc++ or binutils components are installed), when building
FFmpeg version 6.0 with Clang 16 from LLVM 16.0.0-rc4, the build breaks with the
following error:

src/libavdevice/v4l2.c:145: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:137:17: note: expanded from macro 'SET_WRAPPERS'
    s->ioctl_f  = prefix ## ioctl;      \
                ^ ~~~~~~~~~~~~~~~

Build of the same version of FFmpeg completes successfully when Clang 15 from
LLVM 15.0.7 is used. Only change made to the system to see the build breakage
is the Clang/LLVM version being bumped from stable 15.0.7 to rc4 16.0.0.

No patches are applied, and the used C/CXX/LDFLAGS are as follows:
C/CXXFLAGS: -DNDEBUG -g0 -s -w -pipe -O3 -march=x86-64 -mtune=generic
            -D_FORTIFY_SOURCE=2 -fstack-protector-strong
LDFLAGS:    -Wl,--as-needed,--sort-common,-z,relro,-z,now,--gc-sections,-O3,
            --icf=all

when CFLAGS, CXXFLAGS and LDFLAGS variables are unset, the build breakage
remains, and Clang/LLVM 15.0.7 is able to build FFmpeg 6.0 with the same set of
variables stated above.

The configure flags used when configuring the FFmpeg 6.0 stable release source
are as follows:

../configure  \
--prefix=/usr                    \
--enable-gpl                     \
--enable-nonfree                 \
\
--cpu=generic                    \
--enable-runtime-cpudetect       \
\
--enable-lto                     \
--enable-pic                     \
--enable-shared                  \
--disable-debug                  \
--disable-optimizations          \
--disable-static                 \
--disable-symver                 \
\
--enable-ffmpeg                  \
--disable-ffplay                 \
--disable-ffprobe                \
\
--enable-libpulse                \
--disable-alsa                   \
\
--enable-bzlib                   \
--enable-libass                  \
--enable-libdrm                  \
--enable-libfontconfig           \
--enable-libfreetype             \
--enable-libfribidi              \
--enable-libmp3lame              \
--enable-libopenjpeg             \
--enable-libopus                 \
--enable-libv4l2                 \
--enable-libvorbis               \
--enable-libvpx                  \
--enable-libx264                 \
--enable-libx265                 \
--enable-libxcb                  \
--enable-libxcb-shape            \
--enable-libxcb-shm              \
--enable-libxcb-xfixes           \
--enable-lzma                    \
--enable-network                 \
--enable-opengl                  \
--enable-openssl                 \
--enable-pthreads                \
--enable-v4l2-m2m                \
--enable-vaapi                   \
--enable-xlib                    \
--enable-zlib                    \
\
--disable-indev="oss,sndio,alsa" \
--disable-outdev="oss,sndio,alsa"\
\
--disable-doc                    \
--disable-htmlpages              \
--disable-manpages               \
--disable-podpages               \
--disable-txtpages



More information about the ffmpeg-devel mailing list