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 F26DE335BAA; Mon, 18 Aug 2025 13:50:08 +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=1755525009; cv=none; b=uhe01DommgIRICaYO0gWPVUCQBDMBegq1ruy3H8KFvkRTc5mbFE3QIMBEKsK9PtXRA6qsP3iowVybINN/cvlEIVGnXRvfJUmuyTVRsZvDYLfOlUjwf32u4xPWkAkSCC+ephShi7mgb3KHEesK0f2vgjf0IcChNzIW70ErzdIUlk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755525009; c=relaxed/simple; bh=Zk8BlyGHNydMvYfGu79HbTb4UCKV592wKQSXLydrNzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ne2ZPFOs9AVlewoSjtp4zDv9VpitF8kVCkhNQRYW7ggpYh4udo3cWnveyAHmXJ7Z1R0kbxwe1gFJPO4zrlzkc+jFiypMzQU2AVM1ZiAYqIgMmIh99w2fEp5atL9AUw2GDBA6TSlOBeC2FcEiAjijCIjoMwi+UyK58qTjQTpiubM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=E8NKMPwt; 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="E8NKMPwt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1719AC4CEEB; Mon, 18 Aug 2025 13:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755525008; bh=Zk8BlyGHNydMvYfGu79HbTb4UCKV592wKQSXLydrNzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E8NKMPwtyHIbLT7d5JA4//FKOtewup5hai2qp44Q4Yg6oN228C0zuv68UJ66M1kb4 CQ69/acvW58WFtqMBdgUYnYBB1eg73qpLbe1+B2zjyB99zcVKYWZwK4qv8yzdwdPKy tC5FC9+ik1/GZZu12Mvd8LznKAl+bRnxUWxCHRns= 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 6.16 129/570] selftests/futex: Define SYS_futex on 32-bit architectures with 64-bit time_t Date: Mon, 18 Aug 2025 14:41:56 +0200 Message-ID: <20250818124510.792303122@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124505.781598737@linuxfoundation.org> References: <20250818124505.781598737@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.16-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