Package: librnd
Version: 3.2.0-3
Tags: ftbfs, hppa, patch
librnd randomly fails to build on debian hppa buildd servers (and probably other
32bit architectures which run with 64bit kernels), because the check for the
readdir() syscall in scconfig/src/default/find_fscalls.c
fails if the temporary generated file is on a filesystem which isn't reachable
with a 32-bit struct dirent entry.
Such a failure can be seen here:
https://buildd.debian.org/status/fetch.php?pkg=librnd&arch=hppa&ver=3.2.0-3&stamp=1663095878&raw=0
The failure (apparently missing readdir syscall) will then be reported later on
as:
os_dep_fs.c:129:2: error: #error no suitable readdir implementation
129 | #error no suitable readdir implementation
The solution is simple, please just add
CFLAGS += -D_LARGE_FILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
to the top of the debian/rules file.
Thanks,
Helge
--- debian/rules.org 2022-08-17 06:09:55.850853504 +0000
+++ debian/rules 2022-08-17 06:10:21.906723720 +0000
@@ -13,6 +13,8 @@
CFLAGS := $(shell dpkg-buildflags --get CPPFLAGS; dpkg-buildflags --get CFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CPPFLAGS; dpkg-buildflags --get CXXFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+CFLAGS += -D_LARGE_FILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
+CXXFLAGS += -D_LARGE_FILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
export CFLAGS
export CXXFLAGS
export LDFLAGS