From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 78FAE3858C39 for ; Fri, 13 Jan 2023 16:33:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78FAE3858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673627606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XH9Hid9ZKX8EjrNBq0XZJC8PsPAfd7o1CftbCtfzRio=; b=cB6UWACJwgcB5BuPlGVNem91kiKARaDI5Wc41W/1mN9sbZDHKYxYWqR8eGcxKQcrjEdOm/ Mefl7FDfl58XVGlqmcVo3NrmNKrW1xrdd6qFQ0Z6MJRs7ZiBGuS6T0toIzMc/oVftsHXgr ++IxuKLERTF3hD6SJJA0k9ehk7AMhdU= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-173-InIhh8N_M6WZgfpAgRMiRQ-1; Fri, 13 Jan 2023 11:33:24 -0500 X-MC-Unique: InIhh8N_M6WZgfpAgRMiRQ-1 Received: by mail-lf1-f71.google.com with SMTP id cf15-20020a056512280f00b004a28ba148bbso8662107lfb.22 for ; Fri, 13 Jan 2023 08:33:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=XH9Hid9ZKX8EjrNBq0XZJC8PsPAfd7o1CftbCtfzRio=; b=0S1jzpFBFPoJvGZQiUjjRWLKIUuOMYsnScDTxM9BpAnExo1GkEBbesjZFLzluxAgGV IjUzHBr+SkYyd/PGaUfU2rrlr/puhQZGd7VfXAl/zSUI+JcosiZgWXb6YlrZQOJVIVOE LUmbHQTKroj2G2EqbROgDAntG26xWz3x7rTI4tZyWBBUyskMmckT61oJySfTrxyNgThl 363lTNbm7oXyfPKrwKeJWQ9bFvk4uhEKVF/KCxnuJ6L+bErSUwSwlt02lIB2uG+GfIE8 3sHCLTrihXOdMP2kokiYPfnuPn08OJ84O6LyNmH9WaESI8l0ADltGb/MQxDKy3QvDGw1 sspA== X-Gm-Message-State: AFqh2krdpBOGYSnDTz1zyl3c3m5WVyf3t/CYY5p03gZAz1hUUMne9I0V 921QGrX5Cb7FdKIz4OwKqoZiDN4cAd8lcHXnyQ//N5+AvMhK0H7ttZZxXu2iZ7/91nU3UhUpEve 0GOlwCACNhB448n/nJXBrBp1UxO6neqPp1A== X-Received: by 2002:a05:6512:3da4:b0:4cb:87f:64f5 with SMTP id k36-20020a0565123da400b004cb087f64f5mr3258828lfv.429.1673627603092; Fri, 13 Jan 2023 08:33:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXunQX511JUEyR9qlBd7F+o/0CYjfLA+o4RmuctC69k4K0xS4bmz5cF+TtoBIIOPbsQF+dwsZ7ahdlUaR8/x6U0= X-Received: by 2002:a05:6512:3da4:b0:4cb:87f:64f5 with SMTP id k36-20020a0565123da400b004cb087f64f5mr3258825lfv.429.1673627602661; Fri, 13 Jan 2023 08:33:22 -0800 (PST) MIME-Version: 1.0 References: <2d387cf7-8b99-3f04-6b99-d9dab5309693@gmail.com> <66ebb430-e280-3501-1f20-aab66f6f4d7b@gmail.com> <98eeb943-9f1d-72b6-4ce1-cb2a802550f7@gmail.com> In-Reply-To: <98eeb943-9f1d-72b6-4ce1-cb2a802550f7@gmail.com> From: Jonathan Wakely Date: Fri, 13 Jan 2023 16:33:11 +0000 Message-ID: Subject: Re: [PATCH] Use cxx11 abi in versioned namespace To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++@gcc.gnu.org" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable 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, 5 Dec 2022 at 21:14, Fran=C3=A7ois Dumont via Libstdc++ wrote: > > I just rebased this patch. > > All good apart from the to_chars/from_chars symbols issue. > > Fran=C3=A7ois > > > On 11/10/22 19:28, Fran=C3=A7ois Dumont wrote: > > Hi > > > > Now that pretty printer is fixed (once patch validated) I'd like > > to propose this patch again. > > > > Note that I'am adding a check on pretty printer with a std::any on > > a std::wstring. I did so because of the FIXME in printers.py which is > > dealing with 'std::string' explicitely. Looks like in my case, where > > there is no 'std::string' but just a 'std::__8::string' we do not need > > the workaround. > > > > Once again I am attaching also the version namespace bump patch as > > I think that adopting the cxx11 abi in this mode is a good enough > > reason to bump it. If you agress let me know if I should squash the > > commits before pushing. Yes, I think this change would justify bumping the version. > > > > libstdc++: [_GLIBCXX_INLINE_VERSION] Use cxx11 abi > > > > Use cxx11 abi when activating versioned namespace mode. > > > > libstdcxx-v3/ChangeLog: > > > > * acinclude.m4 [GLIBCXX_ENABLE_LIBSTDCXX_DUAL_ABI]: > > Default to "new" libstdcxx abi. > > * config/locale/dragonfly/monetary_members.cc > > [!_GLIBCXX_USE_DUAL_ABI]: Define money_base > > members. > > * config/locale/generic/monetary_members.cc > > [!_GLIBCXX_USE_DUAL_ABI]: Likewise. > > * config/locale/gnu/monetary_members.cc > > [!_GLIBCXX_USE_DUAL_ABI]: Likewise. > > * config/locale/gnu/numeric_members.cc > > [!_GLIBCXX_USE_DUAL_ABI](__narrow_multibyte_chars): Define. > > * configure: Regenerate. > > * include/bits/c++config > > [_GLIBCXX_INLINE_VERSION](_GLIBCXX_NAMESPACE_CXX11, > > _GLIBCXX_BEGIN_NAMESPACE_CXX11): Define > > empty. > > [_GLIBCXX_INLINE_VERSION](_GLIBCXX_END_NAMESPACE_CXX11, > > _GLIBCXX_DEFAULT_ABI_TAG): Likewise. > > * python/libstdcxx/v6/printers.py > > (StdStringPrinter::__init__): Set self.new_string to True > > when std::__8::basic_string type is > > found. > > * src/Makefile.am > > [ENABLE_SYMVERS_GNU_NAMESPACE](ldbl_alt128_compat_sources): Define empt= y. > > * src/Makefile.in: Regenerate. > > * src/c++11/Makefile.am (cxx11_abi_sources): Rename into... > > (dual_abi_sources): ...this, new. Also move several > > sources to... > > (sources): ...this. > > (extra_string_inst_sources): Move several sources to... > > (inst_sources): ...this. I don't understand this part. Moving those files to sources and inst_sources will mean they are always compiled, right? But we don't want them compiled for --disable-libstdcxx-dual-abi In those files you've changed the #if conditions so they are empty if the dual ABI is disabled, but why do they need to be compiled at all? This isn't clear from the patch or the description or the changelog. > > * src/c++11/Makefile.in: Regenerate. > > * src/c++11/cow-fstream-inst.cc [_GLIBCXX_USE_CXX11_ABI]: > > Skip definitions. > > * src/c++11/cow-locale_init.cc [_GLIBCXX_USE_CXX11_ABI]: > > Skip definitions. > > * src/c++11/cow-sstream-inst.cc [_GLIBCXX_USE_CXX11_ABI]: > > Skip definitions. > > * src/c++11/cow-stdexcept.cc > > [_GLIBCXX_USE_CXX11_ABI](error_category::_M_message): > > Skip definition. > > [_GLIBCXX_USE_CXX11_ABI]: Skip Transaction Memory TS > > definitions. > > * src/c++11/cow-string-inst.cc [_GLIBCXX_USE_CXX11_ABI]: > > Skip definitions. > > * src/c++11/cow-string-io-inst.cc > > [_GLIBCXX_USE_CXX11_ABI]: Skip definitions. > > * src/c++11/cow-wstring-inst.cc [_GLIBCXX_USE_CXX11_ABI]: > > Skip definitions. > > * src/c++11/cow-wstring-io-inst.cc > > [_GLIBCXX_USE_CXX11_ABI]: Skip definitions. > > * src/c++11/cxx11-hash_tr1.cc [!_GLIBCXX_USE_CXX11_ABI]: > > Skip definitions. > > * src/c++11/cxx11-ios_failure.cc > > [!_GLIBCXX_USE_CXX11_ABI]: Skip definitions. > > [!_GLIBCXX_USE_DUAL_ABI] (__ios_failure): Remove. For this file I think your changes make sense, because the definitions of the gcc4-compatible and cxx11 ABI are different, we're not just compiling it twice. > > * src/c++11/cxx11-locale-inst.cc: Cleanup, just include > > locale-inst.cc. > > * src/c++11/cxx11-stdexcept.cc [!_GLIBCXX_USE_CXX11_ABI]: > > Skip definitions. > > [!_GLIBCXX_USE_DUAL_ABI](__cow_string): Remove. > > * src/c++11/cxx11-wlocale-inst.cc > > [!_GLIBCXX_USE_CXX11_ABI]: Skip definitions. > > * src/c++11/fstream-inst.cc [!_GLIBCXX_USE_CXX11_ABI]: > > Skip definitions > > * src/c++11/locale-inst-numeric.h > > [!_GLIBCXX_USE_DUAL_ABI](std::use_facet>, > > std::use_facet>): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](std::has_facet>, > > std::has_facet>): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](std::num_get > istreambuf_iterator>): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](std::num_put > ostreambuf_iterator>): Instantiate. > > * src/c++11/locale-inst.cc [!_GLIBCXX_USE_DUAL_ABI]: Build > > only when configured > > _GLIBCXX_USE_CXX11_ABI is equal to currently built abi. > > [!_GLIBCXX_USE_DUAL_ABI](__moneypunct_cache): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](__moneypunct_cache): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](__numpunct_cache): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](__timepunct): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](__timepunct_cache): Instantiate= . > > [!_GLIBCXX_USE_DUAL_ABI](time_put > ostreambuf_iterator>): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](time_put_byname > ostreambuf_iterator>): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](__ctype_abstract_base): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](ctype_byname): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](__codecvt_abstract_base > mbstate_t>): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](codecvt_byname > mbstate_t>): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](use_facet>(const locale&)): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](use_facet > mbstate_t>>(const locale&)): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](use_facet<__timepunct>(const locale&)): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](use_facet>(const locale&)): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](has_facet>(const locale&)): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](has_facet > mbstate_t>>(const locale&)): Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](has_facet<__timepunct>(const locale&)): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](has_facet>(const locale&)): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](__add_grouping): Define. > > [!_GLIBCXX_USE_DUAL_ABI](__pad>): > > Instantiate. > > [!_GLIBCXX_USE_DUAL_ABI](__int_to_char(C*, unsigned long, > > const C*, ios_base::fmtflags, bool)): > > Define. > > [!_GLIBCXX_USE_DUAL_ABI](__int_to_char(C*, unsigned long > > long, const C*, ios_base::fmtflags, bool)): > > Define. > > * src/c++11/cxx11-wlocale-inst.cc > > [!_GLIBCXX_USE_CXX11_ABI]: Skip definitions. > > * src/c++98/Makefile.am (cxx11_abi_sources): Remove, > > unique cow-istream-string.cc entry move to... > > (inst_sources): ...this. Why? > > * src/c++98/Makefile.in: Regenerate. > > * src/c++98/cow-istream-string.cc: Include > > . > > [_GLIBCXX_USE_CXX11_ABI]: Skip definitions. This file doesn't need to be compiled when the dual abi is disabled. > > * src/c++98/hash_tr1.cc [_GLIBCXX_USE_CXX11_ABI]: Skip > > definitions. > > * src/c++98/ios_failure.cc > > [_GLIBCXX_USE_CXX11_ABI][_GLIBCXX_USE_DUAL_ABI]: Skip definitions. > > * src/c++98/istream-string.cc [!_GLIBCXX_USE_DUAL_ABI]: > > Build only when configured > > _GLIBCXX_USE_CXX11_ABI is equal to currently built abi. > > * src/c++98/locale_facets.cc > > [_GLIBCXX_USE_CXX11_ABI](__verify_grouping): Remove. > > * src/c++98/stdexcept.cc > > [_GLIBCXX_USE_CXX11_ABI](logic_error(const string&): Remove= . > > [_GLIBCXX_USE_CXX11_ABI](domain_error(const string&): Remov= e. > > [_GLIBCXX_USE_CXX11_ABI](invalid_argument(const string&): > > Remove. > > [_GLIBCXX_USE_CXX11_ABI](length_error(const string&): Remov= e. > > [_GLIBCXX_USE_CXX11_ABI](out_of_range(const string&): Remov= e. > > [_GLIBCXX_USE_CXX11_ABI](runtime_error(const string&): > > Remove. > > [_GLIBCXX_USE_CXX11_ABI](range_error(const string&): Remove= . > > [_GLIBCXX_USE_CXX11_ABI](overflow_error(const string&): > > Remove. > > [_GLIBCXX_USE_CXX11_ABI](underflow_error(const string&): > > Remove. > > * testsuite/libstdc++-prettyprinters/cxx17.cc: Add > > std::any check with std::wstring. > > > > Fran=C3=A7ois > > > > On 30/05/22 22:58, Fran=C3=A7ois Dumont wrote: > >> Hi > >> > >> Here is the patch to use cxx11 abi for the versioned namespace mode. > >> > >> It is still suffering from a side effect on gdb pretty printers with > >> 3 errors like: > >> > >> got: type =3D > >> std::unique_ptr >> std::__8::char_traits, std::__8::allocator >>[]>>[99]> > >> FAIL: libstdc++-prettyprinters/80276.cc whatis p4 > >> > >> However once I apply the version bump errors are gone. > >> > >> Let me know if it is ok to apply all at once or if you prefer to > >> avoid the version bump. > >> > >> Fran=C3=A7ois > >