-
Notifications
You must be signed in to change notification settings - Fork 533
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
[Xamarin.Android.Build.Tasks] Use binutils for Aot and LLVM #6901
Conversation
69fc7e5
to
dbe508e
Compare
dbe508e
to
b8ae8e7
Compare
f03ab69
to
a8e7272
Compare
a8e7272
to
aa58775
Compare
36c2652
to
b4e56a3
Compare
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.
After we merge this, is it worth making the lookup of the NDK in xamarin-android-tools optional?
I haven't measured, but surely some amount of milliseconds probing for NDKs, and we could skip that now?
Oh, I see the |
I think there are still a couple of test failures using the latest Android NDK when LLVM is disabled, but I wanted to open this up for review on the general approach of the changes. I'm wondering if we should only allow AOT to use the Android NDK when LLVM is enabled, as that is how things work today?
I'm not sure we want to do this quite yet, as I think that lookup will set |
Right now I don't think you can use LLVM without having an NDK -- but I was thinking we could fix that? Like it should be possible to work? If you didn't need the NDK, we could enable LLVM by default for |
LLVM doesn't need the NDK as far as I have seen, this PR will allow AOT+LLVM builds to work without the Android NDK (and not use the Android NDK by default). |
The latest test failures appear to be ignorable. I spent some more time testing this today but am blocked on LLVM configurations with .NET 7 due to a known crash. We may want to consider holding this until we can further test LLVM with .NET 7.
@jonathanpeppers do you happen to remember a scenario where LLVM relied on the NDK? When previously testing this against .NET 6 and classic LLVM was working for me without the NDK at least in some simple project template cases. |
@pjcollins in #6539 I remember some LLVM tests failed when I tried, but there are other changes in xamarin-android/main now. Could the LLVM-IR support @grendello added make this work now? If you're testing, and LLVM is working without an NDK let's try it. |
f5ac71f
to
9770e8d
Compare
9770e8d
to
538bf6b
Compare
538bf6b
to
97ffc02
Compare
It appears that an Android NDK installation is no longer needed when using Aot with LLVM. Projects which enable Aot and LLVM will no longer attempt to use the NDK unless it is explicitly requested by setting `$(AndroidNdkDirectory)` to a valid NDK path in the project file.
97ffc02
to
4f56be8
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There are a couple of bugs to revisit in the future once we have the latest 7.0.100 RC builds from runtime, but this should be good to go if CI looks good. |
@@ -306,7 +307,9 @@ string GetLdFlags(NdkTools ndk, AndroidTargetArch arch, int level, string toolPr | |||
// Without the flag, `lld` will modify AOT-generated code in a way that the Mono runtime doesn't support. Until | |||
// the runtime issue is fixed, we need to pass this flag then. | |||
// | |||
ldFlags.Append ("--no-relax"); | |||
if (!UseAndroidNdk) { |
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 wonder if (at some point, not necessarily in this PR) we could detect the version of LLVM in the NDK and append --no-relax
if that version is >= 14
* main: Bump to dotnet/installer@dd355bb 7.0.100-rc.2.22457.6 (dotnet#7360) [Xamarin.Android.Build.Tasks] Use binutils for Aot and LLVM (dotnet#6901)
Hi, we're hoping this fixes #7352. Has this been released yet? I'm not good at knowing how issues make it into releases and get shipped. Would appreciate some insight. |
It appears that an Android NDK installation is no longer needed when
using Aot with LLVM. Projects which enable Aot and LLVM will no longer
attempt to use the NDK unless it is explicitly requested by setting
$(AndroidNdkDirectory)
to a valid NDK path in the project file.