kernel-selftest: Fix build on 32bit arches with 64bit time_t
PATCH 1/1 kernel-selftest: Fix build on 32bit arches with 64bit time_t
Fix warning where S is expected to exist before do_configure
Signed-off-by Khem Raj <[email protected]>
--- .../kernel-selftest/kernel-selftest.bb | 3 ++ ...-Fix-clock_adjtime-for-newer-32-bit-.patch | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-timers-Fix-clock_adjtime-for-newer-32-bit-.patch
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest.bb +3 -0
@@ -12,6 +12,7 @@ SRC_URI:append:libc-musl = "\ " SRC_URI += "file://run-ptest \ file://COPYING \ + file://0001-selftests-timers-Fix-clock_adjtime-for-newer-32-bit-.patch \ " # now we just test bpf and vm
@@ -149,6 +150,8 @@ remove_unrelated() { fi } +do_configure[dirs] = "${S}" + PACKAGE_ARCH = "${MACHINE_ARCH}" INHIBIT_PACKAGE_DEBUG_SPLIT="1"
meta-oe/recipes-kernel/kernel-selftest/kernel-selftest/0001-selftests-timers-Fix-clock_adjtime-for-newer-32-bit-.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 34021e84d03e2becb88e6c28e8e4867e82a81da5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Tue, 17 Sep 2024 17:40:03 -0700 +Subject: [PATCH] selftests: timers: Fix clock_adjtime for newer 32-bit arches + +Newer 32-bit architectures e.g. riscv32 are using 64-bit time_t +from get go, they have not wired __NR_clock_adjtime at all +valid-adjtimex testcase fails to compile on such architectures. +if this condition is found then use 64-bit adjtime syscall + +Upstream-Status: Submitted [https://patchwork.kernel.org/project/linux-kselftest/patch/[email protected]/] +Signed-off-by: Khem Raj <[email protected]> +Cc: John Stultz <[email protected]> +Cc: Shuah Khan <[email protected]> +--- + tools/testing/selftests/timers/valid-adjtimex.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tools/testing/selftests/timers/valid-adjtimex.c b/tools/testing/selftests/timers/valid-adjtimex.c +index d500884801d8..ff4ff8b1d127 100644 +--- a/tools/testing/selftests/timers/valid-adjtimex.c ++++ b/tools/testing/selftests/timers/valid-adjtimex.c +@@ -39,7 +39,11 @@ + #include <sys/syscall.h> + int clock_adjtime(clockid_t id, struct timex *tx) + { ++#if !defined(__NR_clock_adjtime) && defined(__NR_clock_adjtime64) ++ return syscall(__NR_clock_adjtime64, id, tx); ++#else + return syscall(__NR_clock_adjtime, id, tx); ++#endif + } + +