Skip to content

rdar://90360204 #4147

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 3 commits into from
Mar 31, 2022
Merged

Conversation

JDevlieghere
Copy link

No description provided.

labath and others added 3 commits March 30, 2022 15:45
This patch changes the return value of Platform::GetName() to a
StringRef, and uses the opportunity (compile errors) to change some
callsites to use GetPluginName() instead. The two methods still remain
hardwired to return the same thing, but this will change once the ideas
in
<https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>
are implemented.

Differential Revision: https://reviews.llvm.org/D119146

(cherry picked from commit d2edca6)
Currently, when creating a target for a fat binary, we error out if more
than one platforms can support the different architectures in the
binary. There are situations where it makes sense for multiple platforms
to support the same architectures: for example the host and
remote-macosx platform on Darwin.

The only way to currently disambiguate between them is to specify the
architecture. This patch changes that to take into account the selected
and host platform. The new algorithm works a follows:

1. Pick the selected platform if it matches any of the architectures.
2. Pick the host platform if it matches any of the architectures.
3. If there's one platform that works for all architectures, pick that.

If none of the above apply then we either have no platform supporting
the architectures in the fat binary or multiple platforms with no good
way to disambiguate between them.

I've added a bunch of unit tests to codify this new behavior.

rdar://90360204

Differential revision: https://reviews.llvm.org/D122684

(cherry picked from commit a114ec0)
@JDevlieghere
Copy link
Author

@swift-ci please test

@JDevlieghere JDevlieghere merged commit 0438c38 into stable/20211026 Mar 31, 2022
@compnerd
Copy link
Member

This seems to be causing trouble for the windows builders: https://ci-external.swift.org/job/oss-swift-windows-toolchain-x86_64-vs2019/375/console

@compnerd compnerd deleted the jdevlieghere/main/rdar/82390061 branch March 31, 2022 15:37
@compnerd
Copy link
Member

https://reviews.llvm.org/D119146 indicates that this was a problem upstream as well

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