RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2188013 - gcc-toolset-13-gcc: Revert <iostream> initialization changes for hybrid linkage
Summary: gcc-toolset-13-gcc: Revert <iostream> initialization changes for hybrid linkage
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: gcc-toolset-12-gcc
Version: 9.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Marek Polacek
QA Contact: Václav Kadlčík
URL:
Whiteboard:
Depends On:
Blocks: 2188014
TreeView+ depends on / blocked
 
Reported: 2023-04-19 13:28 UTC by Florian Weimer
Modified: 2023-11-07 09:56 UTC (History)
6 users (show)

Fixed In Version: gcc-toolset-13-gcc-13.1.1-4.1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 2188014 (view as bug list)
Environment:
Last Closed: 2023-11-07 08:34:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Revert ios init changes (6.34 KB, patch)
2023-06-08 10:12 UTC, Jonathan Wakely
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-155193 0 None None None 2023-04-19 13:30:02 UTC
Red Hat Product Errata RHEA-2023:6479 0 None None None 2023-11-07 08:34:47 UTC

Description Florian Weimer 2023-04-19 13:28:04 UTC
We cannot assume that libstdc++.so.6 performs std::cout etc. initialization, so the GTS header files need to keep using the old initialization model. Otherwise, things will build and link just fine, but the initialization might not happen as expected.

Note: Needs to be transitioned to the gcc-toolset-13-gcc component once that exists.

Comment 1 Florian Weimer 2023-04-19 13:32:44 UTC
Jakub suggests that we could pull in an ELF constructor in libstdc++_nonshared.a instead (with an appropriate early priority).

Comment 2 Marek Polacek 2023-06-07 20:58:47 UTC
Do we want to revert these two commits or some other ones as well?
9a41d2cdbcd2af77a3a91a840a3a13f0eb39971b
4e4e3ffd10f53ef71696bc728ab40258751a2df4

Comment 3 Jonathan Wakely 2023-06-08 10:12:17 UTC
Created attachment 1969733 [details]
Revert ios init changes

Makes sense to me.

I think you also want 87de39e4c3686535728f3a347f772e73af4cf262 (as the first one to revert).

There will be conflicts though, so I've attached a patch that does it cleanly.

Comment 4 Jakub Jelinek 2023-06-08 10:15:14 UTC
I believe what is in the patch should work fine.
If not, the reversions would break the gcc13-libstdc++-compat.patch though.

Comment 5 Marek Polacek 2023-06-08 13:19:08 UTC
Thanks Jonathan.

(In reply to Jakub Jelinek from comment #4)
> I believe what is in the patch should work fine.

the patch = Jon's #c3 patch?  Or gcc13-libstdc++-compat.patch and you actually don't want the reversion?

> If not, the reversions would break the gcc13-libstdc++-compat.patch though.

Relatedly, I see
+_ZSt21ios_base_library_initv FUNC GLOBAL DEFAULT
in our 'diff -up system2vanilla.abilist.diff nonshared.abilist' testing.  Should
_ZSt21ios_base_library_initv be .hidden as well?

Comment 6 Jakub Jelinek 2023-06-08 13:30:22 UTC
I meant gcc13-libstdc++-compat.patch .
What is in there is that if you #include <iostream>, you require _ZSt21ios_base_library_initv symbol, and the object that provides
that symbol (in libstdc++_nonshared.a) should initialize iostreams.
So, instead of the old initializing per TU, it is now effectively initialization per library or binary.  While upstream has it
in libstdc++.so.6 only which does that initialization.

I think the symbol shouldn't be hidden, we don't make the symbols from the system libstdc++.so.6 to libstdc++.so.6.0.32 diff hidden.
If some other library exports it already and you link against that library, the libstdc++_nonshared.a object might not be linked in,
sure, but then the dependent library should have initialized iostreams before running current library's constructors.

Comment 7 Marek Polacek 2023-06-08 17:12:28 UTC
Ok, let's give it (= no reversion) a shot.  I'm also going to keep _ZSt21ios_base_library_initv non-hidden.
If we run into issues, we can consider reverting the optimization again.  Thanks.

Comment 15 errata-xmlrpc 2023-11-07 08:34:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (gcc-toolset-13-gcc bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2023:6479


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