[PATCH] Force 64-bit time based syscalls for TIMESIZE==64 on 32-bit arches
Vineet Gupta
Vineet.Gupta1@synopsys.com
Wed Mar 11 18:44:15 GMT 2020
Hi Florian,
On 2/25/20 1:27 AM, Florian Weimer wrote:
> * Vineet Gupta:
>
>> +/* Override syscalls for asm-generic ABIs with 64-bit time. */
>> +#if __WORDSIZE == 32 && __TIMESIZE == 64
>> +
>> +# undef __NR_futex
>> +# define __NR_futex __NR_futex_time64
>> +
>> +# undef __NR_rt_sigtimedwait
>> +# define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64
>
> I'm not totally unsympathetic to this in principle, but I think if we
> start messing more with the system call numbers in this way, we should
> move away from the __NR_ prefixes and use our own constant names.
>
> Otherwise, the results could be very confusing, especially if there are
> exceptions to this exception and we need the original system call number
> after all.
OK I understand that redef could get messy. How about simple #undef of the 32-bit
syscalls so they are not available in general and rely on generic code to fallback
and DRT.
Do note that this is mostly a "preventive" fix (for single exception see below)
and new arches will hopefully not trip here as they won't have the 32-bit syscalls
to begin with. It is applicable to arches with slightly older version of the
asm-generic ABI. And for same reasons I can even move those into ARC sysdep.h -
what would you recommend.
FWIW the only relevant piece here is futex which generic lll code expects
__NR_futex and we need to undef/redef to 64-bit variant (either here or in ARCH
specific sysdep.h for RV32 and ARC) so having that part atleast in generic code
will help future ports avoid the copy/paste.
Thx,
-Vineet
More information about the Libc-alpha
mailing list