Upstream GCC recently added new symbol versions for std::cout etc. under the GLIBCXX_3.4.31 symbol version set. As a result, rebuilt packages will fail to run until libstdc++ is updated because the installed libstdc++ version will provide libstdc++.so.6(GLIBCXX_3.4.31)(64bit) (due to other symbols already existing at this version), but not (say) _ZSt4cerr@@GLIBCXX_3.4.31 specifically. Given that Fedora 38 has already been released, I think we should provide a solution at the RPM dependency level to this, so that the required libstdc++ package updates happen automatically.
Here is how glibc handles this situation: https://src.fedoraproject.org/rpms/glibc/blob/rawhide/f/glibc.req.in Also see glibc_autorequires in glibc.spec. We have fully automated this so that the under-development symbol version set always uses NVR-based dependencies in addition to symbol-based dependencies. This is probably not needed for gcc, a one-off for GLIBCXX_3.4.31 is probably sufficient.
Created attachment 1958225 [details] 0001-Auto-generate-libstdc-dependency-for-iostream-symbol.patch Untested patch, based on what we have in glibc (but less dynamic).
Created attachment 1958267 [details] 0001-Auto-generate-libstdc-dependency-for-iostream-symbol.patch Fixed patch to use install -D, and to cover copy relocations. Lightly tested, final tests still pending.
(In reply to Florian Weimer from comment #3) > Created attachment 1958267 [details] > 0001-Auto-generate-libstdc-dependency-for-iostream-symbol.patch > > Fixed patch to use install -D, and to cover copy relocations. Lightly > tested, final tests still pending. This patch passed my testing. However, /usr/bin/cmake (no arguments, no CMakeLists.txt file) crashes: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7b41fba in std::basic_ostream<char, std::char_traits<char> >::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from /lib64/libstdc++.so.6 (gdb) bt #0 0x00007ffff7b41fba in std::basic_ostream<char, std::char_traits<char> >::sentry::sentry(std::basic_ostream<char, std::char_traits<char> >&) () from /lib64/libstdc++.so.6 #1 0x00007ffff7b4296c in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) () from /lib64/libstdc++.so.6 #2 0x0000555555628f61 in cmDocumentationFormatter::PrintSection(std::basic_ostream<char, std::char_traits<char> >&, cmDocumentationSection const&) () #3 0x000055555560a5a5 in (anonymous namespace)::do_cmake(int, char const* const*) () #4 0x00005555555ebae0 in main () This does not seem related to my change or the way I patched GCC for building, though.
Looks like we won't need this after all because the changes were reverted for GCC 13.1, and GCC 13.2 will have to use a separate symbol set (but symbol aliases won't work for these global variables). Maybe another time. 🥲