summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-02-14 10:00:07 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-15 10:26:42 +0000
commitb629da1df8125d1a671fec6ebd59813050a3099c (patch)
treeb2c31b21b5ea82e5e4712e4f93a1b1cc37f0bae7 /meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch
parent717ba0a25669f469c7698399a79ad21661324edc (diff)
downloadpoky-b629da1df8125d1a671fec6ebd59813050a3099c.tar.gz
busybox: Backport patches to support removal of __NR_clock_gettime
This helps compiling with musl on 32bit arches now that musl has switched to 64bit time_t (From OE-Core rev: 8c3a220a91f90202233765a3b4eb1697c8be18f7) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch')
-rw-r--r--meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch b/meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch
new file mode 100644
index 0000000000..58a6c0d8a0
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch
@@ -0,0 +1,43 @@
1From 902d3992922fc8db8495d5fb30a4581711b60c62 Mon Sep 17 00:00:00 2001
2From: Alistair Francis <alistair.francis@wdc.com>
3Date: Wed, 18 Sep 2019 09:28:50 -0700
4Subject: [PATCH] time: 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 report a compilation error. This avoids us have to
16deal with converting between 64-bit and 32-bit values. There are
17currently no architectures where this is the case.
18
19Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=902d3992922fc8db8495d5fb30a4581711b60c62]
20Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
21Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
22---
23 libbb/time.c | 7 +++++++
24 1 file changed, 7 insertions(+)
25
26--- a/libbb/time.c
27+++ b/libbb/time.c
28@@ -257,7 +257,14 @@ char* FAST_FUNC strftime_YYYYMMDDHHMMSS(
29 * typically requiring -lrt. We just skip all this mess */
30 static void get_mono(struct timespec *ts)
31 {
32- if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts))
33+#if defined(__NR_clock_gettime)
34+ if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts))
35+#elif __TIMESIZE == 64
36+ if (syscall(__NR_clock_gettime64, CLOCK_MONOTONIC, ts))
37+#else
38+# error "We currently don't support architectures without " \
39+ "the __NR_clock_gettime syscall and 32-bit time_t"
40+#endif
41 bb_error_msg_and_die("clock_gettime(MONOTONIC) failed");
42 }
43 unsigned long long FAST_FUNC monotonic_ns(void)