[RFC PATCH 4/4] linux: remove time64 redirects for __TIMESIZE=64 architectures
Arnd Bergmann
arnd@arndb.de
Wed Nov 11 13:07:51 GMT 2026
On Wed, Nov 11, 2026, at 13:09, Adhemerval Zanella Netto wrote:
> On 10/11/26 11:51, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> In theory, it would be possible to have an architecture with __TIMESIZE=64
>> but !__ASSUME_TIME64_SYSCALLS, but all four of the 32-bit architectures
>> that set __TIMESIZE=64 redirect the time32 syscall macros (__NR_futex
>> etc) to the time64 versions, which means that in practice they all assume
>> they are running on linux-5.1 or higher even if the symbol is not set.
>
> The symbol is already set on all four of them, because their configure
> fragments raise the minimum kernel to 5.1 or higher (arc 5.1.0, or1k
> 5.4.0, riscv32 5.4.0, loongarch32 6.19.0). So the kernel-features.h hunk
> does not change anything for them.
Ok
> It does break every other 32-bit ABI, though.
>
>> Note that only openrisc and arc actually support time32 syscalls at all,
>> while riscv32 and loongarch32 require the time64 versions.
>>
>> The users of the time32 syscall macros are all converted to use the time64
>> names explicitly when __ASSUME_TIME64_SYSCALLS is set, so simplify the four
>> architectures here by removing the workaround and just always setting it.
>
> Not all of them. nptl/pthread_mutex_{lock,timedlock,trylock,unlock}.c
> put all the PI mutex code under '#ifdef __NR_futex'. Without the
> redirect, __NR_futex is undefined on riscv32, loongarch32 and arc (their
> arch-syscall.h only lists futex_time64) and on or1k (which still #undefs
> it in sysdep.h).
>
> All the PI cases then fall into the 'invalid kind' default.
Ah, I actually had an earlier version that fixed this by changing the
#ifdef to "#if defined __NR_futex || defined __NR_futex_time64", but
mistakenly convinced myself that this would not be needed and dropped
this from the series before posting.
Arnd
More information about the Libc-alpha
mailing list