From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 4D02A3858D20; Thu, 11 Apr 2024 18:28:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D02A3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=googlemail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4D02A3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712860104; cv=none; b=mrOrew8Yz0CG9GWy2+iruKOr4n+hmXDzdcY123b0Rzq94LX9jOxMe/lQhzlhBe2yGEQDciOdn88THPzpJL3I6BgCYg3Fn8Xbs59E6/JPtH8sOjC7LLcj//6p54biO6OfIW3iAqz78Wu1N307M15HLClIOjIrtduo7W9dMj6Gvu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712860104; c=relaxed/simple; bh=1VPwPdXyrywluCEtac70C3l+OPCo2C9ydESZ3+o+PH0=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=iNtTbF5dwcAH50MXo1ZNFAWT0ZP742v56GsfeBI6nkXs19LYFFiW+5q+KM3YwjXn807MMcu1Pjohou+zbvXwA0RohE+qzuheqTx9qRUQZINlacyV8/SRJFRni2nVizW5PYFmSZkflKJ2TY295NRwUMubzgB/sJmfAPXkzinc6Ak= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-516dbc36918so193649e87.0; Thu, 11 Apr 2024 11:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1712860100; x=1713464900; darn=gcc.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GnBf+SgHATdj+iHhyfyMfAjhSb8oA++01V0Y2a6eOOE=; b=Dnv3Z0GAqR9wklgK2hMXvYjv8lvxbR8QpLymVn68QHroVF3X2QX0uJhPef18Ugb6t0 OqcLMUR+QrHt0u2APz7t7Hbw6rUmv8Qy0IgTK+7OpOXUxmJy7t6JKhb/lwjiR8dE+dgQ dV/4zffndgxs8WSFhb+2mbwfTOefqk7y7zsGvWZlOyG5Hl4AU+XNdFr2atL4r9tMmpRK ajfJjozFyWji7sMQOWR3zMWj7rrjDccT6SAU4qHQGFtJtME9vAwUXdwJUTwj7s33VJ3B YkNR3MwyKUJpg8nDnhptAZZs22UYzekqWmmFbMhpdrYJUaouvEcqpfCXWEgiV6f8iFjR JwdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712860100; x=1713464900; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GnBf+SgHATdj+iHhyfyMfAjhSb8oA++01V0Y2a6eOOE=; b=B+THfppiE8ECJC3FNVmiqsiqXbcX2yXaulqvjujeeFbvcajv1KOzZYdw5Ag6dG892v jZcSJS3oI3H1Ovkm9m/YF9sY5607UhbszMY0WAtEYz1MKj/FfkTtA/bnWH2WrKBtSuDE +0dD7D2aGoWNyEaqlvN4d1rP9Jtq/7DaFv83Er4Ui+u7RRvTLmXpyzTtuvZxMBtTqF4h RDYj7eSVwNgSPQUwPZMsT6ze8N8f0GWWRj5zufK8LmC7riO9CF5Kd3C49q6STYYssYG7 ZYor4+uAGiXxAEISNFKCd93OXVAbh2laFn6EtWbH6g+OtVrmIu8QNH9cfuKg81Vh61n7 OMlA== X-Forwarded-Encrypted: i=1; AJvYcCWQd/wkvrXoVeAegSvGMEbgC1+5+yC75V2IpWUxfsJZUKY2lb6/xlYxP281PDol9CBfUVJlqaX5YSqZ/yvrcZDjr5OgiFewuQ== X-Gm-Message-State: AOJu0YwIp1uiLJRjlxUw5pZ4orf0mltrG7cgjIMvaOrIF1l/lNWSuDfC M48m2TBe+CEFQ5DTVjxXNHWJn97HEpFNwbSnM6egVTI4V4394Ufm X-Google-Smtp-Source: AGHT+IGX3ZAwVQ546KWTV4OZYE55EpccR4NEHC/bzlnOzrDFCLFzsa1Vj0YVwmHTTY9K3ZDG8cSnpg== X-Received: by 2002:a05:6512:485e:b0:516:d0e7:71d1 with SMTP id ep30-20020a056512485e00b00516d0e771d1mr273148lfb.68.1712860099979; Thu, 11 Apr 2024 11:28:19 -0700 (PDT) Received: from smtpclient.apple (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id g21-20020a19ee15000000b00515d4d488c2sm267402lfb.263.2024.04.11.11.28.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2024 11:28:19 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: [PATCH] libstdc++: Compile std::allocator instantiations as C++20 From: Iain Sandoe In-Reply-To: Date: Thu, 11 Apr 2024 19:28:17 +0100 Cc: libstdc++ , GCC Patches , Ville Voutilainen Content-Transfer-Encoding: quoted-printable Message-Id: <25282E43-F9A3-40A0-A5B5-F787540F2120@googlemail.com> References: <20240411172142.587623-1-jwakely@redhat.com> To: Jonathan Wakely X-Mailer: Apple Mail (2.3696.120.41.1.8) X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 11 Apr 2024, at 18:33, Ville Voutilainen = wrote: >=20 > On Thu, 11 Apr 2024 at 20:22, Jonathan Wakely = wrote: >>=20 >> I'm considering this late patch for gcc-14 to workaround an issue >> discovered by a recent Clang change. >>=20 >> I'm not yet sure if Clang is right to require these symbols. It's not >> really clear, because always_inline isn't part of the standard so = it's >> not clear how it should interact with explicit instantiations and >> modules. Exporting these four extra symbols doesn't hurt, even if = Clang >> ends up reverting or revising its change that requires them. >>=20 >> Another way to fix it would be to suppress the explicit instantiation >> declarations in for C++20, so that the compiler >> always instantiates them implicitly as needed. We do similar things = for >> the explicit instantiations of std::string etc. so that new member >> functions that aren't in the .so are implicitly instantiated as = needed. >>=20 >> That would look like this instead: >>=20 >> --- a/libstdc++-v3/include/bits/allocator.h >> +++ b/libstdc++-v3/include/bits/allocator.h >> @@ -281,7 +281,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >>=20 >> // Inhibit implicit instantiations for required instantiations, >> // which are defined via explicit instantiations elsewhere. >> -#if _GLIBCXX_EXTERN_TEMPLATE >> +#if _GLIBCXX_EXTERN_TEMPLATE && __cplusplus <=3D 201703L >> extern template class allocator; >> extern template class allocator; >> #endif >>=20 >> But we might want to export the new functions from the library >> eventually anyway, so doing it now (before Clang 19 is released) = might >> be the best option. I think clang-19 will branch after gcc-14 (so the urgency is more on the = GCC side - or making a decision to back out of the clang change. >>=20 >> Thoughts? >=20 > I think the symbol export is a fine solution. Both of these solutions > work, so I don't have a strong preference, > I have a minor preference for not suppressing explicit instantiations > that are otherwise already there, > but that is indeed not a strong preference. In the case of interaction between modules and items not identified in the std, the only solution is to get agreement between the = =E2=80=98vendors=E2=80=99. If we emit the symbols, then that gets baked into the libstdc++ ABI, = right? Is there an alternate solution that we can propose? (there is a modules implementer=E2=80=99s group that meets bi-weekly, including next Tuesday = -=20 this includes representation from GCC, clang, MSVC and usually some of the larger players like google=E2=80=A6 it could be a topic of = discussion if there is some tidier proposal we could make. Iain