Skip to content

[5.5] IRGen: use the accessor conformance on Windows #40264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

compnerd
Copy link
Member

When building with lazy initialization of the root conformance, we need
to ensure that we are invoking the accessor to initialize the
conformance record. We would previously generate a direct reference to
the conformance, which was uninitialized, resulting in a crash at
runtime.

The non-windows test changes here are to use/imply static linking for
the support modules. This should have no difference on the non-Windows
targets, but makes a difference on Windows where this implies that
everything will be built into a single module, which permits the
non-indirect access to types. Unfortunately, this does somewhat regress
the test coverage on Windows as we do not exercise as much of the shared
linkage paths which do change some of the code-generation to deal with
the moral equivalent of the GOT - the IAT.

Special thanks to @slavapestov for the pointer to
isDependentConformance. This should eliminate the last known issue
with cross-module protocol conformances.

Fixes: SR-14807

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

@compnerd compnerd requested a review from a team as a code owner November 19, 2021 16:16
@compnerd compnerd changed the title IRGen: use the accessor conformance on Windows [5.5] IRGen: use the accessor conformance on Windows Nov 19, 2021
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4c0743c26f56d4153f50fc8a04b58838bd526dcb

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4c0743c26f56d4153f50fc8a04b58838bd526dcb

@compnerd
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4c0743c26f56d4153f50fc8a04b58838bd526dcb

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4c0743c26f56d4153f50fc8a04b58838bd526dcb

@compnerd
Copy link
Member Author

@swift-ci please test Windows platform

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Dec 1, 2021

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Dec 1, 2021

@swift-ci please test Windows platform

@swift-ci
Copy link
Contributor

swift-ci commented Dec 1, 2021

Build failed
Swift Test Linux Platform
Git Sha - 6da092bba32be34da921d0f91b003f07d013eaf8

@swift-ci
Copy link
Contributor

swift-ci commented Dec 1, 2021

Build failed
Swift Test OS X Platform
Git Sha - 6da092bba32be34da921d0f91b003f07d013eaf8

When building with lazy initialization of the root conformance, we need
to ensure that we are invoking the accessor to initialize the
conformance record.  We would previously generate a direct reference to
the conformance, which was uninitialized, resulting in a crash at
runtime.

The non-windows test changes here are to use/imply static linking for
the support modules.  This should have no difference on the non-Windows
targets, but makes a difference on Windows where this implies that
everything will be built into a single module, which permits the
non-indirect access to types.  Unfortunately, this does somewhat regress
the test coverage on Windows as we do not exercise as much of the shared
linkage paths which do change some of the code-generation to deal with
the moral equivalent of the GOT - the IAT.

Special thanks to @slavapestov for the pointer to
`isDependentConformance`.  This should eliminate the last known issue
with cross-module protocol conformances.

Fixes: SR-14807

The 5.5-only test changes are due to the lack of support for static
linking which means that all the support modules are treated as though
they are behind a resiliency boundary on Windows.  We relax the tests to
accept both though on main we do not do so.
@compnerd
Copy link
Member Author

compnerd commented Dec 1, 2021

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Dec 2, 2021

@swift-ci please test Windows platform

@tkremenek tkremenek merged commit 2c007d8 into swiftlang:release/5.5 Dec 3, 2021
@compnerd compnerd deleted the 5-5-accessory branch December 3, 2021 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants