[5.9 🍒] Fixes to WMO invocations without .swift
input files
#1364
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.
Cherry-pick #1347 and #1350
• Release: Swift 5.9
• Explanation: Invoking the driver (
swiftc
) in WMO mode with a collection of object file inputs crashes the driver. The expectation is that, in the absence of.swift
inputs, the driver will simply invoke the linker to produce a binary of a desired kind. Instead, the driver crashes.• Scope of Issue: Command-line
swiftc
users who wish to use it to link stuff, orswiftc
command-line generators who might do the same, e.g. CMake.• Origination: A long-standing driver bug (even affects the legacy C++ driver...)
• Risk: Risk of this change is very low. It ensures the driver carefully checks what kinds of inputs it is dealing with instead of indiscriminately assuming it is fed
.swift
files. And now instead of crashing, it does the right thing.• Reviewed By: @etcwilde
• Automated Testing: Tests added to the driver test suite
• Dependencies: Are there any submission dependencies this change needs?
Resolves rdar://108057797