Skip to content

bootstrap: generalize check for cross-compilation on Darwin #5755

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
Sep 7, 2022

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Sep 2, 2022

...so that the build with swiftpm can start.

This will allow to build a Swift toolchain on Apple Silicon

Addresses rdar://99484030

Motivation:

We are ironing out the current issues we are having when building a toolchain on Apple Silicon, and after #5754 we are now hitting

--- bootstrap: note: Building SwiftPM (with a freshly built swift-build)
--- bootstrap: error: cannot cross-compile for macosx-x86_64 

Modifications:

Amend a check so not to assume any particular architecture when assessing if we are cross compiling on Darwin.

Result:

We should be able to build swiftpm as part of a Swift toolchain on Apple Silicon

...so that the build with swiftpm can start.

This will allow to build a Swift toolchain on Apple Silicon

Addresses rdar://99484030
@edymtt
Copy link
Contributor Author

edymtt commented Sep 2, 2022

@swift-ci please smoke test

@neonichu
Copy link
Contributor

neonichu commented Sep 2, 2022

I think we need to keep checking build_target as well since the following code will only work on a macOS host.

@edymtt
Copy link
Contributor Author

edymtt commented Sep 5, 2022

@swift-ci please smoke test

@azarovalex
Copy link

We definitely need this fix to build the toolchain on M1, I ended up with the same fix locally.
Actually @johnno1962 tried to merge it a year ago: #3500 (comment)

It's good to see the fix finally landing.👍

@edymtt edymtt merged commit b87bd4f into swiftlang:main Sep 7, 2022
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.

5 participants