Commit 5c3dcf91 authored by Zhouyi Zhou's avatar Zhouyi Zhou Committed by Greg Kroah-Hartman
Browse files

tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers



[ Upstream commit 0ff52df6 ]

Commit d5094bcb ("tools/nolibc: define time_t in terms of
__kernel_old_time_t") made nolibc use the kernel's time type so that
`time_t` matches `timespec::tv_sec` on all ABIs (notably x32).

But since __kernel_old_time_t is fairly new, notably from 2020 in commit
94c467dd ("y2038: add __kernel_old_timespec and __kernel_old_time_t"),
nolibc builds that rely on host headers may fail.

Switch to __kernel_time_t, which is the same as __kernel_old_time_t and
has existed for longer.

Tested in PPC VM of Open Source Lab of Oregon State University
(./tools/testing/selftests/rcutorture/bin/mkinitrd.sh)

Fixes: d5094bcb ("tools/nolibc: define time_t in terms of __kernel_old_time_t")
Signed-off-by: default avatarZhouyi Zhou <zhouzhouyi@gmail.com>
[Thomas: Reformat commit and its message a bit]
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a10d9fe6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment