https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124410

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <[email protected]>:

https://gcc.gnu.org/g:fa4754797c2935e4e2be95f128e668d6499ec267

commit r16-8719-gfa4754797c2935e4e2be95f128e668d6499ec267
Author: Jonathan Wakely <[email protected]>
Date:   Tue Mar 10 21:19:09 2026 +0000

    libstdc++: Optionally define std::print functions non-inline [PR124410]

    We don't want to export std::vprint_unicode etc. from libstdc++.so yet,
    but we can give users the option of improving compile times by getting
    the definitions of the std::print internals from libstdc++exp.a instead.

    This commit adds a macro, _GLIBCXX_NO_INLINE_PRINT, which disables the
    inline definitions of std::vprint_unicode etc. so that extern
    definitions in libstdc++exp.a can be used instead.

    With this change compiling a helloworld using std::print goes from 8s to
    under 2s with trunk. For release branches with --enable-checking=release
    we should see even faster times. The object file size is also
    dramatically smaller, because there's just a single call to an extern
    function instead of instantiating the entire std::print and std::format
    implementation inline.

    libstdc++-v3/ChangeLog:

            PR libstdc++/124410
            * doc/html/*: Regenerate.
            * doc/xml/manual/using.xml (_GLIBCXX_NO_INLINE_PRINT): Document
            macro.
            * include/Makefile.am: Add bits/print.h and bits/ostream_print.h
            headers.
            * include/Makefile.in: Regenerate.
            * include/std/ostream (vprint_nonunicode, vprint_unicode): Move
            definitions to new bits/ostream_print.h header.
            * include/std/print (__format::_File_sink, vprint_nonunicode)
            (vprint_nonunicode_buffered, vprint_unicode)
            (vprint_unicode_buffered): Move definitions to new bits/print.h
            header.
            * src/c++23/print.cc: Include new headers to define symbols for
            inline print functions.
            * include/bits/ostream_print.h: New file.
            * include/bits/print.h: New file.
  • [Bug libstdc++/124410] Define s... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to