Skip to content

[Explicit Module Builds] Initialize ClangImporter's CodeGenerator using Swift compilation Target Triple. #70564

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
Oct 24, 2024

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Dec 20, 2023

As per #65930, the Clang importer's Clang instance may be configured with a different (higher) OS version than the compilation target itself in order to be able to load pre-compiled Clang modules that are aligned with the broader SDK, and match the SDK deployment target against which Swift modules are also built. Code-generation, however, must use the actual compilation target triple. This matches how Swift itself loads Swift module dependencies as well: dependency .swiftinterface files are type-checked against the availability epoch and code-generated against the actual compilation triple.

Resolves rdar://113712186

@artemcm
Copy link
Contributor Author

artemcm commented Dec 20, 2023

@artemcm
Copy link
Contributor Author

artemcm commented Mar 5, 2024

Copy link
Contributor

@Bigcheese Bigcheese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual change looks correct, just a comment on the test.

@artemcm artemcm force-pushed the ExplicitBuildClangTargetIRGen branch from 80ad328 to f3d4a64 Compare March 5, 2024 22:44
@artemcm
Copy link
Contributor Author

artemcm commented Mar 5, 2024

@artemcm artemcm force-pushed the ExplicitBuildClangTargetIRGen branch from f3d4a64 to 26bf106 Compare March 6, 2024 22:43
@artemcm
Copy link
Contributor Author

artemcm commented Mar 6, 2024

…sing Swift compilation Target Triple.

As per swiftlang#65930, the Clang importer's Clang instance may be configured with a different (higher) OS version than the compilation target itself in order to be able to load pre-compiled Clang modules that are aligned with the broader SDK, and match the SDK deployment target against which Swift modules are also built. Code-generation, however, must use the actual compilation target triple. This matches how Swift itself loads Swift module dependencies as well: dependency '.swiftinterface' files are type-checked against the availability epoch and code-generated against the actual compilation triple.

Resolves rdar://113712186
@artemcm artemcm force-pushed the ExplicitBuildClangTargetIRGen branch from 26bf106 to 0fbbba5 Compare October 21, 2024 21:12
@artemcm artemcm requested a review from rjmccall as a code owner October 21, 2024 21:12
@artemcm
Copy link
Contributor Author

artemcm commented Oct 21, 2024

@artemcm artemcm merged commit d0ff56b into swiftlang:main Oct 24, 2024
5 checks passed
@artemcm artemcm deleted the ExplicitBuildClangTargetIRGen branch October 24, 2024 16:45
artemcm added a commit to artemcm/swift that referenced this pull request Apr 25, 2025
…n target triple

Similarly to how swiftlang#70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols.
artemcm added a commit to artemcm/swift that referenced this pull request Apr 28, 2025
…n target triple

Similarly to how swiftlang#70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols.
artemcm added a commit to artemcm/swift that referenced this pull request Apr 28, 2025
…n target triple

Similarly to how swiftlang#70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols.
artemcm added a commit to artemcm/swift that referenced this pull request Apr 28, 2025
…n target triple

Similarly to how swiftlang#70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols.
artemcm added a commit to artemcm/swift that referenced this pull request Apr 30, 2025
…n target triple

Similarly to how swiftlang#70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols.
artemcm added a commit to artemcm/swift that referenced this pull request Apr 30, 2025
…n target triple

Similarly to how swiftlang#70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols.
artemcm added a commit to artemcm/swift that referenced this pull request May 1, 2025
…n target triple

Similarly to how swiftlang#70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols.
artemcm added a commit to artemcm/swift that referenced this pull request May 1, 2025
…n target triple

Similarly to how swiftlang#70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols.
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.

2 participants