Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build-tools/scripts/Ndk.projitems.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<AndroidNdkApiLevel_X86 Condition=" '$(AndroidNdkApiLevel_X86)' == '' ">@NDK_X86_API_NET@</AndroidNdkApiLevel_X86>
<AndroidNdkApiLevel_X86_64 Condition=" '$(AndroidNdkApiLevel_X86_64)' == '' ">@NDK_X86_64_API@</AndroidNdkApiLevel_X86_64>
<AndroidNdkApiLevel_X64 Condition=" '$(AndroidNdkApiLevel_X64)' == '' ">@NDK_X86_64_API_NET@</AndroidNdkApiLevel_X64>
<AndroidNdkApiLevelNonMono_Arm Condition=" '$(AndroidNdkApiLevelNonMono_Arm)' == '' ">@NDK_ARMEABI_V7_API_NON_MONO@</AndroidNdkApiLevelNonMono_Arm>
<AndroidNdkApiLevelNonMono_Arm64 Condition=" '$(AndroidNdkApiLevelNonMono_Arm64)' == '' ">@NDK_ARM64_V8A_API_NON_MONO@</AndroidNdkApiLevelNonMono_Arm64>
<AndroidNdkApiLevelNonMono_X64 Condition=" '$(AndroidNdkApiLevelNonMono_X64)' == '' ">@NDK_X86_64_API_NON_MONO@</AndroidNdkApiLevelNonMono_X64>
</PropertyGroup>
Expand All @@ -21,9 +22,10 @@
Condition=" $(AndroidSupportedTargetJitAbisForConditionalChecks.Contains (':armeabi-v7a:')) ">
<ApiLevel>$(AndroidNdkApiLevel_ArmV7a)</ApiLevel>
<ApiLevelNET>$(AndroidNdkApiLevel_Arm)</ApiLevelNET>
<ApiLevelNonMono>$(AndroidNdkApiLevelNonMono_Arm)</ApiLevelNonMono>
<AndroidRID>android-arm</AndroidRID>
<SupportMonoVM>True</SupportMonoVM>
<SupportCoreCLR>False</SupportCoreCLR>
<SupportCoreCLR>True</SupportCoreCLR>
<SupportNativeAOT>False</SupportNativeAOT>
</AndroidSupportedTargetJitAbi>

Expand Down
3 changes: 2 additions & 1 deletion build-tools/scripts/XABuildConfig.cs.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ namespace Xamarin.Android.Tools
};

public static readonly Dictionary <AndroidTargetArch, int> 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@ },
};
}
Expand Down
1 change: 1 addition & 0 deletions build-tools/scripts/xa_build_configuration.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ set(NETCORE_APP_RUNTIME_DIR_ARM64 "@NETCORE_APP_RUNTIME_ANDROID_ARM64@")
set(NETCORE_APP_RUNTIME_DIR_X86 "@NETCORE_APP_RUNTIME_ANDROID_X86@")
set(NETCORE_APP_RUNTIME_DIR_X86_64 "@NETCORE_APP_RUNTIME_ANDROID_X86_64@")

set(CORECLR_APP_RUNTIME_DIR_ARM "@CORECLR_APP_RUNTIME_ANDROID_ARM@")
set(CORECLR_APP_RUNTIME_DIR_ARM64 "@CORECLR_APP_RUNTIME_ANDROID_ARM64@")
set(CORECLR_APP_RUNTIME_DIR_X86_64 "@CORECLR_APP_RUNTIME_ANDROID_X86_64@")
8 changes: 6 additions & 2 deletions build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ GeneratedFile Get_Cmake_XA_Build_Configuration (Context context)
{ "@NETCORE_APP_RUNTIME_ANDROID_X86@", Utilities.EscapePathSeparators (Configurables.Paths.NetcoreAppRuntimeAndroidX86) },
{ "@NETCORE_APP_RUNTIME_ANDROID_X86_64@", Utilities.EscapePathSeparators (Configurables.Paths.NetcoreAppRuntimeAndroidX86_64) },

