From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id 5874E383820F for ; Tue, 31 May 2022 18:59:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5874E383820F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=moxielogic.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=moxielogic.com Received: by mail-ed1-x529.google.com with SMTP id x62so6956659ede.10 for ; Tue, 31 May 2022 11:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=moxielogic-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5Taba5D6m6qo0A9O01QMKCyNMuIM6yravbUMITJbNnk=; b=7S6m4LJBgI1GZyRJT39Uax1VTx/IY3Zun5hhXtA/QxPikJeJZDIBlyVdGOUHQpWyFt bmnAxzAmyiCTOt1w/2duxe8q7esFnpe0y7JhZ124zP8l9ZH4PDknj26jJoXHrPdQ2Gne JYYNFsaqjhQ1K7KV/74xlqJS3xDEE9qSUQb0GPXGjlhClFsp3Vkr+ZGfjWNSWa8BQa59 6eNT58lxP5oUXDTxRitCXdo2DwhvHN7TxJL3Nvv9ucrsf4SvGL2wvKakYc2+Yl1hAPI4 tgg7oMCKWZIB5uML5kFZSljHnA3zEgHNbXWUt489+ixphP+Kd2Z55YFgDwuQBjGyysnw oXTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5Taba5D6m6qo0A9O01QMKCyNMuIM6yravbUMITJbNnk=; b=MrobthLgykBWev0Fm+cq+GHDZhDG9aPIIwvxs1beez9HjY1YJyahoW/FzFzjAcmRO4 2cSgWnOuxq1+obgJeb9VBQHM7+uJPxy1qx4gCbNXa9R+3Zku8VH3rSP9xHFKbkxvPLHT EvqKZVbTo4m1duN3CR/mpGggD+8KoK+dgXDzWg0eg/Tcbh+kfRf7ur2rTeaKMIRjWR4q 1r1mdM+g7rh+cntc2O1baAh5QE9Hh2coa4Jzb+dxj1/6fKAnQn3OlKe7HutKwASeSru5 NYfBmDgb4AB27E0yPaLFcWFbRRhJn+8Tfr9vga5Yg/FTJDcXdSye43n8fWjbATr3gJLR 3GhQ== X-Gm-Message-State: AOAM530RBKL4qtyyJBo8wBHrKThyAE9dPV5oyQiJ8pQzmLlqDRuHrNC5 QvEtoL6V3ZjChHMPod+MF0962yAkpFVR11SR3WtywS4vvBzdww== X-Google-Smtp-Source: ABdhPJyLCNPr4u41p41QqyMPUCFbFt+nUGhjPGZqKZIRX8VuMxYHzAL0ldAgO2EthbkBcosZTaDSCfSqa5HLpx+FV1Q= X-Received: by 2002:a05:6402:368a:b0:42d:ef42:f727 with SMTP id ej10-20020a056402368a00b0042def42f727mr2619905edb.204.1654023553771; Tue, 31 May 2022 11:59:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Anthony Green Date: Tue, 31 May 2022 14:59:03 -0400 Message-ID: Subject: Re: Change in libffi behaviour -- large struct args To: DJ Delorie Cc: libffi-discuss Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libffi-discuss@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libffi-discuss mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2022 18:59:16 -0000 On Tue, May 31, 2022 at 11:53 AM DJ Delorie wrote: > While this is technically an ABI change, if the "old" ABI never worked, > I can't see how this would break anything by changing. I wouldn't even call this an ABI change. The new implementation will be ABI compatible. This is really a bug fix. In fact, some ports have always done the right thing. > I will add that passing structs is likely more complex than you think ;-) The rules about passing small structs in registers can be complex, but libffi always did that right. AFAICT, the only complexity around passing large structs in memory has to do with structure alignment, but we have all of the info needed to do that right. I really think this is worth fixing, even after all of these years. Users currently need to know the threshold size for structures to pass in memory vs registers, and this varies per target, and per ABI. It's an abstraction leak that we can easily fix without causing too much pain (if any). AG