selftests: futex: define SYS_futex on 32-bit architectures with 64-bit time_t
PATCH 1/1 selftests: futex: define SYS_futex on 32-bit architectures with 64-bit time_t
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.
--- tools/testing/selftests/futex/include/futextest.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/testing/selftests/futex/include/futextest.h +11 -0
@@ -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
Signature · 1 line
2.34.1
Quoted 7 lines · Ben Zong-You Xie
glibc does not define
SYS_futexfor 32-bit architectures using 64-bittime_te.g. riscv32, therefore this test fails to compile since it does not findSYS_futexin C library headers. DefineSYS_futexasSYS_futex_time64in this situation to ensure successful compilation and compatibility.Signed-off-by Ben Zong-You Xie <[email protected]>Signed-off-by Cynthia Huang <[email protected]>
This Signed-off-by chain is broken. See
and the following chapters.
Thanks,
tglx