diff options
Diffstat (limited to 'debian/patches/y2038-force-2.diff')
-rw-r--r-- | debian/patches/y2038-force-2.diff | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/debian/patches/y2038-force-2.diff b/debian/patches/y2038-force-2.diff new file mode 100644 index 00000000..4403d985 --- /dev/null +++ b/debian/patches/y2038-force-2.diff @@ -0,0 +1,94 @@ +commit 60e147c762e532345755bd68a3d012ba44db004c +Author: Arnd Bergmann <arnd@arndb.de> +Date: Wed Mar 4 15:25:30 2020 +0100 + + y2038: force time64 symbols + + Signed-off-by: Arnd Bergmann <arnd@arndb.de> + +Index: glibc-2.31-2038-5/include/features.h +=================================================================== +--- glibc-2.31-2038-5.orig/include/features.h ++++ glibc-2.31-2038-5/include/features.h +@@ -376,13 +376,23 @@ + # define __USE_LARGEFILE64 1 + #endif + ++/* We need to know the word size in order to check the time size. */ ++#include <bits/timesize.h> ++ ++/* force _FILE_OFFSET_BITS and _TIME_BITS */ ++#if !defined _LIBC && __TIMESIZE == 32 ++#if !(defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64) ++#define _FILE_OFFSET_BITS 64 ++#endif ++#if !(defined _TIME_BITS && _TIME_BITS == 64) ++#define _TIME_BITS 64 ++#endif ++#endif ++ + #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 + # define __USE_FILE_OFFSET64 1 + #endif + +-/* We need to know the word size in order to check the time size. */ +-#include <bits/wordsize.h> +- + #if defined _TIME_BITS + # if _TIME_BITS == 64 + # if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64 +Index: glibc-2.31-2038-5/sysdeps/unix/sysv/linux/kernel-features.h +=================================================================== +--- glibc-2.31-2038-5.orig/sysdeps/unix/sysv/linux/kernel-features.h ++++ glibc-2.31-2038-5/sysdeps/unix/sysv/linux/kernel-features.h +@@ -178,35 +178,9 @@ + timerfd_settime(64) + utimensat(_time64) + +- On architectures where time_t has historically been 64 bits, +- only the 64-bit version of each system call exists, and there +- are no suffixes on the __NR_ constants. +- +- On architectures where time_t has historically been 32 bits, +- both 32-bit and 64-bit versions of each system call may exist, +- depending on the kernel version. When the 64-bit version exists, +- there is a '64' or '_time64' suffix on the name of its __NR_ +- constant, as shown above. +- +- This flag is always set for Linux 5.1 and later. Prior to that +- version, it is set only for some CPU architectures and ABIs: +- +- - __WORDSIZE == 64 - all supported architectures where pointers +- are 64 bits also have always had 64-bit time_t. +- +- - __WORDSIZE == 32 && __SYSCALL_WORDSIZE == 64 - this describes +- only one supported configuration, x86's 'x32' subarchitecture, +- where pointers are 32 bits but time_t has always been 64 bits. +- +- __ASSUME_TIME64_SYSCALLS being set does not mean __TIMESIZE is 64, +- and __TIMESIZE equal to 64 does not mean __ASSUME_TIME64_SYSCALLS +- is set. All four cases are possible. */ +- +-#if __LINUX_KERNEL_VERSION >= 0x050100 \ +- || __WORDSIZE == 64 \ +- || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) ++ Assume we are using a new kernel for now ++*/ + # define __ASSUME_TIME64_SYSCALLS 1 +-#endif + + /* Linux waitid prior kernel 5.4 does not support waiting for the current + process group. */ +Index: glibc-2.31-2038-5/sysdeps/unix/sysv/linux/x86/bits/timesize.h +=================================================================== +--- glibc-2.31-2038-5.orig/sysdeps/unix/sysv/linux/x86/bits/timesize.h ++++ glibc-2.31-2038-5/sysdeps/unix/sysv/linux/x86/bits/timesize.h +@@ -16,6 +16,8 @@ + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + ++#include <bits/wordsize.h> ++ + #if defined __x86_64__ && defined __ILP32__ + /* For x32, time is 64-bit even though word size is 32-bit. */ + # define __TIMESIZE 64 |