From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Ben Zong-You Xie <ben717@andestech.com>
Cc: tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org,
dvhart@infradead.org, dave@stgolabs.net, andrealmeid@igalia.com,
shuah@kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, tim609@andestech.com,
Cynthia Huang <cynthia@andestech.com>
Subject: Re: [PATCH v2] selftests: futex: define SYS_futex on 32-bit architectures with 64-bit time_t
Date: Sat, 28 Jun 2025 14:28:42 +0500 [thread overview]
Message-ID: <0b5231e2-8dd0-4bbf-a0d3-0f6460bc8030@collabora.com> (raw)
In-Reply-To: <20250627090812.937939-1-ben717@andestech.com>
On 6/27/25 2:08 PM, 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: Cynthia Huang <cynthia@andestech.com>
> Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
> Changes since v1:
> - Fix the SOB chain
>
> v1 : https://lore.kernel.org/all/20250527093536.3646143-1-ben717@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
next prev parent reply other threads:[~2025-06-28 9:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 9:08 Ben Zong-You Xie
2025-06-28 9:28 ` Muhammad Usama Anjum [this message]
2025-07-06 8:19 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b5231e2-8dd0-4bbf-a0d3-0f6460bc8030@collabora.com \
--to=usama.anjum@collabora.com \
--cc=andrealmeid@igalia.com \
--cc=ben717@andestech.com \
--cc=cynthia@andestech.com \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
--cc=tim609@andestech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®