-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build-script-impl] Allow cross-compiling the host toolchain for Android #31065
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
@swift-ci smoke test |
Passes all CI, ready to go. |
@drexin or @drodriguez, can we get this one-liner in before the 5.3 branch? |
utils/build-script-impl
Outdated
@@ -917,7 +917,7 @@ function false_true() { | |||
CROSS_COMPILE_HOSTS=($CROSS_COMPILE_HOSTS) | |||
for t in "${CROSS_COMPILE_HOSTS[@]}"; do | |||
case ${t} in | |||
iphone* | appletv* | watch* | linux-armv6 | linux-armv7 ) | |||
iphone* | appletv* | watch* | linux-armv6 | linux-armv7 | android-aarch64 ) |
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.
Can this be android-*
like the ones at the start of the line? Thanks.
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.
I've never tried anything other than AArch64, but I guess the others would work too. I'll change it.
@swift-ci please test |
Build failed |
Build failed |
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
Thanks. @drexin, would you like me to submit a backport of #30565 for the 5.2 branch? If you try to build the whole Swift 5.2 toolchain with |
@buttaface This is not on 5.3, yet. If you want it on 5.3, you have to backport it to |
Up to you if you also want it on 5.2. |
Ah, yes. It‘s really up to you if you want it in 5.2 or not. It‘s not up to me what gets merged anyway 🙂 |
This was needed in order to cross-compile the Swift compiler for Android AArch64, which is why it is now available on any Android AArch64 device running 7.0 Nougat or later. Simply install the Termux app and run
pkg install swift
and you have a working Swift 5.2.1 compiler. I ran the Swift validation suite with this cross-compiled compiler and 90% of the tests passed, with the remaining failing mostly because they were missing host test binaries likesourcekitd-test
.@drexin, one last tiny Android patch extracted from my Termux packaging scripts that should be safe to merge.