Bug#964220: vdr: FTBFS with glibc 2.31 (uses removed stime function)
Aurelien Jarno
aurel32 at debian.org
Fri Jul 3 21:12:01 BST 2020
Source: vdr
Version: 2.4.1-4
Severity: important
Tags: patch upstream
Dear maintainer,
vdr fail to build from source with glibc 2.31:
| g++ -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DREMOTE_KBD -DSDNOTIFY -DLIRC_DEVICE=\"/var/run/lirc/lircd\" -DVIDEODIR=\"/var/lib/video\" -DCONFDIR=\"/var/lib/vdr\" -DARGSDIR=\"/etc/vdr/conf.d\" -DCACHEDIR=\"/var/cache/vdr\" -DRESDIR=\"/usr/share/vdr\" -DPLUGINDIR=\"/usr/lib/vdr/plugins\" -DLOCDIR=\"/usr/share/locale\" -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -o eitscan.o eitscan.c
| eit.c: In constructor ‘cTDT::cTDT(const u_char*)’:
| eit.c:394:13: error: ‘stime’ was not declared in this scope; did you mean ‘ctime’?
| 394 | if (stime(&dvbtim) == 0)
| | ^~~~~
| | ctime
| make[2]: *** [Makefile:135: eit.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| make[2]: Leaving directory '/<<PKGBUILDDIR>>'
| dh_auto_build: error: make -j4 "INSTALL=install --strip-program=true" PREFIX=/usr VIDEODIR=/var/lib/video LIBDIR=/usr/lib/vdr/plugins SDNOTIFY=1 VERBOSE=1 returned exit code 2
| make[1]: *** [debian/rules:17: override_dh_auto_build] Error 25
| make[1]: Leaving directory '/<<PKGBUILDDIR>>'
| make: *** [debian/rules:14: build] Error 2
| dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
The full build log is available there:
http://qa-logs.debian.net/2020/06/24/vdr_2.4.1-4_unstable_glibc-exp.log
The stime function has been marked as obsolete for some time, and since
glibc 2.31 it is no longer available to newly linked binaries. The
clock_settime function should be used instead.
You will find attached a patch fixing that. It would be nice if it can
be fixed relatively soon so that we can start the transition.
Regards,
Aurelien
-------------- next part --------------
diff -Nru vdr-2.4.1/debian/patches/glibc-stime.patch vdr-2.4.1/debian/patches/glibc-stime.patch
--- vdr-2.4.1/debian/patches/glibc-stime.patch 1970-01-01 00:00:00.000000000 +0000
+++ vdr-2.4.1/debian/patches/glibc-stime.patch 2020-07-03 18:47:22.000000000 +0000
@@ -0,0 +1,15 @@
+The obsolete function stime is no longer available to newly linked binaries
+since glibc 2.31. Replace it by clock_settime.
+
+--- a/eit.c
++++ b/eit.c
+@@ -391,7 +391,8 @@ cTDT::cTDT(const u_char *Data)
+ if (abs(diff) > MAX_TIME_DIFF) {
+ mutex.Lock();
+ if (abs(diff) > MAX_ADJ_DIFF) {
+- if (stime(&dvbtim) == 0)
++ struct timespec ts = { .tv_sec = dvbtim };
++ if (clock_settime(CLOCK_REALTIME, &ts) == 0)
+ isyslog("system time changed from %s (%ld) to %s (%ld)", *TimeToString(loctim), loctim, *TimeToString(dvbtim), dvbtim);
+ else
+ esyslog("ERROR while setting system time: %m");
diff -Nru vdr-2.4.1/debian/patches/series vdr-2.4.1/debian/patches/series
--- vdr-2.4.1/debian/patches/series 2019-11-01 12:11:11.000000000 +0000
+++ vdr-2.4.1/debian/patches/series 2020-07-03 18:45:29.000000000 +0000
@@ -6,3 +6,4 @@
allow-verbose-libsi-build.patch
use-cpp-flags.patch
configurable-pkg-config.patch
+glibc-stime.patch
More information about the pkg-vdr-dvb-devel
mailing list