summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/busybox/0001-date-Use-64-prefix-syscall-if-we-have-to.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/busybox/busybox/0001-date-Use-64-prefix-syscall-if-we-have-to.patch')
-rw-r--r--meta/recipes-core/busybox/busybox/0001-date-Use-64-prefix-syscall-if-we-have-to.patch53
1 files changed, 0 insertions, 53 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-date-Use-64-prefix-syscall-if-we-have-to.patch b/meta/recipes-core/busybox/busybox/0001-date-Use-64-prefix-syscall-if-we-have-to.patch
deleted file mode 100644
index 944526b7ca..0000000000
--- a/meta/recipes-core/busybox/busybox/0001-date-Use-64-prefix-syscall-if-we-have-to.patch
+++ /dev/null
@@ -1,53 +0,0 @@
1From b7b7452f292f03eefafa6fd1da9bcfc933dee15a Mon Sep 17 00:00:00 2001
2From: Alistair Francis <alistair.francis@wdc.com>
3Date: Wed, 18 Sep 2019 09:28:49 -0700
4Subject: [PATCH] date: Use 64 prefix syscall if we have to
5
6Some 32-bit architectures no longer have the 32-bit time_t syscalls.
7Instead they have suffixed syscalls that returns a 64-bit time_t. If
8the architecture doesn't have the non-suffixed syscall and is using a
964-bit time_t let's use the suffixed syscall instead.
10
11This fixes build issues when building for RISC-V 32-bit with 5.1+ kernel
12headers.
13
14If an architecture only supports the suffixed syscalls, but is still
15using a 32-bit time_t fall back to the libc call.
16
17Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=b7b7452f292f03eefafa6fd1da9bcfc933dee15a]
18Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
19Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
20---
21 coreutils/date.c | 11 +++++++++--
22 1 file changed, 9 insertions(+), 2 deletions(-)
23
24--- a/coreutils/date.c
25+++ b/coreutils/date.c
26@@ -36,7 +36,7 @@
27 //config:# defaults to "no": stat's nanosecond field is a bit non-portable
28 //config:config FEATURE_DATE_NANO
29 //config: bool "Support %[num]N nanosecond format specifier"
30-//config: default n # syscall(__NR_clock_gettime)
31+//config: default n # syscall(__NR_clock_gettime) or syscall(__NR_clock_gettime64)
32 //config: depends on DATE
33 //config: select PLATFORM_LINUX
34 //config: help
35@@ -271,10 +271,17 @@ int date_main(int argc UNUSED_PARAM, cha
36 */
37 #endif
38 } else {
39-#if ENABLE_FEATURE_DATE_NANO
40+#if ENABLE_FEATURE_DATE_NANO && defined(__NR_clock_gettime)
41 /* libc has incredibly messy way of doing this,
42 * typically requiring -lrt. We just skip all this mess */
43 syscall(__NR_clock_gettime, CLOCK_REALTIME, &ts);
44+#elif ENABLE_FEATURE_DATE_NANO && __TIMESIZE == 64
45+ /* Let's only support the 64 suffix syscalls for 64-bit time_t.
46+ * This simplifies the code for us as we don't need to convert
47+ * between 64-bit and 32-bit. We also don't have a way to
48+ * report overflow errors here.
49+ */
50+ syscall(__NR_clock_gettime64, CLOCK_REALTIME, &ts);
51 #else
52 time(&ts.tv_sec);
53 #endif