-
Notifications
You must be signed in to change notification settings - Fork 538
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
[aot] Make it possible to use AOT compiler without NDK #3317
Conversation
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets
Outdated
Show resolved
Hide resolved
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.
We should add some documentation regarding that fact that we need the NDK for AOT+LLVM, but that "normal" AOT will work just fine with the ndk-bundle that ships with the SDK.
We redistributed as, ld and strip tools and point AOT compiler to them. For AOT/llvm we still depend on NDK.
Co-Authored-By: Jonathan Peppers <[email protected]>
e32ce7b
to
db50255
Compare
This test checks the error messages about NDK, but normal AOT should not fail anymore, because it doesn't need NDK. So update it to try AOT/LLVM instead, which still requires NDK.
@monojenkins build failed |
build "Xamarin.Android" |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
you mean without LLVM? what is the difference between NDK and ndk-bundle? isnt ndk bundle a copy of ndk? i have been using aot+llvm with ndk-bundle all the time without any issue. |
@monojenkins build failed |
…3317) Fixes: #3299 Profiled AOT (6e88ffa) requires a handful of things to work: 1. The mono cross-compilers, and 2. Various Android NDK tools such as `as` (assembler), `ld` (linker), and `strip`. As of decfbcc, Xamarin.Android *already* redistributes `as`. Update `make prepare` and installer creation so that Xamarin.AndroidAotMode also redistributes `ld` and `strip` for all supported ABIs. This has two benefits: 1. Profiled AOT and "normal" AOT use will not require that the full Android NDK be installed. 2. Redistribution helps "firewall" the binaries for macOS Catalina. The full Android NDK is a ~700-800MB download (r19c is 770MB, r20 is 804MB) and ~3GB extracted/installed, while adding `ld` and `strip` to our installation only increases the `.pkg` size by ~8MB and installation size by ~20MB. (`as` is already installed.) Redistribution of `ld` and `strip` thus makes it much easier for customers to use AOT. **Note**: AOT+LLVM (`$(AndroidAotMode)` != None *and* `$(EnableLLVM)`=True) still requires a full NDK. Finally, macOS Catalina is [removing support for 32-bit apps][0]. The Android NDK r8d and earlier provide 32-bit binaries for some (all?) of these utilities, and thus they won't work on the forthcoming macOS 10.15 Catalina release. The [NDK r8e][1] release notes state: > Added 64-bit host toolchain set (package name suffix *-x86_64.*). > For more information, see `CHANGES.HTML` and `NDK-BUILD.html`. Including these utilities thus removes a partial dependency on the installed Android NDK, which should increase the likelihood of successful Profiled AOT use on macOS Catalina. [0]: https://support.apple.com/en-us/HT208436 [1]: https://developer.android.com/ndk/downloads/revision_history
Implements #3299
We will redistribute
as
,ld
andstrip
tools and point AOT compiler tothese.
For AOT/llvm we still depend on NDK.