dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.94k stars 533 forks source link

[Xamarin.Android.Build.Tasks] add `AndroidAotMode=FullInterp` #9486

Open jonathanpeppers opened 2 weeks ago

jonathanpeppers commented 2 weeks ago

Context: https://github.com/dotnet/android/issues/9469#issuecomment-2457930832

I don't think this actually works, as the AOT compiler fails with:

> dotnet build -c Release -p:AndroidAotMode=FullInterp -p:AndroidEnableProfiledAot=false -bl -t:Install -r android-x64
helloandroid failed with 1 error(s) (8.9s)
    D:\src\xamarin-android\bin\Debug\lib\packs\Microsoft.Android.Sdk.Windows\35.99.0\targets\Microsoft.Android.Sdk.Aot.targets(110,5): error :
    Precompiling failed for D:\src\helloandroid\obj\Release\net9.0-android\android-x64\linked\System.Private.CoreLib.dll with exit code -1073740791.
    Mono Ahead of Time compiler - compiling assembly D:\src\helloandroid\obj\Release\net9.0-android\android-x64\linked\System.Private.CoreLib.dll
    AOTID 7FACD039-CD91-2136-1ACD-BC2EDF417C8D
    * Assertion: should not be reached at D:\a\_work\1\s\src\mono\mono\mini\tramp-amd64.c:1216
helloandroid failed (0.7s) → bin\Release\net9.0-android\android-x64\helloandroid.dll

Which is the assertion here:

https://github.com/dotnet/runtime/blob/7dab903b20269d78c6bc08d5269947db7d35c22b/src/mono/mono/mini/tramp-amd64.c#L1216

jonathanpeppers commented 2 weeks ago

/cc @ivanpovazan