[pkg-lxc-devel] Bug#878683: src:lxc: FTBFS on x32
Adam Borowski
kilobyte at angband.pl
Sun Oct 15 18:59:19 UTC 2017
Package: src:lxc
Version: 1:2.0.8-3
Severity: important
Tags: patch
Justification: fails to build from source (but built successfully in the past)
Hi!
I'm afraid that x32 fails to build on x32. It has an assumption that fields
of struct timespec are longs -- that's true on most architectures but not on
any added after kernel devs decided that the Y2038 bug should be fixed.
There's also a plan to change time_t on old 32-bit architectures, so it's
likely this failure would extend to more archs soon.
Here's a patch. Unlike tv_sec, tv_nsec can't ever exceed 10⁹ thus a cast to
(long) is simple and correct.
Meow!
-- System Information:
Debian Release: buster/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: x32 (x86_64)
Kernel: Linux 4.14.0-rc4-debug-00260-ga9ead0e01cab (SMP w/6 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
-------------- next part --------------
--- lxc-2.0.8.orig/src/lxc/log.c
+++ lxc-2.0.8/src/lxc/log.c
@@ -154,7 +154,7 @@ int lxc_unix_epoch_to_utc(char *buf, siz
seconds = (time->tv_sec - d_in_s - h_in_s - (minutes * 60));
/* Make string from nanoseconds. */
- ret = snprintf(nanosec, LXC_NUMSTRLEN64, "%ld", time->tv_nsec);
+ ret = snprintf(nanosec, LXC_NUMSTRLEN64, "%ld", (long)time->tv_nsec);
if (ret < 0 || ret >= LXC_NUMSTRLEN64)
return -1;
More information about the Pkg-lxc-devel
mailing list