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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id EAFB4393C860 for ; Mon, 7 Dec 2020 18:55:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EAFB4393C860 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-_125pDdGNt6NiYxb1GhEkA-1; Mon, 07 Dec 2020 13:55:04 -0500 X-MC-Unique: _125pDdGNt6NiYxb1GhEkA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EAAD01006C96; Mon, 7 Dec 2020 18:55:02 +0000 (UTC) Received: from localhost (unknown [10.33.36.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A8F15C22B; Mon, 7 Dec 2020 18:55:02 +0000 (UTC) Date: Mon, 7 Dec 2020 18:55:01 +0000 From: Jonathan Wakely To: Keith Packard Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH 1/2] libstdc++: Add --enable-pure-stdio-libstdcxx option Message-ID: <20201207185501.GA4100714@redhat.com> References: <20201207183927.3275768-1-keithp@keithp.com> <20201207183927.3275768-2-keithp@keithp.com> MIME-Version: 1.0 In-Reply-To: <20201207183927.3275768-2-keithp@keithp.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2020 18:55:18 -0000 On 07/12/20 10:39 -0800, Keith Packard via Libstdc++ wrote: >This option directs the library to only use simple stdio APIs instead >of using fileno to get the file descriptor for use with POSIX APIs. Makes sense, thanks. I've replaced the gcc@ list with gcc-patches@ in the recipients. >Signed-off-by: Keith Packard >--- > libstdc++-v3/ChangeLog | 13 ++++++ > libstdc++-v3/acinclude.m4 | 13 ++++++ > libstdc++-v3/config/io/basic_file_stdio.cc | 46 +++++++++++++++++++--- > libstdc++-v3/configure.ac | 1 + > 4 files changed, 68 insertions(+), 5 deletions(-) > >diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog >index d3ee18ed7d1..7f6b0697534 100644 >--- a/libstdc++-v3/ChangeLog >+++ b/libstdc++-v3/ChangeLog >@@ -1147,6 +1147,19 @@ > * include/bits/uniform_int_dist.h (uniform_int_distribution::_S_nd): > Use qualified-id to refer to static member functions. > >+2020-11-04 Keith Packard >+ >+ * acinclude.m4: Add GLIBCXX_ENABLE_PURE_STDIO for >+ --enable-libstdcxx-pure-stdio >+ * configure.ac: Use GLIBCXX_ENABLE_PURE_STDIO for >+ --enable-libstdcxx-pure-stdio >+ * configure: regenerate >+ * config.h.in: regenerate >+ * config/io/basic_file_stdio.cc: Add support for >+ _GLIBCXX_USE_PURE_STDIO. This makes libstdc++ use only defined >+ stdio entry points for all I/O operations, without direct calls to >+ underlying POSIX functions. >+ > 2020-11-03 Jonathan Wakely GCC changelog files are autogenerated now, so patches should not touch them. Just include the ChangeLog entry in the Git commit log (which will usually end up being quoted in the patch and/or the email body of the mail to gcc-patches). I think the right way to do this (or at least, the way that was intended when basic_file_stdio.cc was added) is to provide a new file and change GLIBCXX_ENABLE_CSTDIO in acinclude.m4 to use that new file. The two biggest downsides of that are that it duplicates a lot of the file (because the diffs for your changes are small) and that the correct name for your new file is already taken! I think we should rename basic_file_stdio.{h,cc} to basic_file_posix to vacate the basic_file_stdio name for what you want. However, it's rather late in the GCC 11 process to make a change like that (even though it's really just renaming some files). Would you be OK waiting until after GCC 11 is released (in 4-5 months) to do it "properly"? Is this blocking something that would require doing it sooner?