Bug 2187768 - gcc: Adjust RPM dependencies for new std::cout etc. symbol versions
Summary: gcc: Adjust RPM dependencies for new std::cout etc. symbol versions
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 38
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-18 16:14 UTC by Florian Weimer
Modified: 2023-04-19 13:42 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-04-19 13:42:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
0001-Auto-generate-libstdc-dependency-for-iostream-symbol.patch (3.03 KB, patch)
2023-04-19 07:33 UTC, Florian Weimer
no flags Details | Diff
0001-Auto-generate-libstdc-dependency-for-iostream-symbol.patch (3.07 KB, patch)
2023-04-19 10:25 UTC, Florian Weimer
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 108969 0 P3 RESOLVED [13/14 Regression] Initializing iostreams in the library needs a GLIBCXX_3.4.31 versioned symbol 2023-04-18 16:15:16 UTC

Description Florian Weimer 2023-04-18 16:14:40 UTC
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.

Comment 1 Florian Weimer 2023-04-18 16:19:17 UTC
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.

Comment 2 Florian Weimer 2023-04-19 07:33:04 UTC
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).

Comment 3 Florian Weimer 2023-04-19 10:25:20 UTC
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.

Comment 4 Florian Weimer 2023-04-19 11:34:42 UTC
(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.

Comment 5 Florian Weimer 2023-04-19 13:42:11 UTC
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. 🥲


Note You need to log in before you can comment on or make changes to this bug.