1.1: Use full module triple for Swift modules #492
Merged
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.
Install swiftmodules using the full module triple. This replaces the CMake logic that attempts to compute the appropriate architecture using values passed into CMake with a query to ask the compiler what the appropriate module triple is for the given input target triple. This is more robust mechanism and will future-proof this part of the code against any new platforms and architectures to anything that the Swift compiler building the project can support.
This is currently needed for the x86_64 FreeBSD bringup effort, where the
amd64architecture should be spelledx86_64in the swiftmodule triple for the Swift compiler to find it. A surgical approach adding another condition for amd64 FreeBSD would have less risk, but would also require a new tag for every new platform that theget_swift_host_archdidn't compute correctly or hadn't considered. The approach in the commit will work for all new platforms. Bugs in this approach will come from issues in the compiler when targeting the new platform and can be fixed in the compiler without changes to Swift-Collections.