[5.9][build] Make sure SPM is built with the forked clang, not the host clang #67249
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.
Cherrypick of #64629
Explanation: SPM was built with the freshly-built Swift toolchain, including the Swift-forked clang, for years, but a change in swiftlang/swift-package-manager#5894 late last year inadvertently switched it to be built with the system clang used to natively build the Swift compiler, ie
self.toolchain.cc
inbuild-script
. That passed the CI but caused problems when cross-compiling SPM on my daily Android CI, as the system clang is only meant for native compilation- for example, we use the freshly-built Swift-forked clang for the native host by default when cross-compiling the Swift compiler itself- so I've been using this patch for the last seven months on my Android CI.Scope: Only affects the C/C++/asm files built as part of SwiftPM, particularly when cross-compiled
Issue: None
Risk: low, as this only affects compilation of non-Swift portions of SPM itself
Testing: Passed all CI on trunk and I've been using this on my Android CI since last year
Reviewer: @etcwilde