linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: futex: define SYS_futex on 32-bit architectures with 64-bit time_t
@ 2025-05-27  9:35 Ben Zong-You Xie
  2025-06-26 21:57 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Zong-You Xie @ 2025-05-27  9:35 UTC (permalink / raw)
  Cc: tglx, mingo, peterz, dvhart, dave, andrealmeid, shuah,
	linux-kernel, linux-kselftest, tim609, Ben Zong-You Xie,
	Cynthia Huang

glibc does not define SYS_futex for 32-bit architectures using 64-bit
time_t e.g. riscv32, therefore this test fails to compile since it does not
find SYS_futex in C library headers. Define SYS_futex as SYS_futex_time64
in this situation to ensure successful compilation and compatibility.

Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
Signed-off-by: Cynthia Huang <cynthia@andestech.com>
---
 tools/testing/selftests/futex/include/futextest.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include/futextest.h
index ddbcfc9b7bac..7a5fd1d5355e 100644
--- a/tools/testing/selftests/futex/include/futextest.h
+++ b/tools/testing/selftests/futex/include/futextest.h
@@ -47,6 +47,17 @@ typedef volatile u_int32_t futex_t;
 					 FUTEX_PRIVATE_FLAG)
 #endif
 
+/*
+ * SYS_futex is expected from system C library, in glibc some 32-bit
+ * architectures (e.g. RV32) are using 64-bit time_t, therefore it doesn't have
+ * SYS_futex defined but just SYS_futex_time64. Define SYS_futex as
+ * SYS_futex_time64 in this situation to ensure the compilation and the
+ * compatibility.
+ */
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+#define SYS_futex SYS_futex_time64
+#endif
+
 /**
  * futex() - SYS_futex syscall wrapper
  * @uaddr:	address of first futex
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: futex: define SYS_futex on 32-bit architectures with 64-bit time_t
  2025-05-27  9:35 [PATCH] selftests: futex: define SYS_futex on 32-bit architectures with 64-bit time_t Ben Zong-You Xie
@ 2025-06-26 21:57 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2025-06-26 21:57 UTC (permalink / raw)
  To: Ben Zong-You Xie
  Cc: mingo, peterz, dvhart, dave, andrealmeid, shuah, linux-kernel,
	linux-kselftest, tim609, Ben Zong-You Xie, Cynthia Huang

On Tue, May 27 2025 at 17:35, Ben Zong-You Xie wrote:
> glibc does not define SYS_futex for 32-bit architectures using 64-bit
> time_t e.g. riscv32, therefore this test fails to compile since it does not
> find SYS_futex in C library headers. Define SYS_futex as SYS_futex_time64
> in this situation to ensure successful compilation and compatibility.
>
> Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
> Signed-off-by: Cynthia Huang <cynthia@andestech.com>

This Signed-off-by chain is broken. See

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin

and the following chapters.

Thanks,

        tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-26 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27  9:35 [PATCH] selftests: futex: define SYS_futex on 32-bit architectures with 64-bit time_t Ben Zong-You Xie
2025-06-26 21:57 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).