{ "@CORECLR_APP_RUNTIME_ANDROID_ARM@", Utilities.EscapePathSeparators (Configurables.Paths.CoreClrAppRuntimeAndroidARM) },
{ "@CORECLR_APP_RUNTIME_ANDROID_ARM64@", Utilities.EscapePathSeparators (Configurables.Paths.CoreClrAppRuntimeAndroidARM64) },
{ "@CORECLR_APP_RUNTIME_ANDROID_X86_64@", Utilities.EscapePathSeparators (Configurables.Paths.CoreClrAppRuntimeAndroidX86_64) },
};
Expand All @@ -124,8 +125,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)) },
};
Expand Down Expand Up @@ -197,6 +199,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 (':', ';') },
Expand Down Expand Up @@ -257,6 +260,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 },
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"Microsoft.Android.Runtime.Mono.37.android-arm64",
"Microsoft.Android.Runtime.Mono.37.android-x86",
"Microsoft.Android.Runtime.Mono.37.android-x64",
"Microsoft.Android.Runtime.CoreCLR.37.android-arm",
"Microsoft.Android.Runtime.CoreCLR.37.android-arm64",
"Microsoft.Android.Runtime.CoreCLR.37.android-x64",
"Microsoft.Android.Runtime.NativeAOT.37.android-arm64",
Expand Down Expand Up @@ -78,6 +79,10 @@
"kind": "framework",
"version": "@WORKLOAD_VERSION@"
},
"Microsoft.Android.Runtime.CoreCLR.37.android-arm": {
"kind": "framework",
"version": "@WORKLOAD_VERSION@"
},
"Microsoft.Android.Runtime.CoreCLR.37.android-arm64": {
"kind": "framework",
"version": "@WORKLOAD_VERSION@"
Expand Down
2 changes: 2 additions & 0 deletions src/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ if(IS_CLR_RUNTIME)
set(LOCAL_CORECLR_CONFIG Release)
endif()

set(RUNTIME_DIR_ARM "${LOCAL_CORECLR_PATH}/${CLR_PACKAGE_NAME_STEM}-arm/${LOCAL_CORECLR_CONFIG}/runtimes/android-arm")
set(RUNTIME_DIR_ARM64 "${LOCAL_CORECLR_PATH}/${CLR_PACKAGE_NAME_STEM}-arm64/${LOCAL_CORECLR_CONFIG}/runtimes/android-arm64")
set(RUNTIME_DIR_X86_64 "${LOCAL_CORECLR_PATH}/${CLR_PACKAGE_NAME_STEM}-x64/${LOCAL_CORECLR_CONFIG}/runtimes/android-x64")
else()
set(RUNTIME_DIR_ARM "${CORECLR_APP_RUNTIME_DIR_ARM}")
set(RUNTIME_DIR_ARM64 "${CORECLR_APP_RUNTIME_DIR_ARM64}")
set(RUNTIME_DIR_X86_64 "${CORECLR_APP_RUNTIME_DIR_X86_64}")
endif()
Expand Down
21 changes: 21 additions & 0 deletions src/native/CMakePresets.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/native/clr/host/typemap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<const char*>(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; };
Expand Down
3 changes: 1 addition & 2 deletions src/native/native-clr.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<OutputType>Exe</OutputType>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

<!-- HACK HACK: until CoreCLR exists for all the targets, work only with arm64 -->
<AndroidSupportedTargetAotAbis>arm64:x86_64</AndroidSupportedTargetAotAbis>
<AndroidSupportedTargetJitAbis>arm64-v8a:x86_64</AndroidSupportedTargetJitAbis>
<AndroidSupportedTargetJitAbis>armeabi-v7a:arm64-v8a:x86_64</AndroidSupportedTargetJitAbis>
</PropertyGroup>

<Import Project="..\..\Configuration.props" />
Expand Down