-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Potential fix for --xcode build on M1. #58957
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
Conversation
I have had to manually pass |
I can do that even if perhaps it is better in a separate PR. Can you suggest some wording and where to add it? |
For local development you should use |
So we're happy leaving the default documented invocation for the build not working on M1? |
I don't think I have the time to do that myself, but I would definitely review a PR made by someone else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks @eeckstein |
@swift-ci Please test |
Thanks @LucianoPAlmeida |
Since it got the approval, let's |
Terrific, thanks again! Does anybody have any ideas on what the problem with using utils/build-toolchain on an M1 might be? It doesn't seem to have been adapted for bootstrapping even if you turn it off. Pointers welcome as I may take a look at it myself though these days I just download one of the nightlies and symbolically link build products into it to work with Xcode. |
I made some progress getting a toolchain out on an M1 by using "Rosetta2" in the end. #56426 (comment) |
Hi Apple,
I've been having difficulties building the Swift compiler on an M1 for some time now. This small CMake fix seems to resolve the problem and carry relatively little risk of regression. The problem was the generated
SwiftInTheCompiler.xcodeproj
was silently failing to build the static libraries containing Swift sources used in the bootstrapping process to link them into the compiler. This seems to be a feature of Xcode when the target doesn't contain a "Compile Sources" build phase and only links object files (I have no idea why this would be specific to M1.) By creating a dummy source file and including it in the project this forces Xcode to build the static library and subsequent bootstrapping stages can proceed.I'm using Xcode 13.4 & 13.2.1, CMake 3.23.1 & 3.20.1