Source: chiark-utils
Version: 7.0.1
Severity: serious
Tags: FTBFS, patch
User: debian-ri...@lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: debian-ri...@lists.debian.org

Dear chiark-utils Maintainer,
The package chiark-utils build failed on arch riscv64, amd64,arm64 and most
64bit arch.The crucial buildd log below:
···

In file included from /usr/include/features.h:394,
                 from /usr/include/x86_64-linux-gnu/sys/time.h:21,
                 from rwbuffer.h:34,
                 from readbuffer.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"
      |     ^~~~~
In file included from /usr/include/features.h:394,
                 from /usr/include/x86_64-linux-gnu/sys/time.h:21,
                 from rwbuffer.h:34,
                 from writebuffer.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"
      |     ^~~~~
In file included from /usr/include/features.h:394,
                 from /usr/include/x86_64-linux-gnu/sys/time.h:21,
                 from rwbuffer.h:34,
                 from wrbufcore.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"
      |     ^~~~~
In file included from /usr/include/features.h:394,
                 from /usr/include/x86_64-linux-gnu/sys/time.h:21,
                 from rwbuffer.h:34,
                 from rwbuffer.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"
      |     ^~~~~
In file included from /usr/include/features.h:394,
                 from /usr/include/errno.h:25,
                 from with-lock-ex.c:57:
/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"
      |     ^~~~~
In file included from /usr/include/features.h:394,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from xbatmon-simple.c:43:
/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"
      |     ^~~~~
make[1]: *** [<builtin>: readbuffer.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [<builtin>: with-lock-ex] Error 1
make[1]: *** [<builtin>: writebuffer.o] Error 1
make[1]: *** [<builtin>: wrbufcore.o] Error 1
make[1]: *** [<builtin>: rwbuffer.o] Error 1
make[1]: *** [<builtin>: xbatmon-simple] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>/cprogs'
dh_auto_build: error: cd cprogs && make -j6 "INSTALL=install
--strip-program=true" all OPTIMISE= DEBUG= "CMDLINE_CFLAGS=-g -O2
-Werror=implicit-function-declaration
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong
-fstack-clash-protection -Wformat -Werror=format-security
-fcf-protection" "CMDLINE_CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2
-D_TIME_BITS=64" CMDLINE_LDFLAGS=-Wl,-z,relro returned exit code 2
make: *** [debian/rules:25: build] Error 255
dpkg-buildpackage: error: debian/rules build-arch subprocess returned
exit status 2

···
The full buildd log is here:
https://buildd.debian.org/status/fetch.php?pkg=chiark-utils&arch=riscv64&ver=7.0.1&stamp=1720098681&raw=0

My solution to this issue:
The error is caused by _TIME_BITS=64 is used without also setting
_FILE_OFFSET_BITS=64.To fix this problem, you need to add
_FILE_OFFSET_BITS=64 definition to the compilation options. We can modify
the file debian/rules on line20 "CMDLINE_CPPFLAGS="$(shell $(D_BUILDFLAGS)
--get CPPFLAGS) -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" \". Replace that
with "CMDLINE_CPPFLAGS="$(shell $(D_BUILDFLAGS) --get CPPFLAGS)
-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" \".This way the issue can be fixed.
I have tested that in local, and it works well. Please let me know wheather
this solution can be accepted.

Gui-Yue
Best Regards

Reply via email to