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 <kei...@keithp.com>
---
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  <kei...@keithp.com>
+
+       * 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  <jwak...@redhat.com>

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?


Reply via email to