From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FE5335E4FF; Tue, 26 Aug 2025 14:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219024; cv=none; b=o6O0MN8uiruaMKIkI1SWXB72p+uYUIRmC28nvFL3U67CEW/J9msUsHNhoHdXKpQMllocX8fpMhSgIR52H+4iFlT67EoAiCCLJn9NQOzAnWPTdNMPx8Ax5pYZjAaVBDCEyVemK3czOiEVAmvcPOL38utSL/SKWskDcZ+Vmcgje0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219024; c=relaxed/simple; bh=NkT0GFEIVhaPGqxi6ft7Cqv/DMibMmnJ/xEI9doLq3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uuDOLALzetM62Jy7zoDUGGlz7p5uJzlZ3rk5IrWVfw33TZYfoQBtq0LvuuUhGG+NcNODo/8PD1+ahp8UQfzoSFgugPjumeOUFTgIB27Z+c8YYLRykOjjVVx31vC27AjQd6OfXwAshs7JFaLOMI1NWojuW5m9Zss3ZIET9maCnTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hcviJe4y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hcviJe4y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C64B2C4CEF1; Tue, 26 Aug 2025 14:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756219024; bh=NkT0GFEIVhaPGqxi6ft7Cqv/DMibMmnJ/xEI9doLq3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hcviJe4ych0o6Kb5KOXusuK2AON4ujOAtwfXj0zE5ZC+0EwVUvj6XF+TtEvJocbgZ yYKJ0nlBbJ+dnfoCngK0bBCNVaXVvfRncXxtrBVd9qPXHsxZMncrH+aNzwf7ZzYuOO EtgEUiU798xcRRsDq4o+P6owcat1bU/TxuIU2x00= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Cynthia Huang , Ben Zong-You Xie , Thomas Gleixner , Muhammad Usama Anjum , Sasha Levin Subject: [PATCH 5.4 182/403] selftests/futex: Define SYS_futex on 32-bit architectures with 64-bit time_t Date: Tue, 26 Aug 2025 13:08:28 +0200 Message-ID: <20250826110911.909664721@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110905.607690791@linuxfoundation.org> References: <20250826110905.607690791@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cynthia Huang [ Upstream commit 04850819c65c8242072818655d4341e70ae998b5 ] The kernel does not provide sys_futex() on 32-bit architectures that do not support 32-bit time representations, such as riscv32. As a result, glibc cannot define SYS_futex, causing compilation failures in tests that rely on this syscall. Define SYS_futex as SYS_futex_time64 in such cases to ensure successful compilation and compatibility. Signed-off-by: Cynthia Huang Signed-off-by: Ben Zong-You Xie Signed-off-by: Thomas Gleixner Reviewed-by: Muhammad Usama Anjum Link: https://lore.kernel.org/all/20250710103630.3156130-1-ben717@andestech.com Signed-off-by: Sasha Levin --- 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.39.5