From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 54B133858D20 for ; Wed, 9 Aug 2023 14:10:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54B133858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-99bcfe28909so943771666b.3 for ; Wed, 09 Aug 2023 07:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691590229; x=1692195029; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hpwWDP5LTWYxHVgrUauI8XyGAxCJnyQTf4U3jyeGl4c=; b=j2/WicZTcHAc/qhf6iu4uWycx8H23tRiCkQEbJhTid6YVfltW74/xyv0DcTfHVProK l0x/k40JD2lUPP0+PML3h/a0BTRgNgigLduuvQ8RoaneJ8X2PBZMKnjIDd4hqVo7KxMK Wj/Iiu7biDm8fxWV2UZBLY0sovK7g+uT1G4TKlPDuN1mUqyapGFCiPnoTTbNEicapm4K ULWhp9ExF4mT5lrZyB1+cSN1RTFv6y9u+oQb3jVn378V8CewxlzJGZunn161El8lWSMA EWrbjnpCLvZlTwZDqoFezqsjSoFdQ32EfIWcbEOP4UmzD2vyAD/Mg/GetlgYJU+ldPSP DOdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691590229; x=1692195029; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hpwWDP5LTWYxHVgrUauI8XyGAxCJnyQTf4U3jyeGl4c=; b=TLlMH4BJybT+tDErj295JZw/s/Xc733c8YYvPSTRe0nyWIL0d3XhnIQms94j5vNgmc sjLo/7EefZ09Lp+7APzYRpppmYduM7MbGgc7eTCs8JPgPqxWbCIeWXowQng52QGWTkD2 qsBhPU5C2vAPaCFNdY6opfH7gQbJ+aG5Z5QIpz+3ViyXNO9Sq8piSflv9qrNBeVfISMm rwPhfybuOn88cevvbEFY7ovjJj/V0KGO6nSiDC9j+ujvv1BxJpCXpsOiTjOOsguvDMOt eClsYnXPahaAnltXm16RWQCy0kc7FG+zDg09E6/m1jj5vj3hL1IO/pWU/EoyGNMTCgQU UHzA== X-Gm-Message-State: AOJu0Ywo34Hvs12QQ5/aR9E50vpXl6mfmh3BqFzmp8jetem9bdcsYVRo Mjzo97GoR7MEhoN18LC3b8C5pdQqL/sRoInQJaZW3BiCi7w= X-Google-Smtp-Source: AGHT+IEJuYTOPiQe+aAqgXIzVLIbyl85OyiA4VA5FpTblAKEc/nODDe5jMpA5ACVmoN9rt6lw7Mx/R1MP/GfV6e+gn4= X-Received: by 2002:a17:906:3188:b0:98e:7a7:60b0 with SMTP id 8-20020a170906318800b0098e07a760b0mr2308671ejy.65.1691590228839; Wed, 09 Aug 2023 07:10:28 -0700 (PDT) MIME-Version: 1.0 References: <0B281969-EB24-405E-B41A-83429CDDA8FE@sandoe.co.uk> <6B6C385F-6E6A-4EC2-92CC-FD7EB8E553D7@sandoe.co.uk> In-Reply-To: <6B6C385F-6E6A-4EC2-92CC-FD7EB8E553D7@sandoe.co.uk> From: Jonathan Wakely Date: Wed, 9 Aug 2023 15:10:17 +0100 Message-ID: Subject: Re: [RFA/C] Reimplementation of std::call_once. To: Iain Sandoe Cc: libstdc++@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham 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 Wed, 9 Aug 2023 at 14:12, Iain Sandoe wrote: > > > > > On 9 Aug 2023, at 13:53, Jonathan Wakely wrote: > > > > On Wed, 9 Aug 2023 at 13:51, Iain Sandoe wrote: > >> > >>> On 9 Aug 2023, at 13:38, Jonathan Wakely wrote: > >>> > >>> On Wed, 9 Aug 2023 at 13:22, Iain Sandoe wrote: > >>>> ===== > >>>> the implementation in mutex.cc can sit togethe with the old version so that the symbols for that remain available (or, for versioned libraries, the old code can be deleted). > >>> > >>> If you have old and new code sharing a std::once_flag object you're dead. > >> > >> indeed - I was only considering the case where existing binaries needed to run with the new lib, not the case where code compiled with two different impls was combined. > >> > >>> Something like the abi_tag transition for std::string in GCC 5 would be needed. > >> > >> That sounds quite complicated and likely to produce similar pain? > > > > Not nearly as complicated (since we don't use std::call_once > > throughout the entire library) but it would still cause pain for the > > ecosystem. > > I was, at one stage, considering the idea of [the new impl] copying the trampoline lambda address to the (old) => __once_call and the closure address to (old) __once_callable and then amending __once_proxy to handle this. > > It would still be broken w.r.t. nested call_once cases, but no more broken than existing. > > However, that means lying about the signature of the old __once_call. > > .. and it does not solve the issue that the size of the once_flag has changed. > > >> ==== > >> > >> Presumably an alternative is that I just have to accept that Darwin needs to use a versioned library (which is a direction I am close to heading in because of co-existence of mulitple c++ runtimes anyway). > > > > We do need to fix PR 99341 somehow, I just don't know how. > > yeah, tricky. > > that PR shows as closed, FWIW - but as noted at the start I think x86_64-linux-gnu is also broken w.r.t once-called fns throwing Oh sorry, PR 66146 is the right one.