[PATCH] support: arm: Add libc_do_syscall function to libsupport routines

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Mar 16 14:25:14 GMT 2021



On 16/03/2021 11:17, Lukasz Majewski wrote:
> Hi Adhemerval,
> 
>> On 16/03/2021 02:10, Florian Weimer wrote:
>>> * Lukasz Majewski:
>>>   
>>>> Hi Florian,
>>>>  
>>>>> * Lukasz Majewski:
>>>>>  
>>>>>> It fixes the following error on ARM 32 bit port:
>>>>>>
>>>>>> y2038-glibc/support/support_path_support_time64.c:34: undefined
>>>>>> reference to `__libc_do_syscall'
>>>>>> collect2: error: ld returned 1 exit status    
>>>>>
>>>>> Should libsupport use syscall for direct system calls?  
>>>>
>>>> I'm not sure what is the correct approach here.
>>>>
>>>> In my case - armv7, 32 bit - in
>>>> support/support_path_support_time64.c the utimensat_time64 syscall
>>>> is called, which is wrapped to INLINE_SYSCALL_CALL(), which calls
>>>> __libc_do_syscall ASM ARM function.
>>>>
>>>> This function is only defined for i386 and 32 bit ARM (in e.g.
>>>> sysdeps/unix/sysv/linux/{arm|i386}/libc-do-syscall.S)  
>>>
>>> Yes, and using the syscall function would avoid this issue.
>>>
>>> So the question is, why INLINE_SYSCALL_CALL?  
>>
>> The __libc_do_syscall is in fact only used thumb mode used as default,
>> and the direct syscall is used because there is no direct support
>> for using 64 bit types on ABI with default 32 bit time.  We might 
>> eventually remove the INLINE_SYSCALL_CALL once 64 bit time support is 
>> implemented (so we build the file with _TIME_SIZE=64).
>>
>> The patch itself looks ok.
> 
> Thanks for review. I will apply it if Florian don't mind.

Please replace the INLINE_SYSCALL_CALL with a simpler syscall(2) so
it won't require to add libc-do-syscall.


More information about the Libc-alpha mailing list