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 26FAA29BDB6; Tue, 26 Aug 2025 13:17:30 +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=1756214250; cv=none; b=GYNMLHvgO+OecMauZ5hjC8Yh/o9p7au+6boWoM4TC9b8WNw44y7fCnwKuipQswA44mnTPtEIZeapcp75o4Ifqzt37NdNiSwNEz5HvWfUEbAVQ/Kj4cqUinW5+ylMHMH9SHNuaQopFZUn04UmXSmOE93xM2gg1px8HmlteMBH/QA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756214250; c=relaxed/simple; bh=Z9tvk1Q37JQOghTZnydZD5y2z0SpRxcrzILBxhdHLvE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D9FcU46xD1qNYGhLBq4ENoxB3cPebSTkbpkvlIibAXmIFLS4LETuzNZp9OerskyDMnkCzjgXUfXlL8SVviiysRckWazGJO4m37R6KVY3lSeNoCgMu8VrzTuOAhR19VlAtGx/bniOnS4NKyIQgQMBfefXnu/1lMvEsRBroX3Axk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DTb0hj0R; 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="DTb0hj0R" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACE45C113CF; Tue, 26 Aug 2025 13:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756214250; bh=Z9tvk1Q37JQOghTZnydZD5y2z0SpRxcrzILBxhdHLvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DTb0hj0R5BE5FY22hfIe2mjdCb/OSaca5OpGfpOTxhfq5oaox4fDjFAC096hATlNc YSkG6+RfJiL1CGZn0YjU3NMDzdwXBlXfReSYlNN0zGMUjuofGjkIzTaIbk/S/LG4p4 sjZXbr35ppgsr3KF0QucMnhQsgKc9pNA9ffyqwU4= 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.1 067/482] selftests/futex: Define SYS_futex on 32-bit architectures with 64-bit time_t Date: Tue, 26 Aug 2025 13:05:20 +0200 Message-ID: <20250826110932.488502557@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110930.769259449@linuxfoundation.org> References: <20250826110930.769259449@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.1-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