Skip to content
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

Merged
merged 7 commits into from
Aug 2, 2019

Conversation

radekdoulik
Copy link
Member

@radekdoulik radekdoulik commented Jul 2, 2019

Implements #3299

We will redistribute as, ld and strip tools and point AOT compiler to
these.

For AOT/llvm we still depend on NDK.

Copy link
Contributor

@dellis1972 dellis1972 left a 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.

radekdoulik and others added 5 commits July 16, 2019 10:16
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]>
@radekdoulik radekdoulik force-pushed the pr-aot-without-ndk-2 branch from e32ce7b to db50255 Compare July 16, 2019 08:17
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.
@radekdoulik
Copy link
Member Author

@monojenkins build failed

@radekdoulik
Copy link
Member Author

build "Xamarin.Android"

@radekdoulik
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@EmilAlipiev
Copy link

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.

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.

@radekdoulik
Copy link
Member Author

@monojenkins build failed

@jonpryor jonpryor merged commit f0b1e8a into dotnet:master Aug 2, 2019
jonpryor pushed a commit that referenced this pull request Aug 9, 2019
…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
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants