Skip to content

[5.9 🍒] Fixes to WMO invocations without .swift input files #1364

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 2 commits into from
May 19, 2023

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented May 19, 2023

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, or swiftc 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

artemcm added 2 commits May 19, 2023 11:48
…are specified as inputs

Resolves rdar://108057797
…urce file

Otherwise, if the first argument is anything else (e.g. an object file) we will use it as a key and the compiler won't be too happy about that.

Resolves rdar://108741675
@artemcm artemcm requested review from etcwilde and nkcsgexi May 19, 2023 18:55
@artemcm
Copy link
Contributor Author

artemcm commented May 19, 2023

@swift-ci test

@artemcm artemcm merged commit 1d8848d into swiftlang:release/5.9 May 19, 2023
@artemcm artemcm deleted the CherryWMOFixes branch May 19, 2023 20:45
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.

3 participants