From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 4E45B3858401 for ; Mon, 27 Mar 2023 14:45:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4E45B3858401 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1679928316; bh=vb3S6GGHxZezTcruO1uds7ex98TT50OCo9bupxWfQ1o=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=YxXWsBnAOj74OlHEtV80VJ2qTs+ZGIbLiTdQyts4ZgDMdLyy4SRYCF+tuhZEMf7S0 OAaI32xTHLpiPz1A7l2DEJCNEkc8hRDG8b9uFueVrc9AlI/j0Bs+SoyEOsMsGmVerE jyzcLBX5qSd8Zy+q/EImr98f/Pk5CbGEyEkrAAYk= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id E838765C77; Mon, 27 Mar 2023 10:45:14 -0400 (EDT) Message-ID: <61ab954501daa24eed8e05638d1c2aec18a941a0.camel@xry111.site> Subject: Re: [PATCH v2 0/5] linux: Avoid va_list for generic syscall wrappers if possible From: Xi Ruoyao To: Carlos O'Donell , libc-alpha@sourceware.org Cc: caiyinyu , Wang Xuerui , Adhemerval Zanella Netto , Andreas Schwab , Florian Weimer Date: Mon, 27 Mar 2023 22:45:12 +0800 In-Reply-To: <98295b42-c079-c32c-31d6-bb45013342ee@redhat.com> References: <20230325140815.4170296-1-xry111@xry111.site> <98295b42-c079-c32c-31d6-bb45013342ee@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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: >=20 > - Odd corner case ABI issues between public declarations of variadic > functions and > =C2=A0 internal non-variadic definitions. >=20 > - Poorer testing of #else code that uses variadic arguments, as the > public interface > =C2=A0 requires. >=20 > I don't support going in this direction. Valid reasons.=C2=A0 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. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University