__syscall_error (was Re: [PATCH v4 13/15] ARC: Build Infrastructure)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/31/20 3:48 PM, Joseph Myers wrote:
> On Tue, 31 Mar 2020, Vineet Gupta via Libc-alpha wrote:
> 
>> On 3/27/20 11:42 PM, Vineet Gupta via Libc-alpha wrote:
>>>>> +++ b/sysdeps/arc/Versions
>>>>> @@ -0,0 +1,6 @@
>>>>> +libc {
>>>>> +  GLIBC_2.32 {
>>>>> +    __syscall_error;
>>>>
>>>> Why does __syscall_error need a public symbol version?  If it's used by a 
>>>> library other than libc, that means it needs to be exported at some symbol 
>>>> version - but it only needs a public version (as opposed to GLIBC_PRIVATE) 
>>>> if it might be used by user programs linked with glibc (if it's used in 
>>>> crt*.o, lib*_nonshared.a, or inline functions in installed headers, for 
>>>> example - or in libgcc.a, libstdc++.a, etc. (GCC static libraries)).
>>>
>>> We'll historically I've preferred an out-of-line errno setter in the syscall
>>> wrappers and those are used in libpthread et all as well but not expected to be
>>> used by user programs. See my sysdeps.h
>>
>> Ok so this will not be called directly from user programs, but indeed 
>> could end up in non shared libs and/or inline functions in headers, so I 
>> suppose this is fine ?
> 
> What inline function or object in lib*_nonshared.a / crt*.o / GCC static 
> library has a reference to this symbol?
> 
> If there's an inline function referring to this in an installed header, we 
> can consider whether that inline function *should* be referring to it.  
> Similarly if there's a reference in crt*.o / lib*_nonshared.a / GCC static 
> libraries, we can consider if that reference *should* be there or if the 
> function in question should actually be calling some function from libc.so 
> that does the syscall there.

The assembler macros in syscall template for generating wrappers use
__syscall_error (sysdeps/unix/sysv/linux/arc/sysdep.h).

If public Version is removed, I get errors like below:

| arc-glibc-linux-gnu-gcc   -shared -static-libgcc -Wl,-O1  -Wl,-z,defs -Wl,
| -dynamic-linker=/lib/ld-linux-arc.so.2  -Wl,--version-script=/SCRATCH/vgupta
| /gnu/build/glibcs/arc-linux-gnu/glibc/librt.map -Wl,-soname=librt.so.1
|
| ...
| a - mq_setattr.o
| a - librt-cancellation.o
| /SCRATCH/vgupta/gnu/install/compilers/arc-linux-gnu/lib/gcc/arc-glibc-linux-
| gnu/10.0.1/../../../../arc-glibc-linux-gnu/bin/ld: /SCRATCH/vgupta/gnu/build
| /glibcs/arc-linux-gnu/glibc/rt/librt_pic.a(mq_setattr.os): in function
| `mq_setattr':
| /SCRATCH/vgupta/gnu/src/glibc/rt/../sysdeps/unix/syscall-template.S:80:
| undefined reference to `__syscall_error'

And this change goes back to initial port (in 2016) where openssh/libcrypt.so was
failing to link somewhat similarly.

Looking as RISCV code, they opencode __syscall_error for !IS_IN (libc) which I was
hoping to avoid.
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-snps-arc



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux