Skip to content

Commit add9b29

Browse files
[Xamarin.Android.Build.Tasks] add AndroidAotMode=FullInterp
Context: #9469 (comment) 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
1 parent 4266c2b commit add9b29

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public enum AotMode : uint
1919
Hybrid = 0x0002,
2020
Full = 0x0003,
2121
Interp = 0x0004,
22+
FullInterp = 0x0005,
2223
}
2324

2425
public enum SequencePointsMode {
@@ -181,6 +182,10 @@ IEnumerable<Config> GetAotConfigs (NdkTools ndk)
181182
case AotMode.Hybrid:
182183
aotOptions.Add ("hybrid");
183184
break;
185+
186+
case AotMode.FullInterp:
187+
aotOptions.Add ("fullinterp");
188+
break;
184189
}
185190

186191
if (!string.IsNullOrEmpty (LdFlags)) {

src/Xamarin.Android.Build.Tasks/Tasks/GetAotArguments.cs

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ public static bool GetAndroidAotMode(string androidAotMode, out AotMode aotMode)
9898
case "full":
9999
aotMode = AotMode.Full;
100100
return true;
101+
case "fullinterp":
102+
aotMode = AotMode.FullInterp;
103+
return true;
101104
case "interpreter":
102105
// We don't do anything here for this mode, this is just to set the flag for the XA
103106
// runtime to initialize Mono in the interpreter "AOT" mode.

src/native/runtime-base/android-system.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,11 @@ AndroidSystem::setup_environment () noexcept
589589
break;
590590

591591
case 'f':
592-
aotMode = MonoAotMode::MONO_AOT_MODE_FULL;
592+
if (strcmp (mono_aot_mode_name, "fullinterp") == 0) {
593+
aotMode = MonoAotMode::MONO_AOT_MODE_INTERP;
594+
} else {
595+
aotMode = MonoAotMode::MONO_AOT_MODE_FULL;
596+
}
593597
break;
594598

595599
case 'i':

0 commit comments

Comments
 (0)