Merged
Conversation
There are two classes called SocketReadySignalHelper in two anonymous namespaces in two distinct TUs. Since they are both used as arguments to a coroutine, the compiler has generated for each invocation of the coroutine a stackframe struct, which contained SocketReadySignalHelper in its name. However, the frame structs are not stored in an anonymous namespace, and due to the classes both having the same name, we ended up with two distict classes with the same name in two different TUs. Because they are not in an anonymous namespace, the link time optimizer tries to solve the duplication and runs into an ODR violation. To workaround this, what I believe is a GCC bug, this change renames the structures to each have a unique name. The name of the generated frame struct was _Z5qCoroIN12_GLOBAL__N_123SocketReadySignalHelperEMN5QCoro6detail16WaitSignalHelperEFvbEENS2_4TaskINS3_11QCoroSignalIT_T0_E11result_typeEEEPS9_OSA_NSt6chrono8durationIlSt5ratioILl1ELl1000EEEE.Frame
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are two classes called SocketReadySignalHelper in two
anonymous namespaces in two distinct TUs. Since they are both
used as arguments to a coroutine, the compiler has generated for
each invocation of the coroutine a stackframe struct, which
contained SocketReadySignalHelper in its name. However, the frame
structs are not stored in an anonymous namespace, and due to the
classes both having the same name, we ended up with two distict
classes with the same name in two different TUs. Because they are
not in an anonymous namespace, the link time optimizer tries to
solve the duplication and runs into an ODR violation.
To workaround this, what I believe is a GCC bug, this change renames
the structures to each have a unique name.
The name of the generated frame struct was
_Z5qCoroIN12_GLOBAL__N_123SocketReadySignalHelperEMN5QCoro6detail16WaitSignalHelperEFvbEENS2_4TaskINS3_11QCoroSignalIT_T0_E11result_typeEEEPS9_OSA_NSt6chrono8durationIlSt5ratioILl1ELl1000EEEE.Frame
Edit: it is a known GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101118