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 3AB07345730; Tue, 26 Aug 2025 13:49:12 +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=1756216153; cv=none; b=Sb8FJ3quA7w/+CFOfhl4to78B0Y0pg2ntxZGW04lbLUWEB8PX4KlHnXpYtwCmDlJtxFD43q94SoSJ6jp29EhOTRfOV4MkeSZbwkE/+Ph/4g7VqRBXOqRko9WnH0A+S4WEuHTlp7mEk7DerT5AS+xCUyT6iEm+NDTSY/FpBm3ES4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756216153; c=relaxed/simple; bh=xob7H0OK9Pp7xFsOKYsn9jSFA/1q7dk4Ih8QjrdTxHE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CtaFo2uuvdrU2NlJ0lU8PJtWfwomIeAd5afTYquRHr+Yqq6luDpx9X7l3BaHzdejJIcbXb5laxmuPiAzqZM/yiyGxtY2Ojx+mNo/pYimPqF3YD6dxGUMJtkgRKBQRpFIep6Fd2oKTZAFX2cAODQDf1R8BeFMvlsRHcIS5FXl5Mg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ix8QfpXV; 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="ix8QfpXV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71A8CC4CEF1; Tue, 26 Aug 2025 13:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756216152; bh=xob7H0OK9Pp7xFsOKYsn9jSFA/1q7dk4Ih8QjrdTxHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ix8QfpXV0fpTHlp8Et25wIOKbKYI5Hm3YxQwT3f0dmzlqhFaOPAfG3Ty2qYHmr2kR Tzhd57oE4p0Pqd2g+tF9fGW0IOOlW84ePlhmSlYqzbhmimev43NqxJEFTM8v8zVIE/ 56OtWz+obX6YNJ+lMvQXk+7z0tG87zojyfVUnqo8= 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.15 297/644] selftests/futex: Define SYS_futex on 32-bit architectures with 64-bit time_t Date: Tue, 26 Aug 2025 13:06:28 +0200 Message-ID: <20250826110953.744564690@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@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 5.15-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