• Bug#1067208: umockdev: #error "_TIME_BITS=64 is allowed only with _FILE

    From Thorsten Glaser@21:1/5 to All on Wed Mar 20 04:10:01 2024
    Source: umockdev
    Version: 0.18.0-1
    Severity: serious
    Justification: FTBFS on t64-affected archs
    X-Debbugs-Cc: tg@mirbsd.de
    Tags: ftbfs

    cc -Ilibumockdev-preload.so.0.0.0.p -I. -I.. -fdiagnostics-color=always -Wall -Winvalid-pch -std=gnu11 -Werror=missing-prototypes -Werror=strict-prototypes -Werror=nested-externs -Werror=pointer-arith -Werror=implicit-function-declaration -Werror=
    implicit-int -Werror=int-conversion -Werror=old-style-definition -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=return-type -Werror=uninitialized -Wcast-align -Wno-error=pragmas -Wno-error=discarded-qualifiers -
    Wno-error=incompatible-pointer-types -Wno-error=pointer-sign -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-label -Wno-unused-value -Wno-unused-variable -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -
    specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fvisibility=default -MD -MQ libumockdev-preload.so.0.0.0.p/
    src_libumockdev-preload.c.o -MF libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o.d -o libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -c ../src/libumockdev-preload.c
    In file included from /usr/include/features.h:393,
    from /usr/include/assert.h:35,
    from ../src/libumockdev-preload.c:31: /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"
    | ^~~~~


    I admit I don’t exactly see what’s going on here. Does it
    maybe #unset _FILE_OFFSET_BITS or something?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Pitt@21:1/5 to All on Sun Mar 24 11:20:01 2024
    Control: forwarded -1 https://github.com/martinpitt/umockdev/issues/216 Control: tag -1 upstream pending

    Hello all,

    Thorsten Glaser [2024-03-20 3:05 +0000]:
    /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"
    | ^~~~~


    I admit I don’t exactly see what’s going on here. Does it
    maybe #unset _FILE_OFFSET_BITS or something?

    Yes, it currently does on main/latest release, see https://github.com/martinpitt/umockdev/issues/216

    Simon McVittie [2024-03-21 12:30 +0000]:
    I don't think the proposed fix in kmod is correct, and I don't think
    an equivalent in umockdev would be correct either. Since glibc 2.34,
    on 32-bit architectures all such LD_PRELOAD modules will need updating
    to also wrap __lstat64_time64(), __stat64_time64(), __fstat64_time64()
    and __fstatat64_time64() on architectures where they exist - otherwise, programs and libraries compiled with 64-bit time_t will bypass the
    wrapped stat(), stat64() etc. and call __stat64_time64() instead, and therefore the wrapping will be ineffective and umockdev's mock devices
    will not be seen.

    Correct.

    As it happens, the latest Ubuntu package got fixes for both of these issues recently, thanks to Steve Langasek and Zixing Liu! I'll integrate them upstream and then make a new release.

    Martin

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