[PATCH v2 0/5] linux: Avoid va_list for generic syscall wrappers if possible
Xi Ruoyao
xry111@xry111.site
Mon Mar 27 14:44:48 GMT 2023
On Mon, 2023-03-27 at 10:04 -0400, Carlos O'Donell wrote:
> In summary, I think this is a compiler problem
Definitely true.
> and that working around this in glibc
> is going to result in:
>
> - Odd corner case ABI issues between public declarations of variadic functions and
> internal non-variadic definitions.
>
> - Poorer testing of #else code that uses variadic arguments, as the public interface
> requires.
>
> I don't support going in this direction.
Valid reasons. Abandon this series then.
But I hope these could be raised earlier (in the discussion about
LoongArch syscall.S) so I wouldn't write all the code :).
> Is there an alternative that could generate better code that doesn't go this way?
For LoongArch I can improve GCC to save only the GARs containing the
arguments really used in va_arg (i.e. one GAR for things like open() or
fcntl() instead of all 8 GARs), but I guess the patch will be delayed
into GCC 14.
Generally I've not got an idea about how to make GCC avoid saving GARs
unnecessarily with va_arg.
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
More information about the Libc-alpha
mailing list