diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-02-14 10:00:07 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-15 10:26:42 +0000 |
commit | b629da1df8125d1a671fec6ebd59813050a3099c (patch) | |
tree | b2c31b21b5ea82e5e4712e4f93a1b1cc37f0bae7 /meta/recipes-core/busybox/busybox/0003-runsv-Use-64-prefix-syscall-if-we-have-to.patch | |
parent | 717ba0a25669f469c7698399a79ad21661324edc (diff) | |
download | poky-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/0003-runsv-Use-64-prefix-syscall-if-we-have-to.patch')
-rw-r--r-- | meta/recipes-core/busybox/busybox/0003-runsv-Use-64-prefix-syscall-if-we-have-to.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/0003-runsv-Use-64-prefix-syscall-if-we-have-to.patch b/meta/recipes-core/busybox/busybox/0003-runsv-Use-64-prefix-syscall-if-we-have-to.patch new file mode 100644 index 0000000000..4760570441 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/0003-runsv-Use-64-prefix-syscall-if-we-have-to.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 8c7419649d6e6fda8fa7d0e863084c78ac728628 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Wed, 28 Aug 2019 10:54:15 -0700 | ||
4 | Subject: [PATCH 3/3] runsv: Use 64 prefix syscall if we have to | ||
5 | |||
6 | Some 32-bit architectures no longer have the 32-bit time_t syscalls. | ||
7 | Instead they have suffixed syscalls that returns a 64-bit time_t. If | ||
8 | the architecture doesn't have the non-suffixed syscall and is using a | ||
9 | 64-bit time_t let's use the suffixed syscall instead. | ||
10 | |||
11 | This fixes build issues when building for RISC-V 32-bit with 5.1+ kernel | ||
12 | headers. | ||
13 | |||
14 | If an architecture only supports the suffixed syscalls, but is still | ||
15 | using a 32-bit time_t report a compilation error. This avoids us have to | ||
16 | deal with converting between 64-bit and 32-bit values. There are | ||
17 | currently no architectures where this is the case. | ||
18 | |||
19 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
20 | Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=ad27d44ebe950335616f37e36863469dc181b455] | ||
21 | --- | ||
22 | runit/runsv.c | 7 +++++++ | ||
23 | 1 file changed, 7 insertions(+) | ||
24 | |||
25 | diff --git a/runit/runsv.c b/runit/runsv.c | ||
26 | index ccc762d78..737909b0e 100644 | ||
27 | --- a/runit/runsv.c | ||
28 | +++ b/runit/runsv.c | ||
29 | @@ -55,7 +55,14 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
30 | * typically requiring -lrt. We just skip all this mess */ | ||
31 | static void gettimeofday_ns(struct timespec *ts) | ||
32 | { | ||
33 | +#if defined(__NR_clock_gettime) | ||
34 | syscall(__NR_clock_gettime, CLOCK_REALTIME, ts); | ||
35 | +#elif __TIMESIZE == 64 | ||
36 | + syscall(__NR_clock_gettime64, CLOCK_REALTIME, 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 | } | ||
42 | #else | ||
43 | static void gettimeofday_ns(struct timespec *ts) | ||
44 | -- | ||
45 | 2.22.0 | ||
46 | |||