Re: [committed] libstdc++: Add Filesystem TS and std::stacktrace symbols to libstdc++exp.a

2023-09-08 Thread Jonathan Wakely via Gcc-patches
I forgot to say:

Tested x86_64-linux and aarch64-linux, built for avr, arm-eabi and
cris-elf.

Pushed to trunk.


On Fri, 8 Sept 2023 at 18:09, Jonathan Wakely via Libstdc++
 wrote:
>
> This consolidates the three static archives for extensions into one, so
> that -lstdc++exp can be used to provide the definitions of all unstable
> library features.
>
> The libstdc++_libbacktrace.a archive is now just a "noinst" convenience
> library that is only used during the build, not installed. Its contents
> are added to libstdc++exp.a, along with the new non-inline definitions
> of std::stacktrace symbols.
>
> The libstdc++fs.a archive is still installed, but its contents are
> duplicated in libstdc++exp.a now. This means -lstdc++exp can be used
> instead of -lstdc++fs. For targets using the GNU linker we should
> consider replacing libstdc++fs.a with a linker script that does
> INPUT(libstdc++exp.a).
>
> The tests for  could be changed to use
> -lstdc++exp instead of -lstdc++fs, which would allow removing
> src/filesystem/.libs from the LDFLAGS in scripts/testsuite_flags.in,
> but that can be done at a later date.
>
> libstdc++-v3/ChangeLog:
>
> * acinclude.m4 (GLIBCXX_CONFIGURE): Add c++23 directory.
> * configure: Regenerate.
> * doc/html/manual/*: Regenerate.
> * doc/xml/manual/using.xml: Update documentation on linking.
> * include/std/stacktrace: Remove declarations of libbacktrace
> APIs.
> (stacktrace_entry::_S_err_handler, stacktrace_entry::_S_init):
> Remove.
> (stacktrace_entry::_Info): New class.
> (stacktrace_entry::_M_get_info): Use _Info.
> (__stacktrace_impl): New class.
> (basic_stacktrace): Derive from __stacktrace_impl.
> (basic_stacktrace::current): Use __stacktrace_impl::_S_current.
> * scripts/testsuite_flags.in: Adjust LDFLAGS to find
> libstdc++exp instead of libstdc++_libbacktrace.
> * src/Makefile.am (SUBDIRS): Add c++23 directory.
> * src/Makefile.in: Regenerate.
> * src/c++20/Makefile.am: Fix comment.
> * src/c++20/Makefile.in: Regenerate.
> * src/c++23/Makefile.am: New file.
> * src/c++23/Makefile.in: New file.
> * src/c++23/stacktrace.cc: New file with definitions of
> stacktrace_entry::_Info and __stacktrace_impl members.
> * src/experimental/Makefile.am: Use LIBADD to include other
> libraries.
> * src/experimental/Makefile.in: Regenerate.
> * src/libbacktrace/Makefile.am: Use noinst_LTLIBRARIES.
> * src/libbacktrace/Makefile.in: Regenerate.
> * testsuite/19_diagnostics/stacktrace/current.cc: Adjust
> dg-options to use -lstdc++exp.
> * testsuite/19_diagnostics/stacktrace/entry.cc: Likewise.
> * testsuite/19_diagnostics/stacktrace/stacktrace.cc: Likewise.
> * testsuite/23_containers/vector/debug/assign4_backtrace_neg.cc:
> Likewise.
> ---
>  libstdc++-v3/acinclude.m4 |   2 +-
>  libstdc++-v3/configure|  16 +-
>  libstdc++-v3/doc/html/manual/using.html   |  26 +-
>  .../html/manual/using_dynamic_or_shared.html  |   4 +
>  libstdc++-v3/doc/xml/manual/using.xml |  37 +-
>  libstdc++-v3/include/std/stacktrace   | 144 +---
>  libstdc++-v3/scripts/testsuite_flags.in   |   8 +-
>  libstdc++-v3/src/Makefile.am  |   4 +-
>  libstdc++-v3/src/Makefile.in  |   7 +-
>  libstdc++-v3/src/c++20/Makefile.am|   2 +-
>  libstdc++-v3/src/c++20/Makefile.in|   2 +-
>  libstdc++-v3/src/c++23/Makefile.am| 109 +++
>  libstdc++-v3/src/c++23/Makefile.in| 747 ++
>  libstdc++-v3/src/c++23/stacktrace.cc  | 171 
>  libstdc++-v3/src/experimental/Makefile.am |  20 +
>  libstdc++-v3/src/experimental/Makefile.in |  15 +-
>  libstdc++-v3/src/libbacktrace/Makefile.am |   3 +-
>  libstdc++-v3/src/libbacktrace/Makefile.in |  88 +--
>  .../19_diagnostics/stacktrace/current.cc  |   2 +-
>  .../19_diagnostics/stacktrace/entry.cc|   2 +-
>  .../19_diagnostics/stacktrace/stacktrace.cc   |   2 +-
>  .../vector/debug/assign4_backtrace_neg.cc |   2 +-
>  22 files changed, 1185 insertions(+), 228 deletions(-)
>  create mode 100644 libstdc++-v3/src/c++23/Makefile.am
>  create mode 100644 libstdc++-v3/src/c++23/Makefile.in
>  create mode 100644 libstdc++-v3/src/c++23/stacktrace.cc
>
> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
> index fcf79503265..34faa3c049f 100644
> --- a/libstdc++-v3/acinclude.m4
> +++ b/libstdc++-v3/acinclude.m4
> @@ -49,7 +49,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
># Keep these sync'd with the list in Makefile.am.  The first provides an
># expandable list at autoconf time; the second provides an expandable list
># (i.e., shell variable) at configure time.
> -  m4_define([glibcxx_SUBDIRS],[include libsupc++ 

[committed] libstdc++: Add Filesystem TS and std::stacktrace symbols to libstdc++exp.a

2023-09-08 Thread Jonathan Wakely via Gcc-patches
This consolidates the three static archives for extensions into one, so
that -lstdc++exp can be used to provide the definitions of all unstable
library features.

The libstdc++_libbacktrace.a archive is now just a "noinst" convenience
library that is only used during the build, not installed. Its contents
are added to libstdc++exp.a, along with the new non-inline definitions
of std::stacktrace symbols.

The libstdc++fs.a archive is still installed, but its contents are
duplicated in libstdc++exp.a now. This means -lstdc++exp can be used
instead of -lstdc++fs. For targets using the GNU linker we should
consider replacing libstdc++fs.a with a linker script that does
INPUT(libstdc++exp.a).

The tests for  could be changed to use
-lstdc++exp instead of -lstdc++fs, which would allow removing
src/filesystem/.libs from the LDFLAGS in scripts/testsuite_flags.in,
but that can be done at a later date.

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CONFIGURE): Add c++23 directory.
* configure: Regenerate.
* doc/html/manual/*: Regenerate.
* doc/xml/manual/using.xml: Update documentation on linking.
* include/std/stacktrace: Remove declarations of libbacktrace
APIs.
(stacktrace_entry::_S_err_handler, stacktrace_entry::_S_init):
Remove.
(stacktrace_entry::_Info): New class.
(stacktrace_entry::_M_get_info): Use _Info.
(__stacktrace_impl): New class.
(basic_stacktrace): Derive from __stacktrace_impl.
(basic_stacktrace::current): Use __stacktrace_impl::_S_current.
* scripts/testsuite_flags.in: Adjust LDFLAGS to find
libstdc++exp instead of libstdc++_libbacktrace.
* src/Makefile.am (SUBDIRS): Add c++23 directory.
* src/Makefile.in: Regenerate.
* src/c++20/Makefile.am: Fix comment.
* src/c++20/Makefile.in: Regenerate.
* src/c++23/Makefile.am: New file.
* src/c++23/Makefile.in: New file.
* src/c++23/stacktrace.cc: New file with definitions of
stacktrace_entry::_Info and __stacktrace_impl members.
* src/experimental/Makefile.am: Use LIBADD to include other
libraries.
* src/experimental/Makefile.in: Regenerate.
* src/libbacktrace/Makefile.am: Use noinst_LTLIBRARIES.
* src/libbacktrace/Makefile.in: Regenerate.
* testsuite/19_diagnostics/stacktrace/current.cc: Adjust
dg-options to use -lstdc++exp.
* testsuite/19_diagnostics/stacktrace/entry.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/stacktrace.cc: Likewise.
* testsuite/23_containers/vector/debug/assign4_backtrace_neg.cc:
Likewise.
---
 libstdc++-v3/acinclude.m4 |   2 +-
 libstdc++-v3/configure|  16 +-
 libstdc++-v3/doc/html/manual/using.html   |  26 +-
 .../html/manual/using_dynamic_or_shared.html  |   4 +
 libstdc++-v3/doc/xml/manual/using.xml |  37 +-
 libstdc++-v3/include/std/stacktrace   | 144 +---
 libstdc++-v3/scripts/testsuite_flags.in   |   8 +-
 libstdc++-v3/src/Makefile.am  |   4 +-
 libstdc++-v3/src/Makefile.in  |   7 +-
 libstdc++-v3/src/c++20/Makefile.am|   2 +-
 libstdc++-v3/src/c++20/Makefile.in|   2 +-
 libstdc++-v3/src/c++23/Makefile.am| 109 +++
 libstdc++-v3/src/c++23/Makefile.in| 747 ++
 libstdc++-v3/src/c++23/stacktrace.cc  | 171 
 libstdc++-v3/src/experimental/Makefile.am |  20 +
 libstdc++-v3/src/experimental/Makefile.in |  15 +-
 libstdc++-v3/src/libbacktrace/Makefile.am |   3 +-
 libstdc++-v3/src/libbacktrace/Makefile.in |  88 +--
 .../19_diagnostics/stacktrace/current.cc  |   2 +-
 .../19_diagnostics/stacktrace/entry.cc|   2 +-
 .../19_diagnostics/stacktrace/stacktrace.cc   |   2 +-
 .../vector/debug/assign4_backtrace_neg.cc |   2 +-
 22 files changed, 1185 insertions(+), 228 deletions(-)
 create mode 100644 libstdc++-v3/src/c++23/Makefile.am
 create mode 100644 libstdc++-v3/src/c++23/Makefile.in
 create mode 100644 libstdc++-v3/src/c++23/stacktrace.cc

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index fcf79503265..34faa3c049f 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -49,7 +49,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
   # Keep these sync'd with the list in Makefile.am.  The first provides an
   # expandable list at autoconf time; the second provides an expandable list
   # (i.e., shell variable) at configure time.
-  m4_define([glibcxx_SUBDIRS],[include libsupc++ src src/c++98 src/c++11 
src/c++17 src/c++20 src/filesystem src/libbacktrace src/experimental doc po 
testsuite python])
+  m4_define([glibcxx_SUBDIRS],[include libsupc++ src src/c++98 src/c++11 
src/c++17 src/c++20 src/c++23 src/filesystem src/libbacktrace src/experimental 
doc po testsuite python])
   SUBDIRS='glibcxx_SUBDIRS'
 
   # These need to be absolute