linux/tools/include/nolibc
Zhouyi Zhou d7a3eb5931 tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers
[ Upstream commit 0ff52df6b3 ]

Commit d5094bcb5b ("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
94c467ddb2 ("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: d5094bcb5b ("tools/nolibc: define time_t in terms of __kernel_old_time_t")
Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
[Thomas: Reformat commit and its message a bit]
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-15 12:00:02 +02:00
..
.gitignore tools/nolibc: Add gitignore to avoid git complaints about sysroot 2023-03-20 08:45:21 -07:00
arch-aarch64.h tools/nolibc: move entrypoint specifics to compiler.h 2024-08-12 22:21:00 +02:00
arch-arm.h tools/nolibc: move entrypoint specifics to compiler.h 2024-08-12 22:21:00 +02:00
arch-i386.h tools/nolibc: move entrypoint specifics to compiler.h 2024-08-12 22:21:00 +02:00
arch-loongarch.h tools/nolibc: move entrypoint specifics to compiler.h 2024-08-12 22:21:00 +02:00
arch-mips.h tools/nolibc: move entrypoint specifics to compiler.h 2024-08-12 22:21:00 +02:00
arch-powerpc.h tools/nolibc: move entrypoint specifics to compiler.h 2024-08-12 22:21:00 +02:00
arch-riscv.h tools/nolibc: move entrypoint specifics to compiler.h 2024-08-12 22:21:00 +02:00
arch-s390.h tools/nolibc: s390: include std.h 2024-12-05 14:02:46 +01:00
arch-x86_64.h tools/nolibc: x86_64: use local label in memcpy/memmove 2024-08-16 17:23:13 +02:00
arch.h tools/nolibc: move MIPS ABI validation into arch-mips.h 2023-12-11 22:38:21 +01:00
compiler.h tools/nolibc: compiler: use attribute((naked)) if available 2024-08-12 22:22:03 +02:00
crt.h tools/nolibc: crt: mark _start_c() as used 2024-08-16 17:23:13 +02:00
ctype.h tools/nolibc: fix missing includes causing build issues at -O0 2023-01-09 09:36:05 -08:00
errno.h tools/nolibc: make errno a weak symbol instead of a static one 2023-01-10 13:33:55 -08:00
Makefile tools/nolibc: add stdbool.h header 2024-07-29 07:52:57 +02:00
nolibc.h tools/nolibc: add stdbool.h header 2024-07-29 07:52:57 +02:00
signal.h tools/nolibc: fix missing includes causing build issues at -O0 2023-01-09 09:36:05 -08:00
stackprotector.h tools/nolibc: stackprotector: mark implicitly used symbols as used 2024-08-16 17:23:13 +02:00
std.h tools/nolibc: make time_t robust if __kernel_old_time_t is missing in host headers 2025-10-15 12:00:02 +02:00
stdarg.h tools/nolibc: add stdarg.h header 2023-10-12 21:13:52 +02:00
stdbool.h tools/nolibc: add stdbool.h header 2024-07-29 07:52:57 +02:00
stdint.h tools/nolibc: add limits for {u,}intmax_t, ulong and {u,}llong 2024-06-29 09:44:54 +02:00
stdio.h tools/nolibc: implement strerror() 2024-06-29 09:44:57 +02:00
stdlib.h tools/nolibc: implement strtol() and friends 2024-06-29 09:44:55 +02:00
string.h tools/nolibc: include arch.h from string.h 2024-07-29 07:52:56 +02:00
sys.h tools/nolibc: add support for uname(2) 2024-04-14 20:28:54 +02:00
time.h tools/nolibc: fix missing includes causing build issues at -O0 2023-01-09 09:36:05 -08:00
types.h tools/nolibc: fix spelling of FD_SETBITMASK in FD_* macros 2025-08-20 18:30:56 +02:00
unistd.h tools/nolibc: unistd.h: reorder the syscall macros 2023-08-06 12:27:53 +02:00