From 4736092d974c1de75616212f708c3789858fba42 Mon Sep 17 00:00:00 2001 From: Simon Rozsival Date: Tue, 21 Apr 2026 17:17:28 +0200 Subject: [PATCH 1/3] Enable CoreCLR runtime pack for android-arm (armeabi-v7a) Enable the CoreCLR runtime flavor for the armeabi-v7a ABI, following the same pattern as android-arm64 and android-x64. Changes: - Set SupportCoreCLR=True for armeabi-v7a in Ndk.projitems.in - Add ApiLevelNonMono metadata and corresponding property/placeholder - Add Microsoft.Android.Runtime.CoreCLR.36.1.android-arm to workload manifest Depends on dotnet/runtime#127225 and dotnet/runtime#126838 (API level 24). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build-tools/scripts/Ndk.projitems.in | 4 +++- build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs | 1 + .../Microsoft.NET.Sdk.Android/WorkloadManifest.in.json | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/build-tools/scripts/Ndk.projitems.in b/build-tools/scripts/Ndk.projitems.in index fbc98d84a4b..e5c066b0c32 100644 --- a/build-tools/scripts/Ndk.projitems.in +++ b/build-tools/scripts/Ndk.projitems.in @@ -11,6 +11,7 @@ @NDK_X86_API_NET@ @NDK_X86_64_API@ @NDK_X86_64_API_NET@ + @NDK_ARMEABI_V7_API_NON_MONO@ @NDK_ARM64_V8A_API_NON_MONO@ @NDK_X86_64_API_NON_MONO@ @@ -21,9 +22,10 @@ Condition=" $(AndroidSupportedTargetJitAbisForConditionalChecks.Contains (':armeabi-v7a:')) "> $(AndroidNdkApiLevel_ArmV7a) $(AndroidNdkApiLevel_Arm) + $(AndroidNdkApiLevelNonMono_Arm) android-arm True - False + True False diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index 3198bc73d29..c6c6ba4bba3 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -257,6 +257,7 @@ GeneratedFile Get_Ndk_projitems (Context context) { "@NDK_X86_64_API@", BuildAndroidPlatforms.NdkMinimumAPI.ToString () }, { "@NDK_X86_64_API_NET@", BuildAndroidPlatforms.NdkMinimumAPI.ToString () }, { "@NDK_ARM64_V8A_API_NON_MONO@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, + { "@NDK_ARMEABI_V7_API_NON_MONO@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, { "@NDK_X86_64_API_NON_MONO@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, }; diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json index 3d8b411c1fb..36714696245 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json @@ -12,6 +12,7 @@ "Microsoft.Android.Runtime.Mono.36.1.android-arm64", "Microsoft.Android.Runtime.Mono.36.1.android-x86", "Microsoft.Android.Runtime.Mono.36.1.android-x64", + "Microsoft.Android.Runtime.CoreCLR.36.1.android-arm", "Microsoft.Android.Runtime.CoreCLR.36.1.android-arm64", "Microsoft.Android.Runtime.CoreCLR.36.1.android-x64", "Microsoft.Android.Runtime.NativeAOT.36.1.android-arm64", @@ -86,6 +87,10 @@ "kind": "framework", "version": "@WORKLOAD_VERSION@" }, + "Microsoft.Android.Runtime.CoreCLR.36.1.android-arm": { + "kind": "framework", + "version": "@WORKLOAD_VERSION@" + }, "Microsoft.Android.Runtime.CoreCLR.36.1.android-arm64": { "kind": "framework", "version": "@WORKLOAD_VERSION@" From 84c988208a894ea1c04aa19c1d8502e1c776915a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 09:16:37 +0000 Subject: [PATCH 2/3] Wire up rest of the repo for armeabi-v7a CoreCLR support Agent-Logs-Url: https://github.com/dotnet/android/sessions/57a8b6d4-93df-4f84-9b77-3a58a6e2158b Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com> --- build-tools/scripts/XABuildConfig.cs.in | 3 ++- .../xaprepare/Steps/Step_GenerateFiles.cs | 6 ++++-- src/native/CMakePresets.json.in | 21 +++++++++++++++++++ src/native/native-clr.csproj | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/build-tools/scripts/XABuildConfig.cs.in b/build-tools/scripts/XABuildConfig.cs.in index 5b8fd6b22a1..a452ad689fc 100644 --- a/build-tools/scripts/XABuildConfig.cs.in +++ b/build-tools/scripts/XABuildConfig.cs.in @@ -39,7 +39,8 @@ namespace Xamarin.Android.Tools }; public static readonly Dictionary ArchToApiLevelNonMono = new () { - { AndroidTargetArch.Arm64, @NDK_ARM64_V8A_NONMONO_API@ }, + { AndroidTargetArch.Arm, @NDK_ARMEABI_V7_NONMONO_API@ }, + { AndroidTargetArch.Arm64, @NDK_ARM64_V8A_NONMONO_API@ }, { AndroidTargetArch.X86_64, @NDK_X86_64_NONMONO_API@ }, }; } diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index c6c6ba4bba3..ec0ba284564 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -124,8 +124,9 @@ GeneratedFile GetCmakePresetsCommon (Context context, string sourcesDir) { "@NDK_ARM64_V8A_API_NET@", BuildAndroidPlatforms.NdkMinimumAPI }, { "@NDK_X86_API_NET@", BuildAndroidPlatforms.NdkMinimumAPILegacy32 }, { "@NDK_X86_64_API_NET@", BuildAndroidPlatforms.NdkMinimumAPI }, - { "@NDK_ARM64_V8A_NONMONO_API_NET@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, - { "@NDK_X86_64_NONMONO_API_NET@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, + { "@NDK_ARMEABI_V7_NONMONO_API_NET@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, + { "@NDK_ARM64_V8A_NONMONO_API_NET@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, + { "@NDK_X86_64_NONMONO_API_NET@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, { "@XA_BUILD_CONFIGURATION@", context.Configuration }, { "@XA_TEST_OUTPUT_DIR@", Utilities.EscapePathSeparators (props.GetRequiredValue (KnownProperties.TestOutputDirectory)) }, }; @@ -197,6 +198,7 @@ GeneratedFile Get_XABuildConfig_cs (Context context) { "@NDK_ARM64_V8A_API@", BuildAndroidPlatforms.NdkMinimumAPI.ToString () }, { "@NDK_X86_API@", BuildAndroidPlatforms.NdkMinimumAPILegacy32.ToString ().ToString () }, { "@NDK_X86_64_API@", BuildAndroidPlatforms.NdkMinimumAPI.ToString ().ToString () }, + { "@NDK_ARMEABI_V7_NONMONO_API@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, { "@NDK_ARM64_V8A_NONMONO_API@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, { "@NDK_X86_64_NONMONO_API@", BuildAndroidPlatforms.NdkMinimumNonMonoAPI }, { "@XA_SUPPORTED_ABIS@", context.Properties.GetRequiredValue (KnownProperties.AndroidSupportedTargetJitAbis).Replace (':', ';') }, diff --git a/src/native/CMakePresets.json.in b/src/native/CMakePresets.json.in index fb5c77267de..33bce5448ad 100644 --- a/src/native/CMakePresets.json.in +++ b/src/native/CMakePresets.json.in @@ -97,6 +97,17 @@ } }, + { + "name": "nonmono-common-armeabi-v7a", + "hidden": true, + "cacheVariables": { + "ANDROID_ABI": "armeabi-v7a", + "ANDROID_NATIVE_API_LEVEL": "@NDK_ARMEABI_V7_NONMONO_API_NET@", + "ANDROID_PLATFORM": "android-@NDK_ARMEABI_V7_NONMONO_API_NET@", + "ANDROID_RID": "android-arm" + } + }, + { "name": "common-arm64-v8a", "hidden": true, @@ -173,11 +184,21 @@ "inherits": ["default-common", "common-debug", "common-armeabi-v7a"] }, + { + "name": "coreclr-default-debug-armeabi-v7a", + "inherits": ["default-common", "common-debug", "nonmono-common-armeabi-v7a"] + }, + { "name": "default-release-armeabi-v7a", "inherits": ["default-common", "common-release", "common-armeabi-v7a"] }, + { + "name": "coreclr-default-release-armeabi-v7a", + "inherits": ["default-common", "common-release", "nonmono-common-armeabi-v7a"] + }, + { "name": "analyzers-debug-armeabi-v7a", "hidden": true, diff --git a/src/native/native-clr.csproj b/src/native/native-clr.csproj index bb3445fafb0..2922e884487 100644 --- a/src/native/native-clr.csproj +++ b/src/native/native-clr.csproj @@ -9,7 +9,7 @@ arm64:x86_64 - arm64-v8a:x86_64 + armeabi-v7a:arm64-v8a:x86_64 From 483822f304ec1db6120e74f474697ddae1210a20 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 14:20:46 +0000 Subject: [PATCH 3/3] Fix typemap.cc xxhash::hash call for 32-bit ARM build Agent-Logs-Url: https://github.com/dotnet/android/sessions/0e9f046e-d5f6-471f-97d4-3f8da467c15b Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com> --- src/native/clr/host/typemap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/clr/host/typemap.cc b/src/native/clr/host/typemap.cc index 85e5a37a3a5..8a52077d360 100644 --- a/src/native/clr/host/typemap.cc +++ b/src/native/clr/host/typemap.cc @@ -146,7 +146,7 @@ auto TypeMapper::managed_to_java_debug (const char *typeName, const uint8_t *mvi dynamic_local_path_string full_type_name; full_type_name.append (typeName); - hash_t mvid_hash = xxhash::hash (mvid, 16z); // we must hope managed land called us with valid data + hash_t mvid_hash = xxhash::hash (reinterpret_cast(mvid), 16z); // we must hope managed land called us with valid data auto equal = [](TypeMapAssembly const& entry, hash_t key) -> bool { return entry.mvid_hash == key; }; auto less_than = [](TypeMapAssembly const& entry, hash_t key) -> bool { return entry.mvid_hash < key; };