]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix C++ 11 ctype when using picolibc (blank vs space)
authorKeith Packard <keithp@keithp.com>
Thu, 8 Jan 2026 18:14:07 +0000 (10:14 -0800)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 9 Jan 2026 17:04:55 +0000 (17:04 +0000)
commit7d199a32ebdee1e242fe6016012ea29a60de54d4
tree79ac641d377bc8ab628049a6616ebbdbe250b53a
parentc10076b34d3ede485bfb306b2a91feeee8368cd5
libstdc++: Fix C++ 11 ctype when using picolibc (blank vs space)

Existing toolchain builds rely on the similarity between picolibc and
newlib when building libstdc++ and use --with-newlib.

Switch to the picolibc 16-bit _ctype_wide array which provides
separate values for ctype_base::blank and ctype_base::space.

This fixes a bug where libstdc++ was including '\f', '\n', '\r' and
'\v' in the set of 'blank' chars. Afterwards, only ' ' and '\t' are in
this set, as specified by C++ 11.

libstdc++-v3/ChangeLog:

* acinclude.m4 (GLIBCXX_CONFIGURE): Add --with-picolibc.
* configure: Regenerate.
* configure.ac: Add handling for with_picolibc=yes.
* config/os/picolibc/ctype_base.h: New file.
* config/os/picolibc/ctype_configure_char.cc: New file.
* config/os/picolibc/ctype_inline.h: New file.
* config/os/picolibc/os_defines.h: New file.

Signed-off-by: Keith Packard <keithp@keithp.com>
libstdc++-v3/acinclude.m4
libstdc++-v3/config/os/picolibc/ctype_base.h [new file with mode: 0644]
libstdc++-v3/config/os/picolibc/ctype_configure_char.cc [new file with mode: 0644]
libstdc++-v3/config/os/picolibc/ctype_inline.h [new file with mode: 0644]
libstdc++-v3/config/os/picolibc/os_defines.h [new file with mode: 0644]
libstdc++-v3/configure
libstdc++-v3/configure.ac