Skip to content
Snippets Groups Projects
Commit 762be064 authored by Jonathan Wakely's avatar Jonathan Wakely
Browse files

libstdc++: Export global iostreams with GLIBCXX_3.4.31 symver [PR108969]

Since GCC 13 the global iostream objects are only initialized once in
libstdc++, and not by a std::ios::Init object in every translation unit
that includes <iostream>. To avoid using uninitialized streams defined
in an older libstdc++.so, translation units using the global iostreams
should depend on the GLIBCXX_3.4.31 symver.

Define std::cin as std::__io::cin and then export it as
std::cin@@GLIBCXX_3.4.31 so that references to std::cin bind to the new
symver. Also export it as @GLIBCXX_3.4 for backwards compatibility

libstdc++-v3/ChangeLog:

	PR libstdc++/108969
	* src/Makefile.am: Move globals_io.cc to here.
	* src/Makefile.in: Regenerate.
	* src/c++98/Makefile.am: Remove globals_io.cc from here.
	* src/c++98/Makefile.in: Regenerate.
	* src/c++98/globals_io.cc [_GLIBCXX_SYMVER_GNU] (cin): Adjust
	symbol name and then export with GLIBCXX_3.4.31 symver.
	(cout, cerr, clog, wcin, wcout, wcerr, wclog): Likewise.
	* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt:
	Regenerate.
	* config/abi/post/i486-linux-gnu/baseline_symbols.txt:
	Regenerate.
	* config/abi/post/m68k-linux-gnu/baseline_symbols.txt:
	Regenerate.
	* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt:
	Regenerate.
	* config/abi/post/riscv64-linux-gnu/baseline_symbols.txt:
	Regenerate.
	* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt:
	Regenerate.
	* config/abi/post/s390x-linux-gnu/baseline_symbols.txt:
	Regenerate.
	* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt:
	Regenerate.
	* config/abi/pre/gnu.ver: Add iostream objects to new symver.
parent 3d9156f8
No related branches found
No related tags found
No related merge requests found
Showing
with 176 additions and 83 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment