• Bug#1065153: v4l-utils: FTBFS on armhf/armel: _TIME_BITS=64 is allowed

    From Emanuele Rocca@21:1/5 to Emanuele Rocca on Fri Mar 1 11:40:02 2024
    On 2024-03-01 10:28, Emanuele Rocca wrote:
    /usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
    26 | # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
    | ^~~~~

    The build logs show that the time64 flags -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 are used as expected throughout the build process, with
    the exception of v4l2convert.c.o which uses -D_FILE_OFFSET_BITS=32:

    [94/286] cc -Ilib/libv4l2/v4l2convert.so.p -Ilib/libv4l2 -I../lib/libv4l2 -I../lib/include -I../include -fdiagnostics-color=always -Wall -Winvalid-pch -std=gnu99 -Wpointer-arith -D_GNU_SOURCE -DPROMOTED_MODE_T=int -DENABLE_NLS -include /<<PKGBUILDDIR>>/
    obj-arm-linux-gnueabihf/config.h -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=
    64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -U_FILE_OFFSET_BITS -D_FILE_OFFSET_BITS=32 -D_LARGEFILE64_SOURCE -MD -MQ lib/libv4l2/v4l2convert.so.p/v4l2convert.c.o -MF lib/libv4l2/v4l2convert.so.p/v4l2convert.c.o.d -o lib/libv4l2/v4l2convert.so.p/v4l2convert.
    c.o -c ../lib/libv4l2/v4l2convert.c

    This seems intentional, see meson.build:

    v4l2_wrapper_args = [
    # As the library needs to provide both 32-bit and 64-bit versions
    # of file operations, disable transparent large file support (fixes
    # 'Error: symbol `open64/mmap64' is already defined' compile failure
    # otherwise)
    '-U_FILE_OFFSET_BITS',
    '-D_FILE_OFFSET_BITS=32',
    '-D_LARGEFILE64_SOURCE',
    ]

    https://sources.debian.org/src/v4l-utils/1.26.1-3.1/meson.build/#L51

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gregor Jasny@21:1/5 to Emanuele Rocca on Fri Mar 1 20:40:01 2024
    Hello,

    On 01.03.24 11:34, Emanuele Rocca wrote:
    This seems intentional, see meson.build:

    v4l2_wrapper_args = [
    # As the library needs to provide both 32-bit and 64-bit versions
    # of file operations, disable transparent large file support (fixes
    # 'Error: symbol `open64/mmap64' is already defined' compile failure
    # otherwise)
    '-U_FILE_OFFSET_BITS',
    '-D_FILE_OFFSET_BITS=32',
    '-D_LARGEFILE64_SOURCE',
    ]

    You're right disabling LFS was intentional. Those "wrappers" are meent
    to be preloaded with LD_PRELOAD and should intercept all V4L related
    calls like open, close, mmap, etc.

    I believe the conflict arose because the Debian CFLAGS now define a 64
    bit time_t value on 32bit architectures. I believe none of the code
    within those wrappers is sensitive to time_t. Therefore I also undefined
    the _TIME_BITS. That should resolve the issue for the Debian package.

    For upstream the problem is a little bit trickier because the "tracer"
    also uses those flags. But the tracer consists of lots of files. Maybe
    those have to be split up.

    Thanks,
    Gregor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)