Wasm: Use -sysroot value as the clang linker sysroot if provided
#2053
+22
−1
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.
For other Unix-like platforms, the driver already respects
-sysrootover-sdkas the native sysroot (not Swift "SDK"). See the following PRs for reference:-sysrootflag for all non-Darwin Unix platforms, not just Android #1811-sysrootoption for non-Darwin targets swift#72352For WebAssembly, this change makes the driver behave consistently with other platforms. This consistency is important for supporting swiftc as a swift-build's underlying linker driver for Wasm targets, as UnixLd.xcspec now uses
-sysrootby default:https://github.com/swiftlang/swift-build/blob/02e9f6778b621375b5a5a2fe40f9a4b55bb44ba0/Sources/SWBGenericUnixPlatform/Specs/UnixLd.xcspec#L61-L68