public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5722] libstdc++: Document P1642 and extensions
@ 2023-02-06 20:47 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-02-06 20:47 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:9f4baed6ac02f721f1adee043c4aa920dd5075b7

commit r13-5722-g9f4baed6ac02f721f1adee043c4aa920dd5075b7
Author: Arsen Arsenović <arsen@aarsen.me>
Date:   Mon Jan 23 13:41:45 2023 +0100

    libstdc++: Document P1642 and extensions
    
    libstdc++-v3/ChangeLog:
    
            * doc/xml/manual/using.xml: Document newly-freestanding
            headers and the effect of the -ffreestanding flag.
            * doc/xml/manual/status_cxx2023.xml: Document P1642R11 as
            completed.
            * doc/xml/manual/configure.xml: Document that hosted installs
            respect __STDC_HOSTED__.
            * doc/xml/manual/test.xml: Document how to run tests in
            freestanding mode.
            * doc/html/*: Regenerate.

Diff:
---
 libstdc++-v3/doc/html/index.html                   |  4 +-
 libstdc++-v3/doc/html/manual/configure.html        |  5 +-
 .../doc/html/manual/documentation_hacking.html     |  2 +-
 libstdc++-v3/doc/html/manual/memory.html           |  2 +-
 .../doc/html/manual/policy_data_structures.html    |  2 +-
 libstdc++-v3/doc/html/manual/status.html           |  6 +-
 libstdc++-v3/doc/html/manual/test.html             | 12 ++++
 libstdc++-v3/doc/html/manual/using.html            |  6 ++
 .../doc/html/manual/using_dynamic_or_shared.html   | 39 ++++++++++---
 libstdc++-v3/doc/xml/manual/configure.xml          |  5 +-
 libstdc++-v3/doc/xml/manual/status_cxx2023.xml     | 11 ++++
 libstdc++-v3/doc/xml/manual/test.xml               | 14 +++++
 libstdc++-v3/doc/xml/manual/using.xml              | 66 +++++++++++++++++++---
 13 files changed, 152 insertions(+), 22 deletions(-)

diff --git a/libstdc++-v3/doc/html/index.html b/libstdc++-v3/doc/html/index.html
index ce951e6cc8e..ed7021bd461 100644
--- a/libstdc++-v3/doc/html/index.html
+++ b/libstdc++-v3/doc/html/index.html
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The GNU C++ Library</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="description" content="Short Contents Copyright (C) 2008-2022 FSF Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. This is the top level of the libstdc++ documentation set. The documentation is divided into the following three sections. Manual Frequently Asked Questions API and Source Documentation" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="next" href="manual/index.html" title="The GNU C++ Library Manual" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manual/index.html">Next</a></td></tr></table><hr /></div><div class="set" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"></a>The GNU C++ Library</h1></div><div><div class="abstract"><a id="contents"></a><p class="title"><strong>Short Contents</strong></p><p>
-      Copyright (C) 2008-2022
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The GNU C++ Library</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="description" content="Short Contents Copyright (C) 2008-2023 FSF Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. This is the top level of the libstdc++ documentation set. The documentation is divided into the following three sections. Manual Frequently Asked Questions API and Source Documentation" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="index.html" title="The GNU C++ Library" /><link rel="next" href="manual/index.html" title="The GNU C++ Library Manual" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manual/index.html">Next</a></td></tr></table><hr /></div><div class="set" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"></a>The GNU C++ Library</h1></div><div><div class="abstract"><a id="contents"></a><p class="title"><strong>Short Contents</strong></p><p>
+      Copyright (C) 2008-2023
       <a class="link" href="https://www.fsf.org" target="_top">FSF
       </a>
     </p><p>
diff --git a/libstdc++-v3/doc/html/manual/configure.html b/libstdc++-v3/doc/html/manual/configure.html
index 9c5c2d9f170..dd9e6ef3579 100644
--- a/libstdc++-v3/doc/html/manual/configure.html
+++ b/libstdc++-v3/doc/html/manual/configure.html
@@ -219,7 +219,10 @@
      built.  The C++ Standard also describes a
      <span class="emphasis"><em>freestanding</em></span> environment, in which only a
      minimal set of headers are provided.  This option builds such an
-     environment.
+     environment.  Note that a hosted library installs headers that still can
+     be used in non hosted environments, as the library checks for
+     <code class="code">__STDC_HOSTED__</code>, however, a library configured with
+     <code class="code">--disable-hosted-libstdcxx</code> will not install unusable headers.
      </p></dd><dt><span class="term"><code class="code">--disable-libstdcxx-hosted</code></span></dt><dd><p>This is an alias for <code class="code">--disable-hosted-libstdcxx</code>.</p></dd><dt><span class="term"><code class="code">--disable-libstdcxx-verbose</code></span></dt><dd><p>
      By default, the library is configured to write descriptive messages
      to standard error for certain events such as calling a pure virtual
diff --git a/libstdc++-v3/doc/html/manual/documentation_hacking.html b/libstdc++-v3/doc/html/manual/documentation_hacking.html
index 7766f133bea..24df9bd9481 100644
--- a/libstdc++-v3/doc/html/manual/documentation_hacking.html
+++ b/libstdc++-v3/doc/html/manual/documentation_hacking.html
@@ -560,4 +560,4 @@ make <code class="literal">XSL_STYLE_DIR="/usr/share/xml/docbook/stylesheet/nwal
       </td></tr></tbody></table></div></div><br class="table-break" /></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="internals.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix B. 
   Porting and Maintenance
   
- </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Porting to New Hardware or Operating Systems</td></tr></table></div></body></html>
+ </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Porting to New Hardware or Operating Systems</td></tr></table></div></body></html>
\ No newline at end of file
diff --git a/libstdc++-v3/doc/html/manual/memory.html b/libstdc++-v3/doc/html/manual/memory.html
index a70613e8fd6..08ad2fd4dd8 100644
--- a/libstdc++-v3/doc/html/manual/memory.html
+++ b/libstdc++-v3/doc/html/manual/memory.html
@@ -644,4 +644,4 @@ be private.
 	</a>
       </em>. </span><span class="subtitle">
       N2461
-    . </span></p></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="utilities.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="traits.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Pairs </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Traits</td></tr></table></div></body></html>
+    . </span></p></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="utilities.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="traits.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Pairs </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Traits</td></tr></table></div></body></html>
\ No newline at end of file
diff --git a/libstdc++-v3/doc/html/manual/policy_data_structures.html b/libstdc++-v3/doc/html/manual/policy_data_structures.html
index ef54da8053a..90345550012 100644
--- a/libstdc++-v3/doc/html/manual/policy_data_structures.html
+++ b/libstdc++-v3/doc/html/manual/policy_data_structures.html
@@ -1297,4 +1297,4 @@
 	    Wickland
 	  </span>. </span><span class="publisher"><span class="publishername">
 	  National Psychological Institute
-	. </span></span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitmap_allocator_impl.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="policy_data_structures_using.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Implementation </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Using</td></tr></table></div></body></html>
+	. </span></span></p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitmap_allocator_impl.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="policy_data_structures_using.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Implementation </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Using</td></tr></table></div></body></html>
\ No newline at end of file
diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html
index 47bb0781417..c99d51ff709 100644
--- a/libstdc++-v3/doc/html/manual/status.html
+++ b/libstdc++-v3/doc/html/manual/status.html
@@ -1916,7 +1916,11 @@ or any notes about the implementation.
         <a class="link" href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html" target="_top">
         P2186R2
         </a>
-      </td><td align="center"> 12.1 </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.tr1"></a>C++ TR1</h3></div></div></div><p>
+      </td><td align="center"> 12.1 </td><td align="left"> </td></tr><tr><td align="left"> Easy [utilities], [ranges], and [iterators] </td><td align="left">
+        <a class="link" href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1642r11.html" target="_top">
+        P1642R11
+        </a>
+      </td><td align="center"> 13.1 </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="status.iso.tr1"></a>C++ TR1</h3></div></div></div><p>
 This table is based on the table of contents of ISO/IEC DTR 19768,
 Doc No: N1836=05-0096, Date: 2005-06-24,
 "Draft Technical Report on C++ Library Extensions".
diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html
index 10ae4ed5e1b..fadadf249bb 100644
--- a/libstdc++-v3/doc/html/manual/test.html
+++ b/libstdc++-v3/doc/html/manual/test.html
@@ -203,6 +203,18 @@ cat 27_io/objects/char/3_xin.in | a.out</pre></dd><dt><span class="term"><code c
  </p><pre class="programlisting">
     make check-target-libstdc++-v3 RUNTESTFLAGS='--target_board \"unix{-mabi=32,,-mabi=64}\"'
 </pre><p>
+    </p><p>
+      If you wish to run the testsuite in a freestanding configuration, you can
+      pass the <code class="code">-ffreestanding</code> flag.  Doing so will run the tests
+      that do not require hosted features, and emit a
+      <code class="literal">UNSUPPORTED</code> for those that do.  To run tests in the
+      freestanding configuration, you still need to build for a target you can
+      run programs on, e.g. <code class="code">x86_64-pc-linux-gnu</code>, as a few tests
+      still execute the code they build.  Here's an example of how to run the
+      testsuite with libstdc++ in freestanding mode:
+      </p><pre class="programlisting">
+    make check-target-libstdc++-v3 RUNTESTFLAGS='--target_board=unix/-ffreestanding'
+      </pre><p>
     </p><p>
       You can run the tests with a compiler and library that have
       already been installed.  Make sure that the compiler (e.g.,
diff --git a/libstdc++-v3/doc/html/manual/using.html b/libstdc++-v3/doc/html/manual/using.html
index f2dc2078759..f23325ebe97 100644
--- a/libstdc++-v3/doc/html/manual/using.html
+++ b/libstdc++-v3/doc/html/manual/using.html
@@ -40,4 +40,10 @@
       </td></tr><tr><td align="left"><code class="literal">-fopenmp</code></td><td align="left">For <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel</a> mode.</td></tr><tr><td align="left"><code class="literal">-ltbb</code></td><td align="left">Linking to tbb (Thread Building Blocks) is required for use of the
         Parallel Standard Algorithms and execution policies in
         <code class="filename">&lt;execution&gt;</code>.
+      </td></tr><tr><td align="left"><code class="literal">-ffreestanding</code></td><td align="left">
+	Limits the library to its freestanding subset.  Headers that are
+	not supported in freestanding will emit a "This header is not available
+	in freestanding mode" error.
+	Headers that are in the freestanding subset partially will not expose
+	functionality that is not part of the freestanding subset.
       </td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="make.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Make </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Headers</td></tr></table></div></body></html>
\ No newline at end of file
diff --git a/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html b/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
index 3c9e5fa54b0..73d1f18485f 100644
--- a/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
+++ b/libstdc++-v3/doc/html/manual/using_dynamic_or_shared.html
@@ -30,15 +30,40 @@
 	  <code class="filename">initializer_list</code>
 	  </p></li><li class="listitem"><p>
 	  <code class="filename">type_traits</code>
-	  </p></li></ul></div><p> There exists a library that offers runtime support for
-	just these headers, and it is called
-	<code class="filename">libsupc++.a</code>. To use it, compile with <span class="command"><strong>gcc</strong></span> instead of <span class="command"><strong>g++</strong></span>, like so:
+	  </p></li></ul></div><p>
+	As of GCC 13, libstdc++ implements P1642, which brings in many more
+	headers, as well a quite a few ones not covered by the paper.
+
+	In general, if a feature does not require traditionally libc-provided
+	facilities, or dynamic memory allocation, it's enabled in the
+	freestanding subset.  In addition, if only a subset of a header
+	requires such features, it is partially included.  Some examples
+	include:
+      </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
+	  <code class="filename">string_view</code>
+	  </p></li><li class="listitem"><p>
+	  <code class="filename">tuple</code>
+	  </p></li><li class="listitem"><p>
+	  <code class="filename">bitset</code>
+	  </p></li></ul></div><p>
+	Currently, this subset includes all of the iterator APIs (including the
+	ranges APIs) that do not involve streams, the entire C++ algorithms
+	library, excluding parallel algorithms, and a large part of the
+	utilities library.  This is on top of the headers included in the lists
+	above.
+      </p><p>
+	If you're using a libstdc++ configured for hosted environments, and
+	would like to not involve the libraries libstdc++ would depend on in
+	your programs, you will need to use <span class="command"><strong>gcc</strong></span> to link your
+	application with only <code class="filename">libsupc++.a</code>,
+	like so:
       </p><p>
-	<span class="command"><strong>gcc foo.cc -lsupc++</strong></span>
+	<span class="command"><strong>gcc -ffreestanding foo.cc -lsupc++</strong></span>
       </p><p>
-	No attempt is made to verify that only the minimal subset
-	identified above is actually used at compile time. Violations
-	are diagnosed as undefined symbols at link time.
+	If you configured libstdc++ with
+	<code class="code">--disable-hosted-libstdcxx</code>, however, you can use the
+	normal <span class="command"><strong>g++</strong></span> command to link, as this configuration
+	provides a (nearly) empty <code class="filename">libstdc++.a</code>.
       </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.linkage.dynamic"></a>Finding Dynamic or Shared Libraries</h3></div></div></div><p>
       If the only library built is the static library
       (<code class="filename">libstdc++.a</code>), or if
diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml
index 8b3b8cab8c7..7ff07aea886 100644
--- a/libstdc++-v3/doc/xml/manual/configure.xml
+++ b/libstdc++-v3/doc/xml/manual/configure.xml
@@ -362,7 +362,10 @@
      built.  The C++ Standard also describes a
      <emphasis>freestanding</emphasis> environment, in which only a
      minimal set of headers are provided.  This option builds such an
-     environment.
+     environment.  Note that a hosted library installs headers that still can
+     be used in non hosted environments, as the library checks for
+     <code>__STDC_HOSTED__</code>, however, a library configured with
+     <code>--disable-hosted-libstdcxx</code> will not install unusable headers.
      </para>
  </listitem></varlistentry>
 
diff --git a/libstdc++-v3/doc/xml/manual/status_cxx2023.xml b/libstdc++-v3/doc/xml/manual/status_cxx2023.xml
index 365df505f54..f23c64d6a29 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxx2023.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxx2023.xml
@@ -566,6 +566,17 @@ or any notes about the implementation.
       <entry />
     </row>
 
+    <row>
+      <entry> Easy [utilities], [ranges], and [iterators] </entry>
+      <entry>
+        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1642r11.html">
+        P1642R11
+        </link>
+      </entry>
+      <entry align="center"> 13.1 </entry>
+      <entry />
+    </row>
+
   </tbody>
 </tgroup>
 </table>
diff --git a/libstdc++-v3/doc/xml/manual/test.xml b/libstdc++-v3/doc/xml/manual/test.xml
index 7bc6e339723..964c53d2632 100644
--- a/libstdc++-v3/doc/xml/manual/test.xml
+++ b/libstdc++-v3/doc/xml/manual/test.xml
@@ -350,6 +350,20 @@ cat 27_io/objects/char/3_xin.in | a.out</programlisting>
 </programlisting>
     </para>
 
+    <para>
+      If you wish to run the testsuite in a freestanding configuration, you can
+      pass the <code>-ffreestanding</code> flag.  Doing so will run the tests
+      that do not require hosted features, and emit a
+      <literal>UNSUPPORTED</literal> for those that do.  To run tests in the
+      freestanding configuration, you still need to build for a target you can
+      run programs on, e.g. <code>x86_64-pc-linux-gnu</code>, as a few tests
+      still execute the code they build.  Here's an example of how to run the
+      testsuite with libstdc++ in freestanding mode:
+      <programlisting>
+    make check-target-libstdc++-v3 RUNTESTFLAGS='--target_board=unix/-ffreestanding'
+      </programlisting>
+    </para>
+
     <para>
       You can run the tests with a compiler and library that have
       already been installed.  Make sure that the compiler (e.g.,
diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml
index 9c444dd2997..7f011a6d931 100644
--- a/libstdc++-v3/doc/xml/manual/using.xml
+++ b/libstdc++-v3/doc/xml/manual/using.xml
@@ -132,6 +132,17 @@
       </entry>
     </row>
 
+    <row>
+      <entry><literal>-ffreestanding</literal></entry>
+      <entry>
+	Limits the library to its freestanding subset.  Headers that are
+	not supported in freestanding will emit a "This header is not available
+	in freestanding mode" error.
+	Headers that are in the freestanding subset partially will not expose
+	functionality that is not part of the freestanding subset.
+      </entry>
+    </row>
+
   </tbody>
 
 </tgroup>
@@ -1523,19 +1534,60 @@ namespace gtk
 	</listitem>
       </itemizedlist>
 
-      <para> There exists a library that offers runtime support for
-	just these headers, and it is called
-	<filename class="libraryfile">libsupc++.a</filename>. To use it, compile with <command>gcc</command> instead of <command>g++</command>, like so:
+      <para>
+	As of GCC 13, libstdc++ implements P1642, which brings in many more
+	headers, as well a quite a few ones not covered by the paper.
+
+	In general, if a feature does not require traditionally libc-provided
+	facilities, or dynamic memory allocation, it's enabled in the
+	freestanding subset.  In addition, if only a subset of a header
+	requires such features, it is partially included.  Some examples
+	include:
+      </para>
+
+      <itemizedlist>
+	<listitem>
+	  <para>
+	  <filename class="headerfile">string_view</filename>
+	  </para>
+	</listitem>
+	<listitem>
+	  <para>
+	  <filename class="headerfile">tuple</filename>
+	  </para>
+	</listitem>
+	<listitem>
+	  <para>
+	  <filename class="headerfile">bitset</filename>
+	  </para>
+	</listitem>
+      </itemizedlist>
+
+      <para>
+	Currently, this subset includes all of the iterator APIs (including the
+	ranges APIs) that do not involve streams, the entire C++ algorithms
+	library, excluding parallel algorithms, and a large part of the
+	utilities library.  This is on top of the headers included in the lists
+	above.
+      </para>
+
+      <para>
+	If you're using a libstdc++ configured for hosted environments, and
+	would like to not involve the libraries libstdc++ would depend on in
+	your programs, you will need to use <command>gcc</command> to link your
+	application with only <filename class="libraryfile">libsupc++.a</filename>,
+	like so:
       </para>
 
       <para>
-	<command>gcc foo.cc -lsupc++</command>
+	<command>gcc -ffreestanding foo.cc -lsupc++</command>
       </para>
 
       <para>
-	No attempt is made to verify that only the minimal subset
-	identified above is actually used at compile time. Violations
-	are diagnosed as undefined symbols at link time.
+	If you configured libstdc++ with
+	<code>--disable-hosted-libstdcxx</code>, however, you can use the
+	normal <command>g++</command> command to link, as this configuration
+	provides a (nearly) empty <filename class="libraryfile">libstdc++.a</filename>.
       </para>
     </section>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-06 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-06 20:47 [gcc r13-5722] libstdc++: Document P1642 and extensions Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).