-
Notifications
You must be signed in to change notification settings - Fork 25
Build on Apple Silicon fails #110
Comments
same question |
Seems known issue on Swift side: https://forums.swift.org/t/building-swift-fails-on-m1-mba/42181/4 |
The issue seems fixed, but i don't see it in current Swift 5.3.5 release. You can try to change this line of code: https://github.com/apple/swift/pull/34998/files#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aL761 |
Ok, I changed this line from However, the change does not seem to get picked up or does not work. |
For now, I found the following workaround: I compiled the toolchain on amd64, then copied it to the M1 machine. When building the swift everywhere sample application, Android Studio complained about the swift binary not being signed. So I added Android Studio to the list of "developer tools" at -> system settings -> security -> privacy After installing the Android Studio Simulator Preview for M1 I was able to run the example in the simulator. |
Glad to know. |
Looks like the patch is in the upcoming |
Seems that the NDK is not yet compatible with Apple Silicon. However, compiling swift for android runs pretty fast under rosetta emulation on an M1. I heard that gradle and android studio are unusable slow when emulated. Might be worth trying to natively compile the java sources and use emulation for comping the swift sources until NDK and swift 5.4 is ready. @jt9897253 |
Maybe release https://github.com/vgorloff/swift-everywhere-toolchain/releases/tag/1.0.69 solves the problem. |
Testing with tag 1.0.69, NDK_VERSION 21.4.7075529, Xcode 12.5, macOS 11.4 results in the following error:
According to the YAMS changelog, version 4.0.2 and newer of yams to support apple silicon. However, the latest version shown in the changelog at I tested updating yams by changing the yams version in Now, yams builds cleanly on Apple Silicon. I'll create a pull request for this change. However, the build still fails. Now with:
|
Yet another ARM build issue - I hope that, maybe, Swift v5.4.1 already have a fix for this issue. Will look on it. |
Problem persists for tag 1.0.70 with Swift 5.4.1 |
After looking into this problem again, I made the following changes:
Now, running
succeeds and
correctly returns Also, building swift-driver with
no longer produces an error. However, the next build error is
I had to manually apply the changes from https://github.com/apple/swift/pull/38415/files to work around this. Swift PR 38415 was referenced at https://bugs.swift.org/browse/SR-14035 That means I had to update the file at
Now everything compiles on apple silicon! In case the above change to |
Super. I will apply suggested changes in coming days and test on |
commit 674ef01 Author: Vlad Gorlov <volodymyr.gorlov@gmail.com> Date: Fri Sep 17 15:57:09 2021 +0200 #110 M1 chip fixes. commit 0364e27 Author: Vlad Gorlov <volodymyr.gorlov@gmail.com> Date: Fri Sep 17 14:40:32 2021 +0200 #110 M1 chip fixes. commit 2bef968 Author: Vlad Gorlov <volodymyr.gorlov@gmail.com> Date: Fri Sep 17 09:54:37 2021 +0200 #110 M1 chip fixes.
x86_64 build works on my side. Fix included into release https://github.com/vgorloff/swift-everywhere-toolchain/releases/tag/1.0.72. I hope that toolchain build still also works on Apple Silicon. |
Building release 1.0.72 on arm64/Apple Silicon succeeds. Thank's for merging the changes and maintaining this project! |
Using
NDK 21.3.6528147
Branch
1.0.66
ordevelop
Looks like lipo is trying to add the same architecture twice in this command:
The file
libswiftCompatibility50.a
already contains intel and arm64 slices:The text was updated successfully, but these errors were encountered: