From 4d1e0eac7b53be89dddaecab6a55770acc16f6ef Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 5 Jun 2024 21:45:25 +0200 Subject: [PATCH 01/53] First steps towards native runtime linking at app build time --- .../Microsoft.Android.Sdk.After.targets | 3 + ...oft.Android.Sdk.AssemblyResolution.targets | 16 ++- ...soft.Android.Sdk.DefaultProperties.targets | 3 + ...icrosoft.Android.Sdk.NativeRuntime.targets | 24 ++++ .../Tasks/LinkNativeRuntime.cs | 103 ++++++++++++++++++ 5 files changed, 144 insertions(+), 5 deletions(-) create mode 100644 src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets create mode 100644 src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.After.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.After.targets index 8a64f834b80..b53b4737880 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.After.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.After.targets @@ -24,6 +24,9 @@ This file is imported *after* the Microsoft.NET.Sdk/Sdk.targets. + + + diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets index 10382ed3cc4..512f3210821 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets @@ -216,7 +216,17 @@ _ResolveAssemblies MSBuild target. - + + + <_MonoComponent Condition=" '$(AndroidEnableProfiler)' == 'true' " Include="diagnostics_tracing" /> + <_MonoComponent Condition=" '$(AndroidUseInterpreter)' == 'true' " Include="hot_reload" /> + <_MonoComponent Condition=" '$(AndroidIncludeDebugSymbols)' == 'true' " Include="debugger" /> + <_MonoComponent Condition=" '$(_AndroidExcludeMarshalIlgenComponent)' != 'true' " Include="marshal-ilgen" /> + + + + <_AndroidIncludeSystemGlobalizationNative Condition=" '$(_AndroidIncludeSystemGlobalizationNative)' == '' ">true <_AndroidEnableNativeStackTracing Condition=" '$(_AndroidEnableNativeStackTracing)' == ''">false @@ -225,10 +235,6 @@ _ResolveAssemblies MSBuild target. <_ResolvedNativeLibraries Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.so' " /> - <_MonoComponent Condition=" '$(AndroidEnableProfiler)' == 'true' " Include="diagnostics_tracing" /> - <_MonoComponent Condition=" '$(AndroidUseInterpreter)' == 'true' " Include="hot_reload" /> - <_MonoComponent Condition=" '$(AndroidIncludeDebugSymbols)' == 'true' " Include="debugger" /> - <_MonoComponent Condition=" '$(_AndroidExcludeMarshalIlgenComponent)' != 'true' " Include="marshal-ilgen" /> <_ExcludedNativeLibraries Condition=" '$(_AndroidIncludeSystemGlobalizationNative)' != 'true' " Include="libSystem.Globalization.Native" /> <_ExcludedNativeLibraries Condition=" '$(_AndroidEnableNativeStackTracing)' != 'true' " Include="libxamarin-native-tracing" /> diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets index f4b2c338709..40ead43dd58 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets @@ -52,6 +52,9 @@ When changing this default, change the value of `DefaultZipAlignment` in `src/Xamarin.Android.Build.Tasks/Tasks/AndroidZipAlign.cs` as well --> 16 + + + <_AndroidEnableNativeRuntimeLinking Condition=" '$(_AndroidEnableNativeRuntimeLinking)' == '' and '$(AndroidIncludeDebugSymbols)' != 'true' ">true diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets new file mode 100644 index 00000000000..068c81025fd --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets @@ -0,0 +1,24 @@ + + + + + + <_EnableNativeRuntimeLinking + + + + + + diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs new file mode 100644 index 00000000000..7ae34421acb --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Threading; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +using Xamarin.Android.Tools; +using Xamarin.Build; +using Microsoft.Android.Build.Tasks; + +namespace Xamarin.Android.Tasks; + +public class LinkNativeRuntime : AndroidAsyncTask +{ + class Archive + { + public readonly string Name; + public readonly Func Include = (Archive) => true; + + public Archive (string name, Func? include = null) + { + Name = name; + if (include != null) { + Include = include; + } + } + } + + class MonoComponentArchive : Archive + { + public readonly string ComponentName; + + public MonoComponentArchive (string name, string componentName, Func include) + : base (name, include) + { + ComponentName = componentName; + } + } + + readonly List KnownArchives; + + public override string TaskPrefix => "LNR"; + + public ITaskItem[] MonoComponents { get; set; } + + [Required] + public string AndroidBinUtilsDirectory { get; set; } + + public LinkNativeRuntime () + { + KnownArchives = new () { + new MonoComponentArchive ("libmono-component-diagnostics_tracing-static.a", "diagnostics_tracing", MonoComponentPresent), + new MonoComponentArchive ("libmono-component-diagnostics_tracing-stub-static.a", "diagnostics_tracing", MonoComponentAbsent), + new MonoComponentArchive ("libmono-component-marshal-ilgen-static.a", "marshal-ilgen", MonoComponentPresent), + new MonoComponentArchive ("libmono-component-marshal-ilgen-stub-static.a", "marshal-ilgen", MonoComponentAbsent), + + new Archive ("libmonosgen-2.0.a"), + new Archive ("libSystem.Globalization.Native.a"), + new Archive ("libSystem.IO.Compression.Native.a"), + new Archive ("libSystem.Native.a"), + new Archive ("libSystem.Security.Cryptography.Native.Android.a"), + }; + } + + public override System.Threading.Tasks.Task RunTaskAsync () + { + throw new NotImplementedException (); + } + + bool MonoComponentExists (Archive archive) + { + if (MonoComponents == null || MonoComponents.Length == 0) { + return false; + } + + var mcArchive = archive as MonoComponentArchive; + if (mcArchive == null) { + throw new ArgumentException (nameof (archive), "Must be an instance of MonoComponentArchive"); + } + + foreach (ITaskItem item in MonoComponents) { + if (String.Compare (item.ItemSpec, mcArchive.ComponentName, StringComparison.OrdinalIgnoreCase) == 0) { + return true; + } + } + + return false; + } + + bool MonoComponentAbsent (Archive archive) + { + return !MonoComponentExists (archive); + } + + bool MonoComponentPresent (Archive archive) + { + return MonoComponentExists (archive); + } +} From 87e42742278282e5cb2d8d2d4b5d6bbaa5cc6077 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Thu, 6 Jun 2024 22:08:48 +0200 Subject: [PATCH 02/53] The basics --- .../Microsoft.Android.Sdk.BuildOrder.targets | 1 + ...icrosoft.Android.Sdk.NativeRuntime.targets | 29 +++++- .../Tasks/GetNativeRuntimeComponents.cs | 56 +++++++++++ .../Tasks/LinkNativeRuntime.cs | 96 ++++++++----------- .../Utilities/AssemblyStoreGenerator.cs | 5 +- .../Utilities/NativeLinker.cs | 46 +++++++++ .../Utilities/NativeRuntimeComponents.cs | 85 ++++++++++++++++ .../Xamarin.Android.Common.targets | 3 +- 8 files changed, 257 insertions(+), 64 deletions(-) create mode 100644 src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs create mode 100644 src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs create mode 100644 src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets index ee627e65d03..ac02e9a2700 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets @@ -75,6 +75,7 @@ properties that determine build ordering. _ReadAndroidManifest; _CompileJava; _CreateApplicationSharedLibraries; + _LinkNativeRuntime; _CompileDex; $(_AfterCompileDex); _CreateBaseApk; diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets index 068c81025fd..0a0e1a54d19 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets @@ -7,18 +7,39 @@ Contains code to build and link the native runtime at application build time. *********************************************************************************************** --> + - - <_EnableNativeRuntimeLinking - + + + <_UnifiedNativeRuntime Include="$(_AndroidApplicationSharedLibraryPath)%(_BuildTargetAbis.Identity)\libmonodroid-unified.so"> + %(_BuildTargetAbis.Identity) + + + + + <_ResolvedNativeArchive Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.a' " /> + + + + + + diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs new file mode 100644 index 00000000000..35ff7a52d91 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs @@ -0,0 +1,56 @@ +using System; +using System.IO; +using System.Collections.Generic; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using Microsoft.Android.Build.Tasks; + +namespace Xamarin.Android.Tasks; + +public class GetNativeRuntimeComponents : AndroidTask +{ + public override string TaskPrefix => "GNRC"; + + public ITaskItem[] MonoComponents { get; set; } + + [Required] + public ITaskItem[] ResolvedNativeArchives { get; set; } + + [Output] + public ITaskItem[] NativeArchives { get; set; } + + public override bool RunTask () + { + var components = new NativeRuntimeComponents (MonoComponents); + var archives = new List (); + foreach (NativeRuntimeComponents.Archive archiveItem in components.KnownArchives) { + if (!archiveItem.Include) { + continue; + } + MakeItems (archiveItem, archives); + } + + NativeArchives = archives.ToArray (); + return !Log.HasLoggedErrors; + } + + void MakeItems (NativeRuntimeComponents.Archive archive, List archives) + { + foreach (ITaskItem resolvedArchive in ResolvedNativeArchives) { + string fileName = Path.GetFileName (resolvedArchive.ItemSpec); + if (String.Compare (fileName, archive.Name, StringComparison.OrdinalIgnoreCase) == 0) { + archives.Add (DoMakeItem (resolvedArchive)); + } + } + + ITaskItem DoMakeItem (ITaskItem resolved) + { + var ret = new TaskItem (resolved.ItemSpec); + string abi = MonoAndroidHelper.RidToAbi (resolved.GetRequiredMetadata ("_ResolvedNativeArchive", "RuntimeIdentifier", Log)); + ret.SetMetadata ("Abi", abi); + + return ret; + } + } +} diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs index 7ae34421acb..a0eea40568f 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs @@ -16,88 +16,68 @@ namespace Xamarin.Android.Tasks; public class LinkNativeRuntime : AndroidAsyncTask { - class Archive - { - public readonly string Name; - public readonly Func Include = (Archive) => true; - - public Archive (string name, Func? include = null) - { - Name = name; - if (include != null) { - Include = include; - } - } - } + public override string TaskPrefix => "LNR"; - class MonoComponentArchive : Archive - { - public readonly string ComponentName; + public ITaskItem[] MonoComponents { get; set; } - public MonoComponentArchive (string name, string componentName, Func include) - : base (name, include) - { - ComponentName = componentName; - } - } + [Required] + public string AndroidBinUtilsDirectory { get; set; } - readonly List KnownArchives; + [Required] + public ITaskItem[] NativeArchives { get; set; } - public override string TaskPrefix => "LNR"; + [Required] + public ITaskItem[] NativeObjectFiles { get; set; } - public ITaskItem[] MonoComponents { get; set; } + [Required] + public ITaskItem[] OutputRuntimes { get; set; } [Required] - public string AndroidBinUtilsDirectory { get; set; } + public ITaskItem[] SupportedAbis { get; set; } - public LinkNativeRuntime () + public override System.Threading.Tasks.Task RunTaskAsync () { - KnownArchives = new () { - new MonoComponentArchive ("libmono-component-diagnostics_tracing-static.a", "diagnostics_tracing", MonoComponentPresent), - new MonoComponentArchive ("libmono-component-diagnostics_tracing-stub-static.a", "diagnostics_tracing", MonoComponentAbsent), - new MonoComponentArchive ("libmono-component-marshal-ilgen-static.a", "marshal-ilgen", MonoComponentPresent), - new MonoComponentArchive ("libmono-component-marshal-ilgen-stub-static.a", "marshal-ilgen", MonoComponentAbsent), - - new Archive ("libmonosgen-2.0.a"), - new Archive ("libSystem.Globalization.Native.a"), - new Archive ("libSystem.IO.Compression.Native.a"), - new Archive ("libSystem.Native.a"), - new Archive ("libSystem.Security.Cryptography.Native.Android.a"), - }; + return this.WhenAll (SupportedAbis, LinkRuntime); } - public override System.Threading.Tasks.Task RunTaskAsync () + void LinkRuntime (ITaskItem abiItem) { - throw new NotImplementedException (); + string abi = abiItem.ItemSpec; + Log.LogDebugMessage ($"LinkRuntime ({abi})"); + var linker = new NativeLinker (Log, abi); + linker.Link ( + GetFirstAbiItem (OutputRuntimes, "_UnifiedNativeRuntime", abi), + GetAbiItems (NativeObjectFiles, "_NativeAssemblyTarget", abi), + GetAbiItems (NativeArchives, "_SelectedNativeArchive", abi) + ); } - bool MonoComponentExists (Archive archive) + List GetAbiItems (ITaskItem[] source, string itemName, string abi) { - if (MonoComponents == null || MonoComponents.Length == 0) { - return false; - } - - var mcArchive = archive as MonoComponentArchive; - if (mcArchive == null) { - throw new ArgumentException (nameof (archive), "Must be an instance of MonoComponentArchive"); - } + var ret = new List (); - foreach (ITaskItem item in MonoComponents) { - if (String.Compare (item.ItemSpec, mcArchive.ComponentName, StringComparison.OrdinalIgnoreCase) == 0) { - return true; + foreach (ITaskItem item in source) { + if (AbiMatches (abi, item, itemName)) { + ret.Add (item); } } - return false; + return ret; } - bool MonoComponentAbsent (Archive archive) + ITaskItem GetFirstAbiItem (ITaskItem[] source, string itemName, string abi) { - return !MonoComponentExists (archive); + foreach (ITaskItem item in source) { + if (AbiMatches (abi, item, itemName)) { + return item; + } + } + + throw new InvalidOperationException ($"Internal error: item '{itemName}' for ABI '{abi}' not found"); } - bool MonoComponentPresent (Archive archive) + bool AbiMatches (string abi, ITaskItem item, string itemName) { - return MonoComponentExists (archive); + return String.Compare (abi, item.GetRequiredMetadata (itemName, "Abi", Log), StringComparison.OrdinalIgnoreCase) == 0; } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/AssemblyStoreGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/AssemblyStoreGenerator.cs index 896c17e43c3..8305a5e5c2b 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/AssemblyStoreGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/AssemblyStoreGenerator.cs @@ -100,8 +100,11 @@ string Generate (string baseOutputDirectory, AndroidTargetArch arch, List (); var descriptors = new List (); ulong namesSize = 0; diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs new file mode 100644 index 00000000000..57136301118 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using Microsoft.Android.Build.Tasks; + +namespace Xamarin.Android.Tasks; + +class NativeLinker +{ + readonly TaskLoggingHelper log; + readonly string abi; + + public NativeLinker (TaskLoggingHelper log, string abi) + { + this.log = log; + this.abi = abi; + } + + public void Link (ITaskItem outputLibraryPath, List objectFiles, List archives) + { + log.LogDebugMessage ($"Linking: {outputLibraryPath}"); + EnsureCorrectAbi (outputLibraryPath); + EnsureCorrectAbi (objectFiles); + EnsureCorrectAbi (archives); + } + + void EnsureCorrectAbi (ITaskItem item) + { + // The exception is just a precaution, since the items passed to us should have already been checked + string itemAbi = item.GetMetadata ("Abi") ?? throw new InvalidOperationException ($"Internal error: 'Abi' metadata not found in item '{item}'"); + if (String.Compare (abi, itemAbi, StringComparison.OrdinalIgnoreCase) == 0) { + return; + } + + throw new InvalidOperationException ($"Internal error: '{item}' ABI ('{itemAbi}') doesn't have the expected value '{abi}'"); + } + + void EnsureCorrectAbi (List items) + { + foreach (ITaskItem item in items) { + EnsureCorrectAbi (item); + } + } +} diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs new file mode 100644 index 00000000000..2ef4b0e2af1 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; + +using Microsoft.Build.Framework; + +namespace Xamarin.Android.Tasks; + +class NativeRuntimeComponents +{ + internal class Archive + { + public readonly string Name; + public bool Include => shouldInclude (this); + + Func shouldInclude; + + public Archive (string name, Func? include = null) + { + Name = name; + shouldInclude = include == null ? ((Archive arch) => true) : include; + } + } + + internal class MonoComponentArchive : Archive + { + public readonly string ComponentName; + + public MonoComponentArchive (string name, string componentName, Func include) + : base (name, include) + { + ComponentName = componentName; + } + } + + readonly ITaskItem[] monoComponents; + + public readonly List KnownArchives; + + public NativeRuntimeComponents (ITaskItem[] monoComponents) + { + this.monoComponents = monoComponents; + KnownArchives = new () { + new MonoComponentArchive ("libmono-component-diagnostics_tracing-static.a", "diagnostics_tracing", MonoComponentPresent), + new MonoComponentArchive ("libmono-component-diagnostics_tracing-stub-static.a", "diagnostics_tracing", MonoComponentAbsent), + new MonoComponentArchive ("libmono-component-marshal-ilgen-static.a", "marshal-ilgen", MonoComponentPresent), + new MonoComponentArchive ("libmono-component-marshal-ilgen-stub-static.a", "marshal-ilgen", MonoComponentAbsent), + + new Archive ("libmonosgen-2.0.a"), + new Archive ("libSystem.Globalization.Native.a"), + new Archive ("libSystem.IO.Compression.Native.a"), + new Archive ("libSystem.Native.a"), + new Archive ("libSystem.Security.Cryptography.Native.Android.a"), + }; + } + + bool MonoComponentExists (Archive archive) + { + if (monoComponents.Length == 0) { + return false; + } + + var mcArchive = archive as MonoComponentArchive; + if (mcArchive == null) { + throw new ArgumentException (nameof (archive), "Must be an instance of MonoComponentArchive"); + } + + foreach (ITaskItem item in monoComponents) { + if (String.Compare (item.ItemSpec, mcArchive.ComponentName, StringComparison.OrdinalIgnoreCase) == 0) { + return true; + } + } + + return false; + } + + bool MonoComponentAbsent (Archive archive) + { + return !MonoComponentExists (archive); + } + + bool MonoComponentPresent (Archive archive) + { + return MonoComponentExists (archive); + } +} diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index e4deccf9ab0..e25bde998e0 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -2019,7 +2019,8 @@ because xbuild doesn't support framework reference assemblies. + Outputs="@(_ApplicationSharedLibrary)" + Condition=" '$(_AndroidEnableNativeRuntimeLinking)' != 'true' "> Date: Fri, 7 Jun 2024 22:19:38 +0200 Subject: [PATCH 03/53] More linker command line work * made `src/native/` components create archives in the regular output dir, so that they can be packaged. * linker response file support * added a stub for libz (Mono runtime and BCL libraries need it) --- .../Microsoft.Android.Runtime.proj | 5 + .../installers/create-installers.targets | 4 + ...icrosoft.Android.Sdk.NativeRuntime.targets | 3 + .../Tasks/GetNativeRuntimeComponents.cs | 26 ++++- .../Tasks/LinkApplicationSharedLibraries.cs | 11 +-- .../Tasks/LinkNativeRuntime.cs | 24 +++-- .../Utilities/NativeLinker.cs | 98 ++++++++++++++++++- .../Utilities/NativeRuntimeComponents.cs | 20 ++++ src/native/monodroid/CMakeLists.txt | 3 +- 9 files changed, 170 insertions(+), 24 deletions(-) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index 6ccb3fa4847..0a3fb7e3fc8 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -43,6 +43,11 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-debug-app-helper.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-native-tracing.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libunwind_xamarin.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libruntime-base.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-java-interop.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-lz4.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-shared-bits.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release-static.a" /> diff --git a/build-tools/installers/create-installers.targets b/build-tools/installers/create-installers.targets index 0a63d3bfcf0..258fb41beb0 100644 --- a/build-tools/installers/create-installers.targets +++ b/build-tools/installers/create-installers.targets @@ -181,16 +181,20 @@ <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)ManifestOverlays\Timing.xml" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libc.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libm.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libz.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libc.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libm.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libz.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libc.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libm.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libz.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libc.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libm.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)dsostubs\android-arm64\libarchive-dso-stub.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)dsostubs\android-arm\libarchive-dso-stub.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)dsostubs\android-x64\libarchive-dso-stub.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)dsostubs\android-x86\libarchive-dso-stub.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libz.so" /> <_MSBuildTargetsSrcFiles Include="$(MSBuildTargetsSrcDir)\Xamarin.Android.AvailableItems.targets" /> diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets index 0a0e1a54d19..c170509761a 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets @@ -25,6 +25,7 @@ Contains code to build and link the native runtime at application build time. MonoComponents="@(_MonoComponent)" ResolvedNativeArchives="@(_ResolvedNativeArchive)"> + @@ -36,8 +37,10 @@ Contains code to build and link the native runtime at application build time. diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs index 35ff7a52d91..8b2cdbb2b09 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs @@ -20,22 +20,41 @@ public class GetNativeRuntimeComponents : AndroidTask [Output] public ITaskItem[] NativeArchives { get; set; } + [Output] + public ITaskItem[] RequiredLibraries { get; set; } + public override bool RunTask () { var components = new NativeRuntimeComponents (MonoComponents); + var uniqueAbis = new HashSet (StringComparer.OrdinalIgnoreCase); var archives = new List (); foreach (NativeRuntimeComponents.Archive archiveItem in components.KnownArchives) { if (!archiveItem.Include) { continue; } - MakeItems (archiveItem, archives); + MakeItems (archiveItem, archives, uniqueAbis); } - NativeArchives = archives.ToArray (); + + var libraries = new List (); + foreach (string lib in components.NativeLibraries) { + MakeLibraryItems (lib, libraries, uniqueAbis); + } + RequiredLibraries = libraries.ToArray (); + return !Log.HasLoggedErrors; } - void MakeItems (NativeRuntimeComponents.Archive archive, List archives) + void MakeLibraryItems (string libName, List libraries, HashSet uniqueAbis) + { + foreach (string abi in uniqueAbis) { + var item = new TaskItem (libName); + item.SetMetadata ("Abi", abi); + libraries.Add (item); + } + } + + void MakeItems (NativeRuntimeComponents.Archive archive, List archives, HashSet uniqueAbis) { foreach (ITaskItem resolvedArchive in ResolvedNativeArchives) { string fileName = Path.GetFileName (resolvedArchive.ItemSpec); @@ -48,6 +67,7 @@ ITaskItem DoMakeItem (ITaskItem resolved) { var ret = new TaskItem (resolved.ItemSpec); string abi = MonoAndroidHelper.RidToAbi (resolved.GetRequiredMetadata ("_ResolvedNativeArchive", "RuntimeIdentifier", Log)); + uniqueAbis.Add (abi); ret.SetMetadata ("Abi", abi); return ret; diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkApplicationSharedLibraries.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkApplicationSharedLibraries.cs index 6fb2dac8967..4f0735996ea 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/LinkApplicationSharedLibraries.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkApplicationSharedLibraries.cs @@ -179,11 +179,11 @@ IEnumerable GetLinkerConfigs () targetLinkerArgs.Add (elf_arch); foreach (string file in inputs.ObjectFiles) { - targetLinkerArgs.Add (QuoteFileName (file)); + targetLinkerArgs.Add (MonoAndroidHelper.QuoteFileNameArgument (file)); } targetLinkerArgs.Add ("-o"); - targetLinkerArgs.Add (QuoteFileName (inputs.OutputSharedLibrary)); + targetLinkerArgs.Add (MonoAndroidHelper.QuoteFileNameArgument (inputs.OutputSharedLibrary)); if (inputs.ExtraLibraries != null) { foreach (string lib in inputs.ExtraLibraries) { @@ -247,12 +247,5 @@ void OnErrorData (string linkerName, object sender, DataReceivedEventArgs e) if (e.Data != null) LogMessage ($"[{linkerName} stderr] {e.Data}"); } - - static string QuoteFileName (string fileName) - { - var builder = new CommandLineBuilder (); - builder.AppendFileNameIfNotNull (fileName); - return builder.ToString (); - } } } diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs index a0eea40568f..1a26269dd3e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs @@ -1,15 +1,10 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; -using System.Text; -using System.Threading; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; -using Xamarin.Android.Tools; -using Xamarin.Build; using Microsoft.Android.Build.Tasks; namespace Xamarin.Android.Tasks; @@ -23,6 +18,12 @@ public class LinkNativeRuntime : AndroidAsyncTask [Required] public string AndroidBinUtilsDirectory { get; set; } + [Required] + public string IntermediateOutputPath { get; set; } + + [Required] + public ITaskItem[] LinkLibraries { get; set; } + [Required] public ITaskItem[] NativeArchives { get; set; } @@ -44,11 +45,18 @@ void LinkRuntime (ITaskItem abiItem) { string abi = abiItem.ItemSpec; Log.LogDebugMessage ($"LinkRuntime ({abi})"); - var linker = new NativeLinker (Log, abi); + ITaskItem outputRuntime = GetFirstAbiItem (OutputRuntimes, "_UnifiedNativeRuntime", abi); + string soname = Path.GetFileNameWithoutExtension (outputRuntime.ItemSpec); + if (soname.StartsWith ("lib", StringComparison.OrdinalIgnoreCase)) { + soname = soname.Substring (3); + } + + var linker = new NativeLinker (Log, abi, soname, AndroidBinUtilsDirectory, IntermediateOutputPath); linker.Link ( - GetFirstAbiItem (OutputRuntimes, "_UnifiedNativeRuntime", abi), + outputRuntime, GetAbiItems (NativeObjectFiles, "_NativeAssemblyTarget", abi), - GetAbiItems (NativeArchives, "_SelectedNativeArchive", abi) + GetAbiItems (NativeArchives, "_SelectedNativeArchive", abi), + GetAbiItems (LinkLibraries, "_RequiredLinkLibraries", abi) ); } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index 57136301118..71a5c0d00e9 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -1,5 +1,7 @@ using System; +using System.IO; using System.Collections.Generic; +using System.Text; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -9,21 +11,113 @@ namespace Xamarin.Android.Tasks; class NativeLinker { + static readonly List standardArgs = new () { + "--shared", + "--as-needed", + "--allow-shlib-undefined", + "--compress-debug-sections", + // TODO: test the commented-out flags + // "--gc-sections", + // "--icf=safe", + // "--lto=full|thin", + "--export-dynamic", + "-z relro", + "-z noexecstack", + "--enable-new-dtags", + "--build-id", + "--warn-shared-textrel", + "--fatal-warnings" + }; + + readonly List extraArgs = new (); readonly TaskLoggingHelper log; readonly string abi; + readonly string ld; + readonly string intermediateDir; + + public bool StripDebugSymbols { get; set; } + public bool SaveDebugSymbols { get; set; } - public NativeLinker (TaskLoggingHelper log, string abi) + public NativeLinker (TaskLoggingHelper log, string abi, string soname, string binutilsDir, string intermediateDir) { this.log = log; this.abi = abi; + this.intermediateDir = intermediateDir; + + ld = Path.Combine (binutilsDir, MonoAndroidHelper.GetExecutablePath (binutilsDir, "ld")); + + extraArgs.Add ($"-soname {soname}"); + + string? elfArch = null; + switch (abi) { + case "armeabi-v7a": + extraArgs.Add ("-X"); + elfArch = "armelf_linux_eabi"; + break; + + case "arm64": + case "arm64-v8a": + case "aarch64": + extraArgs.Add ("--fix-cortex-a53-843419"); + elfArch = "aarch64linux"; + break; + + case "x86": + elfArch = "elf_i386"; + break; + + case "x86_64": + elfArch = "elf_x86_64"; + break; + + default: + throw new NotSupportedException ($"Unsupported Android target architecture ABI: {abi}"); + } + + if (!String.IsNullOrEmpty (elfArch)) { + extraArgs.Add ($"-m {elfArch}"); + } } - public void Link (ITaskItem outputLibraryPath, List objectFiles, List archives) + public void Link (ITaskItem outputLibraryPath, List objectFiles, List archives, List libraries) { log.LogDebugMessage ($"Linking: {outputLibraryPath}"); EnsureCorrectAbi (outputLibraryPath); EnsureCorrectAbi (objectFiles); EnsureCorrectAbi (archives); + EnsureCorrectAbi (libraries); + + string respFilePath = Path.Combine (intermediateDir, $"ld.{abi}.rsp"); + using (var sw = new StreamWriter (File.Open (respFilePath, FileMode.Create, FileAccess.Write, FileShare.Read), new UTF8Encoding (false))) { + foreach (string arg in standardArgs) { + sw.WriteLine (arg); + } + + foreach (string arg in extraArgs) { + sw.WriteLine (arg); + } + + if (StripDebugSymbols && !SaveDebugSymbols) { + sw.WriteLine ("-s"); + } + + sw.Write ("-o "); + sw.WriteLine (MonoAndroidHelper.QuoteFileNameArgument (outputLibraryPath.ItemSpec)); + + WriteFilesToResponseFile (sw, objectFiles); + WriteFilesToResponseFile (sw, archives); + + sw.Flush (); + } + + log.LogDebugMessage ($" Command line: {ld} @{respFilePath}"); + + void WriteFilesToResponseFile (StreamWriter sw, List files) + { + foreach (ITaskItem file in files) { + sw.WriteLine (MonoAndroidHelper.QuoteFileNameArgument (file.ItemSpec)); + } + } } void EnsureCorrectAbi (ITaskItem item) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index 2ef4b0e2af1..3eb6436ac7a 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -35,21 +35,41 @@ public MonoComponentArchive (string name, string componentName, Func KnownArchives; + public readonly List NativeLibraries; public NativeRuntimeComponents (ITaskItem[] monoComponents) { this.monoComponents = monoComponents; KnownArchives = new () { + // Mono components new MonoComponentArchive ("libmono-component-diagnostics_tracing-static.a", "diagnostics_tracing", MonoComponentPresent), new MonoComponentArchive ("libmono-component-diagnostics_tracing-stub-static.a", "diagnostics_tracing", MonoComponentAbsent), new MonoComponentArchive ("libmono-component-marshal-ilgen-static.a", "marshal-ilgen", MonoComponentPresent), new MonoComponentArchive ("libmono-component-marshal-ilgen-stub-static.a", "marshal-ilgen", MonoComponentAbsent), + // MonoVM runtime + BCL new Archive ("libmonosgen-2.0.a"), new Archive ("libSystem.Globalization.Native.a"), new Archive ("libSystem.IO.Compression.Native.a"), new Archive ("libSystem.Native.a"), new Archive ("libSystem.Security.Cryptography.Native.Android.a"), + + // .NET for Android + new Archive ("libruntime-base.a"), + new Archive ("libxa-java-interop.a"), + new Archive ("libxa-lz4.a"), + new Archive ("libxa-shared-bits.a"), + new Archive ("libmono-android.release-static.a"), + }; + + // Just the base names of libraries to link into the unified runtime. Must have all the dependencies of all the static archives we + // link into the final library. + NativeLibraries = new () { + "c", + "dl", + "m", + "z", + "log", }; } diff --git a/src/native/monodroid/CMakeLists.txt b/src/native/monodroid/CMakeLists.txt index 8a5ebc0ec12..879999ce297 100644 --- a/src/native/monodroid/CMakeLists.txt +++ b/src/native/monodroid/CMakeLists.txt @@ -66,7 +66,7 @@ if(DEBUG_BUILD) set(CMAKE_C_FLAGS_DEBUG ${XA_COMPILER_FLAGS_DEBUG}) set(CMAKE_CXX_FLAGS_DEBUG ${XA_COMPILER_FLAGS_DEBUG}) elseif(NOT ANALYZERS_ENABLED) - set(BUILD_STATIC_LIBRARY OFF) # Turn off for now, until we implement dynamic runtime linking at app build time + set(BUILD_STATIC_LIBRARY ON) endif() # Library directories @@ -233,7 +233,6 @@ macro(lib_target_options TARGET_NAME) ${SHARED_LIB_NAME} xa::runtime-base xa::java-interop - xa::pinvoke-override-precompiled xa::lz4 -lmonosgen-2.0 -llog From 34a1a8e39bb4ae65b7b0cd406bd6aac4086f3675 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 10 Jun 2024 14:18:12 +0200 Subject: [PATCH 04/53] Actually linking now --- NativeLinkingTODO.md | 26 +++ .../Tasks/GetNativeRuntimeComponents.cs | 5 +- .../Tasks/LinkNativeRuntime.cs | 2 +- .../Utilities/KnownMetadata.cs | 7 + .../Utilities/NativeLinker.cs | 152 ++++++++++++++++-- .../Utilities/NativeRuntimeComponents.cs | 38 +++-- 6 files changed, 206 insertions(+), 24 deletions(-) create mode 100644 NativeLinkingTODO.md create mode 100644 src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs diff --git a/NativeLinkingTODO.md b/NativeLinkingTODO.md new file mode 100644 index 00000000000..f2f58b895db --- /dev/null +++ b/NativeLinkingTODO.md @@ -0,0 +1,26 @@ +# Problems to solve + + * `libSystem.Security.Cryptography.Native.Android.a` contains the `JNI_OnLoad` function + which initializes the whole crypto support library, but we can't use it as it would + conflict with our own. Potential solution is to modify the above library's source code + to add an init function that we will call from our own `JNI_OnLoad` and make the library's + init function do the same. The `JNI_OnLoad` object file would have to be omitted from the + library's `.a` + * `p/invoke usage`. + Currently, all the BCL archives (with exception of the above crypto one) are + linked into the unified runtime using `--whole-archive` - that is, they become part of the + runtime in their entirety. This is wasteful, but necessary, so that `p/invokes` into those + libraries work correctly. Instead, we should scan the application DLLs for p/invokes from + those libraries and generate code to reference the required functions, so that the linker + can do its job and remove code not used by the application. Likely needed is a linker step. + * `p/invoke` handling mechanism. Right now, we `dlopen` the relevant `.so` library and look + up the required symbol in there. With the unified runtime the `.so` disappears, so we either + need to look it up in our own library or, better, call the function directly. The latter is + a bit more complicated to implement but would give us much faster code, thus it's the preferred + solution. + +# Ideas + + * Use [mold](https://github.com/rui314/mold) which has recently been re-licensed under `MIT/X11` + (and contains components licensed under a mixture of `BSD*` and `Apache 2.0` licenses), so we + can easily redistribute it instead of the LLVM's `lld`. The advantage is `mold`'s [speed](https://github.com/rui314/mold?tab=readme-ov-file#mold-a-modern-linker) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs index 8b2cdbb2b09..f15fd015255 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs @@ -49,7 +49,7 @@ void MakeLibraryItems (string libName, List libraries, HashSet standardArgs = new () { "--shared", - "--as-needed", "--allow-shlib-undefined", - "--compress-debug-sections", + // TODO: need to enable zstd in binutils build + // "--compress-debug-sections=zstd", // TODO: test the commented-out flags // "--gc-sections", // "--icf=safe", @@ -34,15 +36,20 @@ class NativeLinker readonly string abi; readonly string ld; readonly string intermediateDir; + readonly CancellationToken? cancellationToken; + readonly Action? cancelTask; public bool StripDebugSymbols { get; set; } public bool SaveDebugSymbols { get; set; } - public NativeLinker (TaskLoggingHelper log, string abi, string soname, string binutilsDir, string intermediateDir) + public NativeLinker (TaskLoggingHelper log, string abi, string soname, string binutilsDir, string intermediateDir, + CancellationToken? cancellationToken = null, Action? cancelTask = null) { this.log = log; this.abi = abi; this.intermediateDir = intermediateDir; + this.cancellationToken = cancellationToken; + this.cancelTask = cancelTask; ld = Path.Combine (binutilsDir, MonoAndroidHelper.GetExecutablePath (binutilsDir, "ld")); @@ -77,9 +84,18 @@ public NativeLinker (TaskLoggingHelper log, string abi, string soname, string bi if (!String.IsNullOrEmpty (elfArch)) { extraArgs.Add ($"-m {elfArch}"); } + + string runtimeNativeLibsDir = MonoAndroidHelper.GetNativeLibsRootDirectoryPath (binutilsDir); + string runtimeNativeLibStubsDir = MonoAndroidHelper.GetLibstubsRootDirectoryPath (binutilsDir); + string RID = MonoAndroidHelper.AbiToRid (abi); + string libStubsPath = Path.Combine (runtimeNativeLibStubsDir, RID); + string runtimeLibsDir = Path.Combine (runtimeNativeLibsDir, RID); + + extraArgs.Add ($"-L {MonoAndroidHelper.QuoteFileNameArgument (libStubsPath)}"); + extraArgs.Add ($"-L {MonoAndroidHelper.QuoteFileNameArgument (runtimeLibsDir)}"); } - public void Link (ITaskItem outputLibraryPath, List objectFiles, List archives, List libraries) + public bool Link (ITaskItem outputLibraryPath, List objectFiles, List archives, List libraries) { log.LogDebugMessage ($"Linking: {outputLibraryPath}"); EnsureCorrectAbi (outputLibraryPath); @@ -87,7 +103,10 @@ public void Link (ITaskItem outputLibraryPath, List objectFiles, List EnsureCorrectAbi (archives); EnsureCorrectAbi (libraries); - string respFilePath = Path.Combine (intermediateDir, $"ld.{abi}.rsp"); + Directory.CreateDirectory (Path.GetDirectoryName (outputLibraryPath.ItemSpec)); + + string libBaseName = Path.GetFileNameWithoutExtension (outputLibraryPath.ItemSpec); + string respFilePath = Path.Combine (intermediateDir, $"ld.{libBaseName}.{abi}.rsp"); using (var sw = new StreamWriter (File.Open (respFilePath, FileMode.Create, FileAccess.Write, FileShare.Read), new UTF8Encoding (false))) { foreach (string arg in standardArgs) { sw.WriteLine (arg); @@ -101,29 +120,62 @@ public void Link (ITaskItem outputLibraryPath, List objectFiles, List sw.WriteLine ("-s"); } - sw.Write ("-o "); - sw.WriteLine (MonoAndroidHelper.QuoteFileNameArgument (outputLibraryPath.ItemSpec)); - WriteFilesToResponseFile (sw, objectFiles); WriteFilesToResponseFile (sw, archives); + foreach (ITaskItem libItem in libraries) { + sw.WriteLine ($"-l{libItem.ItemSpec}"); + } + sw.Flush (); } - log.LogDebugMessage ($" Command line: {ld} @{respFilePath}"); + var ldArgs = new List { + $"@{respFilePath}", + "-o", + MonoAndroidHelper.QuoteFileNameArgument (outputLibraryPath.ItemSpec) + }; + + var watch = new Stopwatch (); + watch.Start (); + bool ret = RunLinker (ldArgs, outputLibraryPath); + watch.Stop (); + log.LogDebugMessage ($"[{Path.GetFileName (outputLibraryPath.ItemSpec)} link time] {watch.Elapsed}"); + + return ret; void WriteFilesToResponseFile (StreamWriter sw, List files) { foreach (ITaskItem file in files) { - sw.WriteLine (MonoAndroidHelper.QuoteFileNameArgument (file.ItemSpec)); + bool wholeArchive = IncludeWholeArchive (file); + + if (wholeArchive) { + sw.Write ("--whole-archive "); + } + sw.Write (MonoAndroidHelper.QuoteFileNameArgument (file.ItemSpec)); + if (wholeArchive) { + sw.Write (" --no-whole-archive"); + } + sw.WriteLine (); + } + } + + bool IncludeWholeArchive (ITaskItem item) + { + string? wholeArchive = item.GetMetadata (KnownMetadata.LinkWholeArchive); + if (String.IsNullOrEmpty (wholeArchive)) { + return false; } + + // Purposefully not calling TryParse, let it throw and let us know if the value isn't a boolean. + return Boolean.Parse (wholeArchive); } } void EnsureCorrectAbi (ITaskItem item) { // The exception is just a precaution, since the items passed to us should have already been checked - string itemAbi = item.GetMetadata ("Abi") ?? throw new InvalidOperationException ($"Internal error: 'Abi' metadata not found in item '{item}'"); + string itemAbi = item.GetMetadata (KnownMetadata.Abi) ?? throw new InvalidOperationException ($"Internal error: 'Abi' metadata not found in item '{item}'"); if (String.Compare (abi, itemAbi, StringComparison.OrdinalIgnoreCase) == 0) { return; } @@ -137,4 +189,82 @@ void EnsureCorrectAbi (List items) EnsureCorrectAbi (item); } } + + bool RunLinker (List args, ITaskItem outputSharedLibrary) + { + using var stdout_completed = new ManualResetEvent (false); + using var stderr_completed = new ManualResetEvent (false); + var psi = new ProcessStartInfo () { + FileName = ld, + Arguments = String.Join (" ", args), + UseShellExecute = false, + RedirectStandardOutput = true, + RedirectStandardError = true, + CreateNoWindow = true, + WindowStyle = ProcessWindowStyle.Hidden, + }; + + string linkerName = Path.GetFileName (ld); + log.LogDebugMessage ($"[Native Linker] {psi.FileName} {psi.Arguments}"); + + var stdoutLines = new List (); + var stderrLines = new List (); + + using var proc = new Process (); + proc.OutputDataReceived += (s, e) => { + if (e.Data != null) { + OnOutputData (linkerName, s, e); + stdoutLines.Add (e.Data); + } else { + stdout_completed.Set (); + } + }; + + proc.ErrorDataReceived += (s, e) => { + if (e.Data != null) { + OnErrorData (linkerName, s, e); + stderrLines.Add (e.Data); + } else { + stderr_completed.Set (); + } + }; + + proc.StartInfo = psi; + proc.Start (); + proc.BeginOutputReadLine (); + proc.BeginErrorReadLine (); + cancellationToken?.Register (() => { try { proc.Kill (); } catch (Exception) { } }); + proc.WaitForExit (); + + if (psi.RedirectStandardError) { + stderr_completed.WaitOne (TimeSpan.FromSeconds (30)); + } + + if (psi.RedirectStandardOutput) { + stdout_completed.WaitOne (TimeSpan.FromSeconds (30)); + } + + if (proc.ExitCode != 0) { + var sb = MonoAndroidHelper.MergeStdoutAndStderrMessages (stdoutLines, stderrLines); + log.LogCodedError ("XA3007", Properties.Resources.XA3007, Path.GetFileName (outputSharedLibrary.ItemSpec), sb.ToString ()); + cancelTask?.Invoke (); + return false; + } + + return true; + } + + void OnOutputData (string linkerName, object sender, DataReceivedEventArgs e) + { + if (e.Data != null) { + log.LogMessage ($"[{linkerName} stdout] {e.Data}"); + } + } + + void OnErrorData (string linkerName, object sender, DataReceivedEventArgs e) + { + if (e.Data != null) { + log.LogMessage ($"[{linkerName} stderr] {e.Data}"); + } + } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index 3eb6436ac7a..2829bac13b1 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -11,13 +11,15 @@ internal class Archive { public readonly string Name; public bool Include => shouldInclude (this); + public readonly bool WholeArchive; Func shouldInclude; - public Archive (string name, Func? include = null) + public Archive (string name, Func? include = null, bool wholeArchive = false) { Name = name; shouldInclude = include == null ? ((Archive arch) => true) : include; + WholeArchive = wholeArchive; } } @@ -32,6 +34,20 @@ public MonoComponentArchive (string name, string componentName, Func KnownArchives; @@ -49,17 +65,19 @@ public NativeRuntimeComponents (ITaskItem[] monoComponents) // MonoVM runtime + BCL new Archive ("libmonosgen-2.0.a"), - new Archive ("libSystem.Globalization.Native.a"), - new Archive ("libSystem.IO.Compression.Native.a"), - new Archive ("libSystem.Native.a"), - new Archive ("libSystem.Security.Cryptography.Native.Android.a"), + new BclArchive ("libSystem.Globalization.Native.a"), + new BclArchive ("libSystem.IO.Compression.Native.a"), + new BclArchive ("libSystem.Native.a"), + + // Can't link whole archive for this one because it contains conflicting JNI_OnLoad + new BclArchive ("libSystem.Security.Cryptography.Native.Android.a", wholeArchive: false), // .NET for Android - new Archive ("libruntime-base.a"), - new Archive ("libxa-java-interop.a"), - new Archive ("libxa-lz4.a"), - new Archive ("libxa-shared-bits.a"), - new Archive ("libmono-android.release-static.a"), + new AndroidArchive ("libruntime-base.a"), + new AndroidArchive ("libxa-java-interop.a"), + new AndroidArchive ("libxa-lz4.a"), + new AndroidArchive ("libxa-shared-bits.a"), + new AndroidArchive ("libmono-android.release-static.a"), }; // Just the base names of libraries to link into the unified runtime. Must have all the dependencies of all the static archives we From 846be3fd3291bc20c6404cc2007e82c1da0ec538 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 12 Jun 2024 12:36:36 +0200 Subject: [PATCH 05/53] Bump binutils to 18.1.7-8.0.0 --- build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs index 103d07403fc..0790eb28afd 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs @@ -16,7 +16,6 @@ namespace Xamarin.Android.Prepare partial class Configurables { const string BinutilsVersion = "L_18.1.6-8.0.0-1"; - const string MicrosoftOpenJDK17Version = "17.0.12"; const string MicrosoftOpenJDK17Release = "17.0.12"; const string MicrosoftOpenJDK17RootDirName = "jdk-17.0.12+7"; From ff41900fd0fd394f7a6c296de2aecb0866e3d567 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Fri, 21 Jun 2024 18:33:14 +0200 Subject: [PATCH 06/53] Package more library stubs --- build-tools/installers/create-installers.targets | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build-tools/installers/create-installers.targets b/build-tools/installers/create-installers.targets index 258fb41beb0..52e40081d6b 100644 --- a/build-tools/installers/create-installers.targets +++ b/build-tools/installers/create-installers.targets @@ -180,15 +180,23 @@ <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)ELFSharp.dll" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)ManifestOverlays\Timing.xml" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libc.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libdl.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\liblog.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libm.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm64\libz.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libc.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libdl.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\liblog.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libm.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-arm\libz.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libc.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libdl.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\liblog.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libm.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x64\libz.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libc.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libdl.so" /> + <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\liblog.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libstubs\android-x86\libm.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)dsostubs\android-arm64\libarchive-dso-stub.so" /> <_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)dsostubs\android-arm\libarchive-dso-stub.so" /> From de23b8a0878d1c8f54b5da0e975c434b46e9c316 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 24 Jun 2024 14:47:56 +0200 Subject: [PATCH 07/53] Extract debug symbols at link time --- ...icrosoft.Android.Sdk.NativeRuntime.targets | 1 + .../Tasks/LinkNativeRuntime.cs | 6 +- .../Utilities/NativeLinker.cs | 91 +++++++++++++++++-- 3 files changed, 87 insertions(+), 11 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets index c170509761a..2960119947a 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets @@ -43,6 +43,7 @@ Contains code to build and link the native runtime at application build time. LinkLibraries="@(_RequiredLinkLibraries)" OutputRuntimes="@(_UnifiedNativeRuntime)" SupportedAbis="@(_BuildTargetAbis)" + SaveDebugSymbols="true" /> diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs index 5b678128eb2..6b2c7711966 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs @@ -36,6 +36,8 @@ public class LinkNativeRuntime : AndroidAsyncTask [Required] public ITaskItem[] SupportedAbis { get; set; } + public bool SaveDebugSymbols { get; set; } + public override System.Threading.Tasks.Task RunTaskAsync () { return this.WhenAll (SupportedAbis, LinkRuntime); @@ -51,7 +53,9 @@ void LinkRuntime (ITaskItem abiItem) soname = soname.Substring (3); } - var linker = new NativeLinker (Log, abi, soname, AndroidBinUtilsDirectory, IntermediateOutputPath, CancellationToken, Cancel); + var linker = new NativeLinker (Log, abi, soname, AndroidBinUtilsDirectory, IntermediateOutputPath, CancellationToken, Cancel) { + SaveDebugSymbols = SaveDebugSymbols, + }; linker.Link ( outputRuntime, GetAbiItems (NativeObjectFiles, "_NativeAssemblyTarget", abi), diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index 34fc1209594..6f1ee95d0e2 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -35,6 +35,7 @@ class NativeLinker readonly TaskLoggingHelper log; readonly string abi; readonly string ld; + readonly string objcopy; readonly string intermediateDir; readonly CancellationToken? cancellationToken; readonly Action? cancelTask; @@ -52,6 +53,7 @@ public NativeLinker (TaskLoggingHelper log, string abi, string soname, string bi this.cancelTask = cancelTask; ld = Path.Combine (binutilsDir, MonoAndroidHelper.GetExecutablePath (binutilsDir, "ld")); + objcopy = Path.Combine (binutilsDir, MonoAndroidHelper.GetExecutablePath (binutilsDir, "llvm-objcopy")); extraArgs.Add ($"-soname {soname}"); @@ -142,6 +144,11 @@ public bool Link (ITaskItem outputLibraryPath, List objectFiles, List watch.Stop (); log.LogDebugMessage ($"[{Path.GetFileName (outputLibraryPath.ItemSpec)} link time] {watch.Elapsed}"); + if (!ret || !SaveDebugSymbols) { + return ret; + } + + ret = ExtractDebugSymbols (outputLibraryPath); return ret; void WriteFilesToResponseFile (StreamWriter sw, List files) @@ -190,12 +197,81 @@ void EnsureCorrectAbi (List items) } } + bool ExtractDebugSymbols (ITaskItem outputSharedLibrary) + { + var stdoutLines = new List (); + var stderrLines = new List (); + + string sourceLib = outputSharedLibrary.ItemSpec; + string sourceLibQuoted = MonoAndroidHelper.QuoteFileNameArgument (sourceLib); + string destLib = Path.Combine (Path.GetDirectoryName (sourceLib), $"{Path.GetFileNameWithoutExtension (sourceLib)}.dbg.so"); + string destLibQuoted = MonoAndroidHelper.QuoteFileNameArgument (destLib); + + var args = new List { + "--only-keep-debug", + sourceLibQuoted, + destLibQuoted, + }; + + if (!RunCommand ("Extract Debug Info", objcopy, args, stdoutLines, stderrLines)) { + LogFailure (); + return false; + } + + stdoutLines.Clear (); + stderrLines.Clear (); + args.Clear (); + args.Add ("--strip-debug"); + args.Add ("--strip-unneeded"); + args.Add (sourceLibQuoted); + + if (!RunCommand ("Strip Debug Info", objcopy, args, stdoutLines, stderrLines)) { + LogFailure (); + return false; + } + + stdoutLines.Clear (); + stderrLines.Clear (); + args.Clear (); + args.Add ($"--add-gnu-debuglink={destLibQuoted}"); + args.Add (sourceLibQuoted); + + if (!RunCommand ("Add Debug Info Link", objcopy, args, stdoutLines, stderrLines)) { + LogFailure (); + return false; + } + + return true; + + void LogFailure () + { + var sb = MonoAndroidHelper.MergeStdoutAndStderrMessages (stdoutLines, stderrLines); + // TODO: consider making it a warning + // TODO: make it a coded message + log.LogError ("Failed to extract debug info", Path.GetFileName (sourceLib), sb.ToString ()); + } + } + bool RunLinker (List args, ITaskItem outputSharedLibrary) + { + var stdoutLines = new List (); + var stderrLines = new List (); + + if (!RunCommand ("Native Linker", ld, args, stdoutLines, stderrLines)) { + var sb = MonoAndroidHelper.MergeStdoutAndStderrMessages (stdoutLines, stderrLines); + log.LogCodedError ("XA3007", Properties.Resources.XA3007, Path.GetFileName (outputSharedLibrary.ItemSpec), sb.ToString ()); + return false; + } + + return true; + } + + bool RunCommand (string label, string binaryPath, List args, List stdoutLines, List stderrLines) { using var stdout_completed = new ManualResetEvent (false); using var stderr_completed = new ManualResetEvent (false); var psi = new ProcessStartInfo () { - FileName = ld, + FileName = binaryPath, Arguments = String.Join (" ", args), UseShellExecute = false, RedirectStandardOutput = true, @@ -204,16 +280,13 @@ bool RunLinker (List args, ITaskItem outputSharedLibrary) WindowStyle = ProcessWindowStyle.Hidden, }; - string linkerName = Path.GetFileName (ld); - log.LogDebugMessage ($"[Native Linker] {psi.FileName} {psi.Arguments}"); - - var stdoutLines = new List (); - var stderrLines = new List (); + string binaryName = Path.GetFileName (ld); + log.LogDebugMessage ($"[{label}] {psi.FileName} {psi.Arguments}"); using var proc = new Process (); proc.OutputDataReceived += (s, e) => { if (e.Data != null) { - OnOutputData (linkerName, s, e); + OnOutputData (binaryName, s, e); stdoutLines.Add (e.Data); } else { stdout_completed.Set (); @@ -222,7 +295,7 @@ bool RunLinker (List args, ITaskItem outputSharedLibrary) proc.ErrorDataReceived += (s, e) => { if (e.Data != null) { - OnErrorData (linkerName, s, e); + OnErrorData (binaryName, s, e); stderrLines.Add (e.Data); } else { stderr_completed.Set (); @@ -245,8 +318,6 @@ bool RunLinker (List args, ITaskItem outputSharedLibrary) } if (proc.ExitCode != 0) { - var sb = MonoAndroidHelper.MergeStdoutAndStderrMessages (stdoutLines, stderrLines); - log.LogCodedError ("XA3007", Properties.Resources.XA3007, Path.GetFileName (outputSharedLibrary.ItemSpec), sb.ToString ()); cancelTask?.Invoke (); return false; } From 9b02b876b232e80b4386b2991f44ea6fc16b0144 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 25 Jun 2024 22:43:08 +0200 Subject: [PATCH 08/53] First steps towards p/invoke usage scanner --- .../Tasks/GenerateJavaStubs.cs | 33 +++++++ .../Tasks/GeneratePackageManagerJava.cs | 8 ++ .../Utilities/PinvokeScanner.cs | 91 +++++++++++++++++++ ...PreservePinvokesNativeAssemblyGenerator.cs | 35 +++++++ .../Xamarin.Android.Common.targets | 2 + 5 files changed, 169 insertions(+) create mode 100644 src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs create mode 100644 src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs index 7c13c195b16..81a31f5b0c6 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs @@ -90,6 +90,8 @@ public class GenerateJavaStubs : AndroidTask public ITaskItem[] Environments { get; set; } + public bool EnableNativeRuntimeLinking { get; set; } + [Output] public ITaskItem[] GeneratedBinaryTypeMaps { get; set; } @@ -186,6 +188,7 @@ void Run (bool useMarshalMethods) // Now that "never" never happened, we can proceed knowing that at least the assembly sets are the same for each architecture var nativeCodeGenStates = new ConcurrentDictionary (); NativeCodeGenState? templateCodeGenState = null; + var scanner = new PinvokeScanner (Log); var firstArch = allAssembliesPerArch.First ().Key; var generateSucceeded = true; @@ -205,6 +208,11 @@ void Run (bool useMarshalMethods) generateSucceeded = false; } + (success, List pinfos) = ScanForUsedPinvokes (scanner, arch, state.Resolver); + if (!success) { + return; + } + // If this is the first architecture, we need to store the state for later use if (generateJavaCode) { templateCodeGenState = state; @@ -373,6 +381,31 @@ IList MergeManifest (NativeCodeGenState codeGenState, Dictionary pinfos) ScanForUsedPinvokes (PinvokeScanner scanner, AndroidTargetArch arch, XAAssemblyResolver resolver) + { + if (!EnableNativeRuntimeLinking) { + return; + } + + var frameworkAssemblies = new List (); + + foreach (ITaskItem asm in ResolvedAssemblies) { + string? metadata = asm.GetMetadata ("FrameworkAssembly"); + if (String.IsNullOrEmpty (metadata)) { + continue; + } + + if (!Boolean.TryParse (metadata, out bool isFrameworkAssembly) || !isFrameworkAssembly) { + continue; + } + + frameworkAssemblies.Add (asm); + } + + var pinfos = scanner.Scan (arch, resolver, frameworkAssemblies); + return (true, pinfos); + } + (bool success, NativeCodeGenState? stubsState) GenerateJavaSourcesAndMaybeClassifyMarshalMethods (AndroidTargetArch arch, Dictionary assemblies, Dictionary userAssemblies, bool useMarshalMethods, bool generateJavaCode) { XAAssemblyResolver resolver = MakeResolver (useMarshalMethods, arch, assemblies); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs index c0f7f0432ce..15f512e521a 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs @@ -76,6 +76,7 @@ public class GeneratePackageManagerJava : AndroidTask public string AndroidSequencePointsMode { get; set; } public bool EnableSGenConcurrent { get; set; } public string? CustomBundleConfigFile { get; set; } + public bool EnableNativeRuntimeLinking { get; set; } bool _Debug { get { @@ -383,6 +384,13 @@ void AddEnvironment () ); } + if (EnableNativeRuntimeLinking) { + // var pinfoGen = new PreservePinvokesNativeAssemblyGenerator ( + // Log, + // targetArch, + + } + LLVMIR.LlvmIrModule marshalMethodsModule = marshalMethodsAsmGen.Construct (); using var marshalMethodsWriter = MemoryStreamPool.Shared.CreateStreamWriter (); try { diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs new file mode 100644 index 00000000000..ae510e5c38e --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.IO; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using Microsoft.Android.Build.Tasks; + +using Mono.Cecil; + +using Xamarin.Android.Tools; + +namespace Xamarin.Android.Tasks; + +class PinvokeScanner +{ + public sealed class PinvokeEntryInfo + { + public readonly string LibraryName; + public readonly string EntryName; + + public PinvokeEntryInfo (MethodDefinition method) + { + LibraryName = method.PInvokeInfo.Module.Name; + EntryName = method.PInvokeInfo.EntryPoint; + } + } + + readonly TaskLoggingHelper log; + + public PinvokeScanner (TaskLoggingHelper log) + { + this.log = log; + } + + public List Scan (AndroidTargetArch targetArch, XAAssemblyResolver resolver, ICollection frameworkAssemblies) + { + var pinvokes = new List (); + var pinvokeCache = new HashSet (StringComparer.Ordinal); + + foreach (ITaskItem fasm in frameworkAssemblies) { + string asmName = Path.GetFileNameWithoutExtension (fasm.ItemSpec); + AssemblyDefinition? asmdef = resolver.Resolve (asmName); + if (asmdef == null) { + log.LogWarning ($"Failed to resolve assembly '{fasm.ItemSpec}' for target architecture {targetArch}"); + continue; + } + Scan (asmdef, pinvokeCache, pinvokes); + } + + return pinvokes; + } + + void Scan (AssemblyDefinition assembly, HashSet pinvokeCache, List pinvokes) + { + log.LogDebugMessage ($"Scanning assembly {assembly}"); + foreach (ModuleDefinition module in assembly.Modules) { + if (!module.HasTypes) { + continue; + } + + foreach (TypeDefinition type in module.Types) { + Scan (type, pinvokeCache, pinvokes); + } + } + } + + void Scan (TypeDefinition type, HashSet pinvokeCache, List pinvokes) + { + if (!type.HasMethods) { + return; + } + + log.LogDebugMessage ($"Scanning type '{type}'"); + foreach (MethodDefinition method in type.Methods) { + if (!method.HasPInvokeInfo) { + continue; + } + + var pinfo = new PinvokeEntryInfo (method); + string key = $"{pinfo.LibraryName}/{pinfo.EntryName}"; + if (pinvokeCache.Contains (key)) { + continue; + } + + log.LogDebugMessage ($" p/invoke method: {pinfo.LibraryName}/{pinfo.EntryName}"); + pinvokeCache.Add (key); + pinvokes.Add (pinfo); + } + } +} diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs new file mode 100644 index 00000000000..dfaa5af0116 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +using Microsoft.Android.Build.Tasks; +using Microsoft.Build.Utilities; + +using Xamarin.Android.Tasks.LLVMIR; +using Xamarin.Android.Tools; + +using CecilMethodDefinition = global::Mono.Cecil.MethodDefinition; +using CecilParameterDefinition = global::Mono.Cecil.ParameterDefinition; + +namespace Xamarin.Android.Tasks; + +class PreservePinvokesNativeAssemblyGenerator : LlvmIrComposer +{ + readonly TaskLoggingHelper log; + readonly AndroidTargetArch targetArch; + readonly ICollection pinfos; + + public PreservePinvokesNativeAssemblyGenerator (TaskLoggingHelper log, AndroidTargetArch targetArch, ICollection pinfos) + : base (log) + { + this.log = log; + this.targetArch = targetArch; + this.pinfos = pinfos; + } + + protected override void Construct (LlvmIrModule module) + { + } +} diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index e25bde998e0..b4e236f58f2 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1520,6 +1520,7 @@ because xbuild doesn't support framework reference assemblies. HaveMultipleRIDs="$(_HaveMultipleRIDs)" IntermediateOutputDirectory="$(IntermediateOutputPath)" Environments="@(_EnvironmentFiles)"> + EnableNativeRuntimeLinking="$(_AndroidEnableNativeRuntimeLinking)"> @@ -1746,6 +1747,7 @@ because xbuild doesn't support framework reference assemblies. UseAssemblyStore="$(AndroidUseAssemblyStore)" EnableMarshalMethods="$(_AndroidUseMarshalMethods)" CustomBundleConfigFile="$(AndroidBundleConfigurationFile)" + EnableNativeRuntimeLinking="$(_AndroidEnableNativeRuntimeLinking)" > From bec91898b7d987c505225c5a49130834ca4c94f1 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 25 Jun 2024 22:56:36 +0200 Subject: [PATCH 09/53] Fixlet + register scan results --- .../Tasks/GenerateJavaStubs.cs | 13 ++++++++----- .../Utilities/PinvokeScanner.cs | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs index 81a31f5b0c6..cc3c61a2b88 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs @@ -208,9 +208,12 @@ void Run (bool useMarshalMethods) generateSucceeded = false; } - (success, List pinfos) = ScanForUsedPinvokes (scanner, arch, state.Resolver); - if (!success) { - return; + if (EnableNativeRuntimeLinking) { + (success, List pinfos) = ScanForUsedPinvokes (scanner, arch, state.Resolver); + if (!success) { + return; + } + BuildEngine4.RegisterTaskObjectAssemblyLocal (ProjectSpecificTaskObjectKey (PinvokeScanner.PinvokesInfoRegisterTaskKey), pinfos, RegisteredTaskObjectLifetime.Build); } // If this is the first architecture, we need to store the state for later use @@ -381,10 +384,10 @@ IList MergeManifest (NativeCodeGenState codeGenState, Dictionary pinfos) ScanForUsedPinvokes (PinvokeScanner scanner, AndroidTargetArch arch, XAAssemblyResolver resolver) + (bool success, List? pinfos) ScanForUsedPinvokes (PinvokeScanner scanner, AndroidTargetArch arch, XAAssemblyResolver resolver) { if (!EnableNativeRuntimeLinking) { - return; + return (true, null); } var frameworkAssemblies = new List (); diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs index ae510e5c38e..8c82be7b2c2 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs @@ -14,6 +14,8 @@ namespace Xamarin.Android.Tasks; class PinvokeScanner { + public const string PinvokesInfoRegisterTaskKey = ".:!PreservePinvokesTaskKey!:."; + public sealed class PinvokeEntryInfo { public readonly string LibraryName; From 0828d508c9f3d1d9125717ce6e77b8342dab0d02 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 1 Jul 2024 19:33:05 +0200 Subject: [PATCH 10/53] [wip] p/invoke preservation source code generator --- .../Tasks/GenerateJavaStubs.cs | 12 +- .../Tasks/GeneratePackageManagerJava.cs | 19 +++- .../Tasks/PrepareAbiItems.cs | 3 + .../Utilities/NativeCodeGenState.cs | 7 ++ .../Utilities/PinvokeScanner.cs | 2 - ...PreservePinvokesNativeAssemblyGenerator.cs | 103 ++++++++++++++++-- .../Xamarin.Android.Common.targets | 18 ++- 7 files changed, 144 insertions(+), 20 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs index cc3c61a2b88..5dabfab3009 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs @@ -188,7 +188,7 @@ void Run (bool useMarshalMethods) // Now that "never" never happened, we can proceed knowing that at least the assembly sets are the same for each architecture var nativeCodeGenStates = new ConcurrentDictionary (); NativeCodeGenState? templateCodeGenState = null; - var scanner = new PinvokeScanner (Log); + PinvokeScanner? pinvokeScanner = EnableNativeRuntimeLinking ? new PinvokeScanner (Log) : null; var firstArch = allAssembliesPerArch.First ().Key; var generateSucceeded = true; @@ -208,12 +208,16 @@ void Run (bool useMarshalMethods) generateSucceeded = false; } - if (EnableNativeRuntimeLinking) { - (success, List pinfos) = ScanForUsedPinvokes (scanner, arch, state.Resolver); + if (!success || state == null) { + return; + } + + if (pinvokeScanner != null) { + (success, List pinfos) = ScanForUsedPinvokes (pinvokeScanner, arch, state.Resolver); if (!success) { return; } - BuildEngine4.RegisterTaskObjectAssemblyLocal (ProjectSpecificTaskObjectKey (PinvokeScanner.PinvokesInfoRegisterTaskKey), pinfos, RegisteredTaskObjectLifetime.Build); + state.PinvokeInfos = pinfos; } // If this is the first architecture, we need to store the state for later use diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs index 15f512e521a..eef8f7e8c19 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs @@ -313,7 +313,7 @@ void AddEnvironment () } ConcurrentDictionary? nativeCodeGenStates = null; - if (enableMarshalMethods) { + if (enableMarshalMethods || EnableNativeRuntimeLinking) { nativeCodeGenStates = BuildEngine4.GetRegisteredTaskObjectAssemblyLocal> ( ProjectSpecificTaskObjectKey (GenerateJavaStubs.NativeCodeGenStateRegisterTaskKey), RegisteredTaskObjectLifetime.Build @@ -353,8 +353,10 @@ void AddEnvironment () string targetAbi = abi.ToLowerInvariant (); string environmentBaseAsmFilePath = Path.Combine (EnvironmentOutputDirectory, $"environment.{targetAbi}"); string marshalMethodsBaseAsmFilePath = Path.Combine (EnvironmentOutputDirectory, $"marshal_methods.{targetAbi}"); + string? pinvokePreserveBaseAsmFilePath = EnableNativeRuntimeLinking ? Path.Combine (EnvironmentOutputDirectory, $"pinvoke_preserve.{targetAbi}") : null; string environmentLlFilePath = $"{environmentBaseAsmFilePath}.ll"; string marshalMethodsLlFilePath = $"{marshalMethodsBaseAsmFilePath}.ll"; + string? pinvokePreserveLlFilePath = pinvokePreserveBaseAsmFilePath != null ? $"{pinvokePreserveBaseAsmFilePath}.ll" : null; AndroidTargetArch targetArch = GetAndroidTargetArchForAbi (abi); using var appConfigWriter = MemoryStreamPool.Shared.CreateStreamWriter (); @@ -385,10 +387,17 @@ void AddEnvironment () } if (EnableNativeRuntimeLinking) { - // var pinfoGen = new PreservePinvokesNativeAssemblyGenerator ( - // Log, - // targetArch, - + var pinvokePreserveGen = new PreservePinvokesNativeAssemblyGenerator (Log, EnsureCodeGenState (targetArch), MonoComponents); + LLVMIR.LlvmIrModule pinvokePreserveModule = pinvokePreserveGen.Construct (); + using var pinvokePreserveWriter = MemoryStreamPool.Shared.CreateStreamWriter (); + try { + pinvokePreserveGen.Generate (pinvokePreserveModule, targetArch, pinvokePreserveWriter, pinvokePreserveLlFilePath); + } catch { + throw; + } finally { + pinvokePreserveWriter.Flush (); + Files.CopyIfStreamChanged (pinvokePreserveWriter.BaseStream, pinvokePreserveLlFilePath); + } } LLVMIR.LlvmIrModule marshalMethodsModule = marshalMethodsAsmGen.Construct (); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/PrepareAbiItems.cs b/src/Xamarin.Android.Build.Tasks/Tasks/PrepareAbiItems.cs index fe494103982..f15d8f3459b 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/PrepareAbiItems.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/PrepareAbiItems.cs @@ -16,6 +16,7 @@ public class PrepareAbiItems : AndroidTask const string CompressedAssembliesBase = "compressed_assemblies"; const string JniRemappingBase = "jni_remap"; const string MarshalMethodsBase = "marshal_methods"; + const string PinvokePreserveBase = "pinvoke_preserve"; public override string TaskPrefix => "PAI"; @@ -53,6 +54,8 @@ public override bool RunTask () baseName = JniRemappingBase; } else if (String.Compare ("marshal_methods", Mode, StringComparison.OrdinalIgnoreCase) == 0) { baseName = MarshalMethodsBase; + } else if (String.Compare ("runtime_linking", Mode, StringComparison.OrdinalIgnoreCase) == 0) { + baseName = PinvokePreserveBase; } else { Log.LogError ($"Unknown mode: {Mode}"); return false; diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeCodeGenState.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeCodeGenState.cs index 5a541f2d09c..4e106555df6 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeCodeGenState.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeCodeGenState.cs @@ -30,6 +30,13 @@ class NativeCodeGenState /// public List AllJavaTypes { get; } + /// + /// Contains information about p/invokes used by the managed assemblies included in the + /// application. Will be **null** unless native runtime linking at application build time + /// is enabled. + /// + public List? PinvokeInfos { get; set; } + public List JavaTypesForJCW { get; } public XAAssemblyResolver Resolver { get; } public TypeDefinitionCache TypeCache { get; } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs index 8c82be7b2c2..ae510e5c38e 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs @@ -14,8 +14,6 @@ namespace Xamarin.Android.Tasks; class PinvokeScanner { - public const string PinvokesInfoRegisterTaskKey = ".:!PreservePinvokesTaskKey!:."; - public sealed class PinvokeEntryInfo { public readonly string LibraryName; diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs index dfaa5af0116..1fb05402e42 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs @@ -5,6 +5,7 @@ using System.Text; using Microsoft.Android.Build.Tasks; +using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using Xamarin.Android.Tasks.LLVMIR; @@ -17,19 +18,107 @@ namespace Xamarin.Android.Tasks; class PreservePinvokesNativeAssemblyGenerator : LlvmIrComposer { - readonly TaskLoggingHelper log; - readonly AndroidTargetArch targetArch; - readonly ICollection pinfos; + // Maps a component name after ridding it of the `lib` prefix and the extension to a "canonical" + // name of a library, as used in `[DllImport]` attributes. + readonly Dictionary libraryNameMap = new (StringComparer.Ordinal) { + { "xa-java-interop", "java-interop" }, + { "mono-android.release-static", String.Empty }, + { "mono-android.release", String.Empty }, + }; - public PreservePinvokesNativeAssemblyGenerator (TaskLoggingHelper log, AndroidTargetArch targetArch, ICollection pinfos) + readonly NativeCodeGenState state; + readonly ITaskItem[] monoComponents; + + public PreservePinvokesNativeAssemblyGenerator (TaskLoggingHelper log, NativeCodeGenState codeGenState, ITaskItem[] monoComponents) : base (log) { - this.log = log; - this.targetArch = targetArch; - this.pinfos = pinfos; + if (codeGenState.PinvokeInfos == null) { + throw new InvalidOperationException ($"Internal error: {nameof (codeGenState)} `{nameof (codeGenState.PinvokeInfos)}` property is `null`"); + } + + this.state = codeGenState; + this.monoComponents = monoComponents; } protected override void Construct (LlvmIrModule module) { + Log.LogDebugMessage ("Constructing p/invoke preserve code"); + List pinvokeInfos = state.PinvokeInfos!; + if (pinvokeInfos.Count == 0) { + // This is a very unlikely scenario, but we will work just fine. The module that this generator produces will merely result + // in an empty (but valid) .ll file and an "empty" object file to link into the shared library. + return; + } + + Log.LogDebugMessage (" Looking for enabled native components"); + var componentNames = new List (); + var nativeComponents = new NativeRuntimeComponents (monoComponents); + foreach (NativeRuntimeComponents.Archive archiveItem in nativeComponents.KnownArchives) { + if (!archiveItem.Include) { + continue; + } + + Log.LogDebugMessage ($" {archiveItem.Name}"); + componentNames.Add (archiveItem.Name); + } + + if (componentNames.Count == 0) { + Log.LogDebugMessage ("No native framework components are included in the build, not scanning for p/invoke usage"); + return; + } + + Log.LogDebugMessage (" Checking discovered p/invokes against the list of components"); + foreach (PinvokeScanner.PinvokeEntryInfo pinfo in pinvokeInfos) { + Log.LogDebugMessage ($" p/invoke: {pinfo.EntryName} in {pinfo.LibraryName}"); + if (MustPreserve (pinfo, componentNames)) { + Log.LogDebugMessage (" must be preserved"); + } else { + Log.LogDebugMessage (" no need to preserve"); + } + } + } + + // Returns `true` for all p/invokes that we know are part of our set of components, otherwise returns `false`. + // Returning `false` merely means that the p/invoke isn't in any of BCL or our code and therefore we shouldn't + // care. It doesn't mean the p/invoke will be removed in any way. + bool MustPreserve (PinvokeScanner.PinvokeEntryInfo pinfo, List components) + { + if (String.Compare ("xa-internal-api", pinfo.LibraryName, StringComparison.Ordinal) == 0) { + return true; + } + + foreach (string component in components) { + // The most common pattern for the BCL - file name without extension + string componentName = Path.GetFileNameWithoutExtension (component); + if (Matches (pinfo.LibraryName, componentName)) { + return true; + } + + // If it starts with `lib`, drop the prefix + if (componentName.StartsWith ("lib", StringComparison.Ordinal)) { + if (Matches (pinfo.LibraryName, componentName.Substring (3))) { + return true; + } + } + + // Might require mapping of component name to a canonical one + if (libraryNameMap.TryGetValue (componentName, out string? mappedComponentName) && !String.IsNullOrEmpty (mappedComponentName)) { + if (Matches (pinfo.LibraryName, mappedComponentName)) { + return true; + } + } + + // Try full file name, as the last resort + if (Matches (pinfo.LibraryName, Path.GetFileName (component))) { + return true; + } + } + + return false; + + bool Matches (string libraryName, string componentName) + { + return String.Compare (libraryName, componentName, StringComparison.Ordinal) == 0; + } } } diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index b4e236f58f2..9279e151ad3 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1615,6 +1615,15 @@ because xbuild doesn't support framework reference assemblies. Mode="marshal_methods"> + + + @@ -1753,6 +1762,8 @@ because xbuild doesn't support framework reference assemblies. + + @@ -1978,6 +1989,9 @@ because xbuild doesn't support framework reference assemblies. <_NativeAssemblyTarget Include="@(_AndroidRemapAssemblySource->'$([System.IO.Path]::ChangeExtension('%(Identity)', '.o'))')"> %(_AndroidRemapAssemblySource.abi) + <_NativeAssemblyTarget Include="@(_RuntimeLinkingAssemblySource->'$([System.IO.Path]::ChangeExtension('%(Identity)', '.o'))')"> + %(_RuntimeLinkingAssemblySource.abi) + @@ -1997,10 +2011,10 @@ because xbuild doesn't support framework reference assemblies. Date: Tue, 9 Jul 2024 14:14:20 +0200 Subject: [PATCH 11/53] AndroidAsyncTask -> AsyncTask --- src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs index 6b2c7711966..66043e2f5d0 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs @@ -9,7 +9,7 @@ namespace Xamarin.Android.Tasks; -public class LinkNativeRuntime : AndroidAsyncTask +public class LinkNativeRuntime : AsyncTask { public override string TaskPrefix => "LNR"; From e9ed1fce05d9412f022358b4f5ec4fd44fa54724 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 10 Jul 2024 19:48:22 +0200 Subject: [PATCH 12/53] Prepare for new p/invoke code, step #3 --- src/native/runtime-base/internal-pinvokes.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/native/runtime-base/internal-pinvokes.hh b/src/native/runtime-base/internal-pinvokes.hh index b73e390cccf..a386f785d72 100644 --- a/src/native/runtime-base/internal-pinvokes.hh +++ b/src/native/runtime-base/internal-pinvokes.hh @@ -4,6 +4,7 @@ #include #include +<<<<<<< HEAD #include #include @@ -14,6 +15,14 @@ int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); +======= +#include + +#include "log_types.hh" + +// int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); +// void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); +>>>>>>> c594b73b0 (Prepare for new p/invoke code, step #3) mono_bool _monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up); mono_bool _monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast); @@ -39,8 +48,13 @@ void monodroid_clear_gdb_wait (); void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v); void* _monodroid_timezone_get_default_id (); void _monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args); +<<<<<<< HEAD xamarin::android::managed_timing_sequence* monodroid_timing_start (const char *message); void monodroid_timing_stop (xamarin::android::managed_timing_sequence *sequence, const char *message); +======= +//managed_timing_sequence* monodroid_timing_start (const char *message); +//void monodroid_timing_stop (managed_timing_sequence *sequence, const char *message) +>>>>>>> c594b73b0 (Prepare for new p/invoke code, step #3) char** monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens); void monodroid_strfreev (char **str_array); char* monodroid_strdup_printf (const char *format, ...); @@ -57,6 +71,11 @@ void monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports); int monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path); void* monodroid_get_dylib (); const char* _monodroid_lookup_replacement_type (const char *jniSimpleReference); +<<<<<<< HEAD const JniRemappingReplacementMethod* _monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature); void monodroid_log_traces (uint32_t kind, const char *first_line); void _monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit); +======= +// const JniRemappingReplacementMethod* _monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature); +void monodroid_log_traces (uint32_t kind, const char *first_line); +>>>>>>> c594b73b0 (Prepare for new p/invoke code, step #3) From 83fb4d9751c05d5092d357eca430185451b82e2c Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 16 Jul 2024 14:38:24 +0200 Subject: [PATCH 13/53] Let's see what breaks --- .../Microsoft.Android.Runtime.proj | 1 + src/native/monodroid/CMakeLists.txt | 1 + src/native/monodroid/internal-pinvokes.cc | 75 ++ src/native/pinvoke-override/CMakeLists.txt | 3 + src/native/pinvoke-override/common.cc | 4 + .../pinvoke-override/pinvoke-override-api.hh | 7 + .../pinvoke-override/pinvoke-tables.include | 983 ++++++++++++++++++ src/native/pinvoke-override/precompiled.cc | 11 + src/native/runtime-base/internal-pinvokes.hh | 22 +- 9 files changed, 1092 insertions(+), 15 deletions(-) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index 0a3fb7e3fc8..c087be4b75d 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -48,6 +48,7 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-lz4.a" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-shared-bits.a" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release-static.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libpinvoke-override-dynamic.a" /> diff --git a/src/native/monodroid/CMakeLists.txt b/src/native/monodroid/CMakeLists.txt index 879999ce297..9733766892b 100644 --- a/src/native/monodroid/CMakeLists.txt +++ b/src/native/monodroid/CMakeLists.txt @@ -233,6 +233,7 @@ macro(lib_target_options TARGET_NAME) ${SHARED_LIB_NAME} xa::runtime-base xa::java-interop + xa::pinvoke-override-precompiled xa::lz4 -lmonosgen-2.0 -llog diff --git a/src/native/monodroid/internal-pinvokes.cc b/src/native/monodroid/internal-pinvokes.cc index 0df3d868715..34cc1ccbca5 100644 --- a/src/native/monodroid/internal-pinvokes.cc +++ b/src/native/monodroid/internal-pinvokes.cc @@ -15,14 +15,23 @@ monodroid_get_log_categories () int monodroid_get_system_property (const char *name, char **value) { +<<<<<<< HEAD return AndroidSystem::monodroid_get_system_property (name, value); +======= + return AndroidSystem::monodroid_get_system_property (name, value); +>>>>>>> 13ba4b152 (Let's see what breaks) } int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) { +<<<<<<< HEAD embeddedAssemblies.set_assemblies_prefix (prefix); return 0; +======= + embeddedAssemblies.set_assemblies_prefix (prefix); + return 0; +>>>>>>> 13ba4b152 (Let's see what breaks) } void @@ -62,13 +71,21 @@ monodroid_log (LogLevel level, LogCategories category, const char *message) void monodroid_free (void *ptr) { +<<<<<<< HEAD free (ptr); +======= + free (ptr); +>>>>>>> 13ba4b152 (Let's see what breaks) } int _monodroid_max_gref_get () { +<<<<<<< HEAD return static_cast(AndroidSystem::get_max_gref_count ()); +======= + return static_cast(AndroidSystem::get_max_gref_count ()); +>>>>>>> 13ba4b152 (Let's see what breaks) } int @@ -81,19 +98,31 @@ _monodroid_gref_get () void _monodroid_gref_log (const char *message) { +<<<<<<< HEAD osBridge._monodroid_gref_log (message); +======= + osBridge._monodroid_gref_log (message); +>>>>>>> 13ba4b152 (Let's see what breaks) } int _monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); +======= + return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); +>>>>>>> 13ba4b152 (Let's see what breaks) } void _monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); +======= + osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); +>>>>>>> 13ba4b152 (Let's see what breaks) } int @@ -105,44 +134,86 @@ _monodroid_weak_gref_get () void _monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); +======= + osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); +>>>>>>> 13ba4b152 (Let's see what breaks) } void _monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); +======= + osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); +>>>>>>> 13ba4b152 (Let's see what breaks) } void _monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); +======= + osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); +>>>>>>> 13ba4b152 (Let's see what breaks) } void _monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); +======= + osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); +>>>>>>> 13ba4b152 (Let's see what breaks) } void _monodroid_gc_wait_for_bridge_processing () { +<<<<<<< HEAD mono_gc_wait_for_bridge_processing (); +======= + mono_gc_wait_for_bridge_processing (); +>>>>>>> 13ba4b152 (Let's see what breaks) } +<<<<<<< HEAD +======= +int +_monodroid_get_android_api_level () +{ +<<<<<<< HEAD + return monodroidRuntime.get_android_api_level (); +======= + return monodroidRuntime.get_android_api_level (); +>>>>>>> 13ba4b152 (Let's see what breaks) +} + +>>>>>>> badc53112 (Let's see what breaks) void monodroid_clear_gdb_wait () { +<<<<<<< HEAD monodroidRuntime.set_monodroid_gdb_wait (false); +======= + monodroidRuntime.set_monodroid_gdb_wait (false); +>>>>>>> 13ba4b152 (Let's see what breaks) } void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v) { +<<<<<<< HEAD intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); return (void*) rv; +======= + intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); + return (void*) rv; +>>>>>>> 13ba4b152 (Let's see what breaks) } void* @@ -300,7 +371,11 @@ monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports) https://github.com/dotnet/java-interop/blob/master/src/java-interop/java-interop-gc-bridge-mono.c#L266 it should also accept libmono_path = nullptr parameter +<<<<<<< HEAD */ +======= +*/ +>>>>>>> 13ba4b152 (Let's see what breaks) int monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path) { diff --git a/src/native/pinvoke-override/CMakeLists.txt b/src/native/pinvoke-override/CMakeLists.txt index 82dd535fafe..11b69cfecfc 100644 --- a/src/native/pinvoke-override/CMakeLists.txt +++ b/src/native/pinvoke-override/CMakeLists.txt @@ -35,8 +35,11 @@ macro(create_library _libname _alias _sources) add_library(${_alias} ALIAS ${_libname}) +<<<<<<< HEAD set_static_library_suffix(${_libname}) +======= +>>>>>>> 13ba4b152 (Let's see what breaks) target_compile_definitions( ${_libname} PRIVATE diff --git a/src/native/pinvoke-override/common.cc b/src/native/pinvoke-override/common.cc index aaf56d38ee7..b41a61adf68 100644 --- a/src/native/pinvoke-override/common.cc +++ b/src/native/pinvoke-override/common.cc @@ -3,4 +3,8 @@ using namespace xamarin::android; PinvokeOverride::pinvoke_library_map PinvokeOverride::other_pinvoke_map (PinvokeOverride::LIBRARY_MAP_INITIAL_BUCKET_COUNT); +<<<<<<< HEAD xamarin::android::mutex PinvokeOverride::pinvoke_map_write_lock; +======= +std::mutex PinvokeOverride::pinvoke_map_write_lock; +>>>>>>> 13ba4b152 (Let's see what breaks) diff --git a/src/native/pinvoke-override/pinvoke-override-api.hh b/src/native/pinvoke-override/pinvoke-override-api.hh index 445f8cccf0b..61db13d7221 100644 --- a/src/native/pinvoke-override/pinvoke-override-api.hh +++ b/src/native/pinvoke-override/pinvoke-override-api.hh @@ -78,14 +78,21 @@ namespace xamarin::android { static void* monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name); private: +<<<<<<< HEAD static xamarin::android::mutex pinvoke_map_write_lock; +======= + static std::mutex pinvoke_map_write_lock; +>>>>>>> 13ba4b152 (Let's see what breaks) static pinvoke_library_map other_pinvoke_map; #if defined(PRECOMPILED) static inline void *system_native_library_handle = nullptr; static inline void *system_security_cryptography_native_android_library_handle = nullptr; static inline void *system_io_compression_native_library_handle = nullptr; +<<<<<<< HEAD static inline void *system_globalization_native_library_handle = nullptr; +======= +>>>>>>> 13ba4b152 (Let's see what breaks) #endif }; } diff --git a/src/native/pinvoke-override/pinvoke-tables.include b/src/native/pinvoke-override/pinvoke-tables.include index dc4f761d8c8..c915b184ef5 100644 --- a/src/native/pinvoke-override/pinvoke-tables.include +++ b/src/native/pinvoke-override/pinvoke-tables.include @@ -5,6 +5,7 @@ // A compiler with support for C++20 ranges is required // +<<<<<<< HEAD #include #include @@ -542,12 +543,501 @@ namespace { {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, }}; +======= +#include + +#if INTPTR_MAX == INT64_MAX +//64-bit internal p/invoke table +static PinvokeEntry internal_pinvokes[] = { + {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, + {0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, + {0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, + {0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, + {0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, + {0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, + {0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, + {0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, + {0x3c5532ecdab53f89, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, + {0x423c8f539a2c56d2, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, + {0x4b1956138764939a, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, + {0x4d5b5b488f736058, "path_combine", reinterpret_cast(&path_combine)}, + {0x5a2614d15e2fdc2e, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, + {0x5f0b4e426eff086b, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, + {0x709af13cbfbe2e75, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, + {0x70ae32c9a4f1ad2c, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, + {0x70fc9bab8d56666d, "create_public_directory", reinterpret_cast(&create_public_directory)}, + {0x78514771a67ad724, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, + {0x9099a4b95e3c3a89, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, + {0x958cdb6fd9d1b67b, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, + {0xa6ec846592d99536, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, + {0xa7f58f3ee428cc6b, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, + {0xae3df96dda0143bd, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, + {0xb6222d90af401865, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, + {0xb8306f71b963cd3d, "monodroid_log", reinterpret_cast(&monodroid_log)}, + {0xbc90bafd5ff9c99e, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, + {0xbe5a300beec69c35, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, + {0xbfbb924fbe190616, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, + {0xc2a21d3f6c8ccc24, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, + {0xc5b4690e13898fa3, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, + {0xcc873ea8493d1dd5, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, + {0xce439cfbe29dec11, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, + {0xd1e121b94ea63f2e, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, + {0xd5151b00eb33d85e, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, + {0xda517ef392b6a888, "java_interop_free", reinterpret_cast(&java_interop_free)}, + {0xe27b9849b7e982cb, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, + {0xe370a0d91cd63bc0, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, + {0xe78f1161604ae672, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, + {0xe86307aac9a2631a, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, + {0xebc2c68e10075cc9, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, + {0xee83e38e479aeff1, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, + {0xf3048baf83034541, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, + {0xf41c48df6f9be476, "monodroid_free", reinterpret_cast(&monodroid_free)}, + {0xf5a918ef520db207, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, + {0xf5ed87b004005892, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, + {0xf8798f762db15bba, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, + {0xfa90326712e7e7c4, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, + {0xfdc17c4ea8335ffd, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, + {0xff010b3140f54d3f, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, +}; +//64-bit DotNet p/invoke table +static PinvokeEntry dotnet_pinvokes[] = { + {0x99f2ee02463000, "CompressionNative_Crc32", nullptr}, + {0xb38afc8bfe830b, "SystemNative_Bind", nullptr}, + {0x190fe65d8736dcb, "SystemNative_TryGetIPPacketInformation", nullptr}, + {0x1c8b86562ad5772, "SystemNative_Receive", nullptr}, + {0x202543f28ecaf06, "SystemNative_Abort", nullptr}, + {0x25abeafa88904a2, "SystemNative_SetPosixSignalHandler", nullptr}, + {0x33158212a812caf, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, + {0x3511e36d0a6c1b5, "SystemNative_LockFileRegion", nullptr}, + {0x375a0e90c77ca35, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, + {0x37b9dd562235e42, "SystemNative_MSync", nullptr}, + {0x3a5df4793dd3230, "SystemNative_INotifyInit", nullptr}, + {0x581df5b0a00c422, "SystemNative_SetRLimit", nullptr}, + {0x598db66ca39c41f, "AndroidCryptoNative_EcKeyUpRef", nullptr}, + {0x5b5ab451ff38f8e, "SystemNative_GetMaximumAddressSize", nullptr}, + {0x656cac62ccc9e3c, "AndroidCryptoNative_X509GetContentType", nullptr}, + {0x6861b5336291d12, "SystemNative_PathConf", nullptr}, + {0x690c4347972024f, "AndroidCryptoNative_Aes256Gcm", nullptr}, + {0x6a1f4deffa02c30, "SystemNative_LowLevelMonitor_Acquire", nullptr}, + {0x7b5579ab0499b1f, "AndroidCryptoNative_RsaSize", nullptr}, + {0x7ce8a9b967dd269, "SystemNative_Read", nullptr}, + {0x7f0e1227c9c0225, "CryptoNative_EvpMdCtxDestroy", nullptr}, + {0x8352ae4bba2b83b, "SystemNative_SetSendTimeout", nullptr}, + {0x98bd27a7461321d, "SystemNative_Dup", nullptr}, + {0x9a39fbf59eed9f9, "CryptoNative_EvpSha1", nullptr}, + {0xa4aeeaff9ca2d10, "BrotliDecoderDecompressStream", nullptr}, + {0xa906c14ca5834bc, "SystemNative_GetEUid", nullptr}, + {0xac9f9c1abb62a92, "SystemNative_Log", nullptr}, + {0xadb2441bcfcdfe9, "SystemNative_CreateThread", nullptr}, + {0xafbf5c69d1badc0, "SystemNative_SetTerminalInvalidationHandler", nullptr}, + {0xba897b7abe67b16, "SystemNative_FcntlSetPipeSz", nullptr}, + {0xc305c22ce7ab8a0, "SystemNative_SetSockOpt", nullptr}, + {0xc79e924361c15ca, "SystemNative_RealPath", nullptr}, + {0xcaba893801c6a6f, "AndroidCryptoNative_Aes256Ecb", nullptr}, + {0xcbe6d3d22131194, "AndroidCryptoNative_SetRsaParameters", nullptr}, + {0xef8dd67e25bac53, "SystemNative_GetWindowSize", nullptr}, + {0xfa0899cf8d00a87, "SystemNative_MkDir", nullptr}, + {0xfe7079441ac127e, "SystemNative_CreateSocketEventPort", nullptr}, + {0x1027786cdd9a3e9c, "AndroidCryptoNative_Aes192Cbc", nullptr}, + {0x10d733abd1fd94bb, "SystemNative_TryChangeSocketEventRegistration", nullptr}, + {0x114b8384553f5418, "SystemNative_GetSystemTimeAsTicks", nullptr}, + {0x11b6f4f0aafeda95, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, + {0x11cc73f2926d4064, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, + {0x121bc483ac26f5f8, "SystemNative_GetGroupName", nullptr}, + {0x12d65f9f65b01497, "SystemNative_GetRawSockOpt", nullptr}, + {0x12eaf09505dc19fd, "SystemNative_FStat", nullptr}, + {0x13577369f5ec4b0a, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, + {0x1399413d8a7d9dd8, "SystemNative_GetAddressFamily", nullptr}, + {0x13a1c2de7fb2519f, "SystemNative_CloseSocketEventPort", nullptr}, + {0x146cd1dc4fb2ba58, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, + {0x14b7e3527b60e83f, "CryptoNative_ErrErrorStringN", nullptr}, + {0x15bd710d3a9b3b0c, "CryptoNative_EvpDigestFinalEx", nullptr}, + {0x176e22ea7c580dae, "SystemNative_ReadDirR", nullptr}, + {0x185f5d25252c3c72, "SystemNative_FAllocate", nullptr}, + {0x18f7da5f584b5b59, "SystemNative_PReadV", nullptr}, + {0x1948a0cf88329c2f, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, + {0x1ac95b02f23933cc, "SystemNative_CanGetHiddenFlag", nullptr}, + {0x1d1bb0528d517729, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, + {0x1d4dcbc06728e689, "SystemNative_Close", nullptr}, + {0x1d6d4278ffbbab77, "SystemNative_Pipe", nullptr}, + {0x1d8d6a688fc5bfb3, "SystemNative_SendFile", nullptr}, + {0x1e6228e955989698, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, + {0x1e8edcc515cd23f9, "CryptoNative_EvpDigestOneShot", nullptr}, + {0x1f1c61a157636aad, "SystemNative_Stat", nullptr}, + {0x1f45ac9d3c6b1554, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, + {0x1f7d2360a1cdcbff, "AndroidCryptoNative_SSLStreamCreate", nullptr}, + {0x1f849e45a3014a9f, "SystemNative_GetIPv6Address", nullptr}, + {0x1f9361fc7b624c1b, "SystemNative_LowLevelMonitor_Wait", nullptr}, + {0x205a31e661496019, "CryptoNative_ErrGetErrorAlloc", nullptr}, + {0x20784dcc7e9cee75, "BrotliGetTransforms", nullptr}, + {0x218fce505a140c55, "AndroidCryptoNative_EcDsaVerify", nullptr}, + {0x2291e0ba4e1b55b0, "SystemNative_LStat", nullptr}, + {0x23ac2a4c4d1c744e, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, + {0x24f840f903a26ded, "SystemNative_ConvertErrorPalToPlatform", nullptr}, + {0x24ff74e427d0626e, "SystemNative_GetErrNo", nullptr}, + {0x254905036a0061cf, "SystemNative_CreateSocketEventBuffer", nullptr}, + {0x255c4a2e297fd9f5, "SystemNative_INotifyAddWatch", nullptr}, + {0x267c94097a3bf1f3, "AndroidCryptoNative_CipherDestroy", nullptr}, + {0x27944922cd8283ca, "CryptoNative_EvpSha384", nullptr}, + {0x2795a01c2c64aea1, "CryptoNative_HmacReset", nullptr}, + {0x27f3d9266af2b315, "SystemNative_GetIPv4Address", nullptr}, + {0x2925953889c48cab, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, + {0x2a49948ae20571cb, "SystemNative_SchedGetAffinity", nullptr}, + {0x2c352dd7c367e438, "CryptoNative_EvpSha512", nullptr}, + {0x2c7e5e179cc917cb, "AndroidCryptoNative_DsaSizeSignature", nullptr}, + {0x2c8da1192c5d7d2b, "SystemNative_FLock", nullptr}, + {0x2d64b1ac218cf29e, "SystemNative_AlignedRealloc", nullptr}, + {0x2e1102c297588e10, "BrotliEncoderDestroyInstance", nullptr}, + {0x2e429d96a9fc92bd, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, + {0x2fdcf708ff792105, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, + {0x307db94ae9f929e5, "CryptoNative_GetMaxMdSize", nullptr}, + {0x31027564deeb71b0, "AndroidCryptoNative_Aes128Cbc", nullptr}, + {0x3319a5483b3cc1fc, "SystemNative_GetRLimit", nullptr}, + {0x3424ffcb69ecef57, "SystemNative_Unlink", nullptr}, + {0x346a9bb11364833c, "SystemNative_DrainAutoreleasePool", nullptr}, + {0x35169e67cc0f8529, "SystemNative_GetIPv6MulticastOption", nullptr}, + {0x359205b4a10fa780, "SystemNative_LowLevelMonitor_Destroy", nullptr}, + {0x35c1fa8dffcbbd8c, "CryptoNative_EvpDigestReset", nullptr}, + {0x36128eed665b1923, "SystemNative_ShmUnlink", nullptr}, + {0x364dcf65ae63adff, "SystemNative_GetSocketErrorOption", nullptr}, + {0x3757b327944abb54, "SystemNative_EnablePosixSignalHandling", nullptr}, + {0x38b4bd21127ceffd, "SystemNative_StrErrorR", nullptr}, + {0x38c7de719e8ae69d, "SystemNative_RmDir", nullptr}, + {0x391bbbb9bbde4455, "SystemNative_SetIPv4MulticastOption", nullptr}, + {0x3a7245f3ea476bf7, "SystemNative_SNPrintF", nullptr}, + {0x3ae92e4198427b0d, "SystemNative_ReadLink", nullptr}, + {0x3e0de839e6cfa6e5, "SystemNative_Accept", nullptr}, + {0x3e7cf9a4789a31c7, "SystemNative_FChflags", nullptr}, + {0x3f19a16a3230b551, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, + {0x3f49b6278f04ae84, "SystemNative_Disconnect", nullptr}, + {0x3fba15600bf0f229, "SystemNative_SetEUid", nullptr}, + {0x401935ffc3454bb1, "AndroidCryptoNative_X509PublicKey", nullptr}, + {0x403e1bc0b3baba84, "CompressionNative_Inflate", nullptr}, + {0x40bfa1211f5f6f9c, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, + {0x41b6e7f32da99fa9, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, + {0x41c169fb0e30a390, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, + {0x41c1f2c9153639af, "SystemNative_FUTimens", nullptr}, + {0x420718c398131a55, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, + {0x42339dd2717504d9, "SystemNative_GetLingerOption", nullptr}, + {0x42783107bf2935ec, "SystemNative_FreeHostEntry", nullptr}, + {0x42eb0578a9d62b78, "SystemNative_GetFormatInfoForMountPoint", nullptr}, + {0x43741165a5ba60d5, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, + {0x44ccb27979f980ce, "SystemNative_AlignedAlloc", nullptr}, + {0x44f1a5c46033eec2, "SystemNative_SysLog", nullptr}, + {0x469898c8d892af83, "BrotliEncoderCompress", nullptr}, + {0x483b434d7b089c7e, "SystemNative_Write", nullptr}, + {0x4845e1c76265acc9, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, + {0x484a3a445bdb14fc, "SystemNative_GetOSArchitecture", nullptr}, + {0x4909639a9d87bdb5, "SystemNative_AlignedFree", nullptr}, + {0x49e3ba95feb79c6c, "SystemNative_SetAddressFamily", nullptr}, + {0x4a7272ac9d117f2d, "AndroidCryptoNative_EcKeyDestroy", nullptr}, + {0x4b00795bbeea6f60, "SystemNative_SetIPv6Address", nullptr}, + {0x4be7ceca50f3298c, "SystemNative_LowLevelMonitor_Create", nullptr}, + {0x4bec4a1d7dfd4cf7, "SystemNative_GetUnixRelease", nullptr}, + {0x4bfff22801b209ca, "SystemNative_LChflags", nullptr}, + {0x4c22cc4f2b1dab26, "SystemNative_SetPriority", nullptr}, + {0x4c5d96426f92c29d, "CryptoNative_HmacUpdate", nullptr}, + {0x4d6361e5095cff36, "AndroidCryptoNative_DsaSign", nullptr}, + {0x4d74053b37e582fa, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, + {0x501daf7e3a890220, "AndroidCryptoNative_X509ChainBuild", nullptr}, + {0x523240c01d14ad50, "SystemNative_GetPeerID", nullptr}, + {0x52794f1118d32f08, "SystemNative_GetUnixVersion", nullptr}, + {0x52fc107ebdb6fcc7, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, + {0x5381564d2c06c0a3, "SystemNative_SysConf", nullptr}, + {0x556bc89d2d4dfc85, "SystemNative_GetDeviceIdentifiers", nullptr}, + {0x558250d199e906bb, "CryptoNative_ErrReasonErrorString", nullptr}, + {0x5592a052ceb4caf6, "SystemNative_GetProcessPath", nullptr}, + {0x55fe2620f63d83d8, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, + {0x574d77a68ec3e488, "SystemNative_GetEnv", nullptr}, + {0x5755d1cd0c158620, "BrotliDecoderSetParameter", nullptr}, + {0x580dda20ac9e83c6, "BrotliEncoderSetParameter", nullptr}, + {0x583db0344a1cd715, "SystemNative_GetActiveUdpListeners", nullptr}, + {0x5908581fe73717f0, "SystemNative_InterfaceNameToIndex", nullptr}, + {0x5916efc3e1e49137, "CryptoNative_ErrPeekError", nullptr}, + {0x5a114024ecd1162c, "CryptoNative_EvpDigestUpdate", nullptr}, + {0x5a305cf2a314d6a6, "SystemNative_FTruncate", nullptr}, + {0x5a337d9cc7d8bcfd, "CryptoNative_HmacCurrent", nullptr}, + {0x5d503db70d17dad2, "BrotliEncoderIsFinished", nullptr}, + {0x5dd1d1d024378765, "CryptoNative_EvpMdSize", nullptr}, + {0x5e53b688fede3216, "SystemNative_GetControlCharacters", nullptr}, + {0x5fa62856bdbba9c0, "SystemNative_GetPort", nullptr}, + {0x5fd29ac523ff6e3d, "AndroidCryptoNative_SSLStreamRelease", nullptr}, + {0x5ffae3c8023a80b8, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, + {0x600b4418896f7808, "SystemNative_Exit", nullptr}, + {0x6089f0c8112eb3d9, "SystemNative_InitializeConsoleBeforeRead", nullptr}, + {0x613307e537d462db, "SystemNative_GetReadDirRBufferSize", nullptr}, + {0x61bacd7170fd8c9b, "SystemNative_SchedSetAffinity", nullptr}, + {0x61f3ce1b18b20d6f, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, + {0x62351df42d842942, "SystemNative_GetSignalForBreak", nullptr}, + {0x6393d30aceaa6df2, "SystemNative_PWriteV", nullptr}, + {0x639e6e938ec8d9f2, "SystemNative_GetPeerUserName", nullptr}, + {0x6448f0806bd3a338, "SystemNative_FreeEnviron", nullptr}, + {0x648a9b317bc64fe0, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, + {0x650eddee76c6b8da, "SystemNative_GetHostName", nullptr}, + {0x652badfba5d61929, "SystemNative_FcntlSetFD", nullptr}, + {0x66e049fe27bf91ea, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, + {0x6792c0a7ea5d19c9, "BrotliEncoderTakeOutput", nullptr}, + {0x67a8868ef592a3fd, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, + {0x67a9b5bbce322f8c, "AndroidCryptoNative_Des3Cbc", nullptr}, + {0x67d2cd86792b1d0c, "SystemNative_Realloc", nullptr}, + {0x67e9d60481f4be06, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, + {0x68df81a8fb5bf442, "SystemNative_GetSockOpt", nullptr}, + {0x68f3fe6083c0355b, "SystemNative_GetLoadLibraryError", nullptr}, + {0x69ad99fac0467f64, "SystemNative_Link", nullptr}, + {0x6a59d9242cd31785, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, + {0x6b9097385aa77917, "SystemNative_FSync", nullptr}, + {0x6b9bce16ba8e845f, "SystemNative_Malloc", nullptr}, + {0x6d566e1f6e5a2d8f, "BrotliDefaultAllocFunc", nullptr}, + {0x6dbd90e9cc86310b, "AndroidCryptoNative_CipherFinalEx", nullptr}, + {0x6dfd40c2dd0d7382, "AndroidCryptoNative_RsaUpRef", nullptr}, + {0x6e2c1caff08e6e2d, "SystemNative_ReadStdin", nullptr}, + {0x6ee05d5e8650e56c, "SystemNative_DisablePosixSignalHandling", nullptr}, + {0x6f990f1f7bc80630, "AndroidCryptoNative_RsaCreate", nullptr}, + {0x70f907b97d3fe059, "AndroidCryptoNative_Aes192Ccm", nullptr}, + {0x7150f0eb40797bb3, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, + {0x724820d307055ed1, "CryptoNative_HmacFinal", nullptr}, + {0x729afe37cdb8ae8f, "SystemNative_Connect", nullptr}, + {0x730ae9a7469a7321, "SystemNative_GetAllMountPoints", nullptr}, + {0x7356b141407d261e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, + {0x742da00b2dbf435d, "SystemNative_LoadLibrary", nullptr}, + {0x74ec4a8d869776ad, "AndroidCryptoNative_Aes128Ccm", nullptr}, + {0x758dfbf057da0da0, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, + {0x7975d1d7029cf1a3, "AndroidCryptoNative_Aes128Gcm", nullptr}, + {0x79f5c24afbd04af1, "AndroidCryptoNative_Aes256Cbc", nullptr}, + {0x7a37e0d077f2dfe5, "AndroidCryptoNative_DsaGenerateKey", nullptr}, + {0x7af1f52a7a632e95, "BrotliDecoderTakeOutput", nullptr}, + {0x7d5273ad530e7298, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, + {0x7d7ee4bce74d4de9, "SystemNative_GetDomainSocketSizes", nullptr}, + {0x7e1766c6df3ad261, "SystemNative_MUnmap", nullptr}, + {0x7e4bdf46d4ff9f11, "SystemNative_MkNod", nullptr}, + {0x7ec328b6ba9eab8a, "SystemNative_WaitForSocketEvents", nullptr}, + {0x7fa96d0284954375, "AndroidCryptoNative_X509Decode", nullptr}, + {0x80ef5040fdcc248d, "BrotliEncoderMaxCompressedSize", nullptr}, + {0x813bedf08c3388d4, "AndroidCryptoNative_Aes128Cfb8", nullptr}, + {0x84b5542f0da03584, "SystemNative_GetIPSocketAddressSizes", nullptr}, + {0x84c8a7489b37fea0, "SystemNative_GetPlatformSignalNumber", nullptr}, + {0x84cc0301870c37ce, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, + {0x8502eeba98158e79, "SystemNative_FcntlSetIsNonBlocking", nullptr}, + {0x8530d37777969db6, "SystemNative_SetKeypadXmit", nullptr}, + {0x8537eeb56d41402b, "CompressionNative_DeflateReset", nullptr}, + {0x85d0033bc38bb4bb, "SystemNative_MAdvise", nullptr}, + {0x868e09dc7dfea364, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, + {0x870191ad244b8069, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, + {0x87019b7831c0c34c, "AndroidCryptoNative_Aes192Gcm", nullptr}, + {0x87c447e7f873cff0, "AndroidCryptoNative_X509ChainValidate", nullptr}, + {0x889350f209555ecb, "SystemNative_MkdTemp", nullptr}, + {0x88a08b60b80c70cc, "SystemNative_FChMod", nullptr}, + {0x88cfeefc903f9d60, "CryptoNative_EvpDigestCurrent", nullptr}, + {0x8bcabce135063bed, "SystemNative_OpenDir", nullptr}, + {0x8df448aee6e8fa5e, "SystemNative_WaitPidExitedNoHang", nullptr}, + {0x8e96cb02418947cc, "SystemNative_FcntlGetPipeSz", nullptr}, + {0x8fb6ed14ee0256bc, "SystemNative_GetTimestamp", nullptr}, + {0x8ffe2d950d138c01, "SystemNative_SchedGetCpu", nullptr}, + {0x9039632237d70ae7, "AndroidCryptoNative_NewGlobalReference", nullptr}, + {0x9161ade1206fd86e, "AndroidCryptoNative_Aes256Cfb128", nullptr}, + {0x9167a072639a7c95, "AndroidCryptoNative_Aes256Ccm", nullptr}, + {0x91f065ec0d3aec55, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, + {0x93a8bec488055608, "SystemNative_GetPwNamR", nullptr}, + {0x95a0e2fc5c0cb49e, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, + {0x95a4cb8563cc6b14, "SystemNative_ShmOpen", nullptr}, + {0x9856fa59ed936b73, "SystemNative_GetSid", nullptr}, + {0x996ada1c038aabba, "SystemNative_MksTemps", nullptr}, + {0x9991a277809ef205, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, + {0x99a840c495204202, "SystemNative_GetBytesAvailable", nullptr}, + {0x99e3660fc483d7be, "CryptoNative_GetRandomBytes", nullptr}, + {0x9aa9eaee3dd8b23b, "SystemNative_GetIPv4MulticastOption", nullptr}, + {0x9aaaad33b28af82f, "SystemNative_SetSignalForBreak", nullptr}, + {0x9aab07f824659d3e, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, + {0x9c3e8b890033819a, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, + {0x9c832cd7fcbf2de0, "SystemNative_MkFifo", nullptr}, + {0x9d2cb31282abd3d9, "SystemNative_GetNetworkInterfaces", nullptr}, + {0x9e25ebf4f61cc299, "SystemNative_ChDir", nullptr}, + {0x9e79166979634030, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, + {0x9edddf30d660eff4, "AndroidCryptoNative_Aes192Ecb", nullptr}, + {0x9fb01da1222e905a, "SystemNative_IsATty", nullptr}, + {0xa1e881a63614507e, "SystemNative_INotifyRemoveWatch", nullptr}, + {0xa2254fea4d8b6909, "SystemNative_MMap", nullptr}, + {0xa272b5349013d9ef, "CryptoNative_EvpSha256", nullptr}, + {0xa2d7790a850024c0, "SystemNative_GetNumRoutes", nullptr}, + {0xa302613a430248b8, "SystemNative_GetGroups", nullptr}, + {0xa308025a784497df, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, + {0xa56532a23755cd87, "SystemNative_StdinReady", nullptr}, + {0xa56954e28eb9a9c9, "AndroidCryptoNative_Des3Cfb8", nullptr}, + {0xa57e18f82abd5958, "BrotliDecoderDestroyInstance", nullptr}, + {0xa5eda72b95fe78c3, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, + {0xa89b70c38d3ba079, "CryptoNative_HmacCreate", nullptr}, + {0xa89ec9958d999483, "SystemNative_GetCwd", nullptr}, + {0xa8bdc3e7ee898dfc, "SystemNative_Shutdown", nullptr}, + {0xa93eb533acf7564d, "AndroidCryptoNative_DesEcb", nullptr}, + {0xa961e8db31830e16, "AndroidCryptoNative_Aes192Cfb8", nullptr}, + {0xabdcf2f74d210f35, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, + {0xac11eab9d9c31b01, "SystemNative_UTimensat", nullptr}, + {0xac7725c652a5fb5b, "SystemNative_CopyFile", nullptr}, + {0xad1a2d6575cdd4e3, "AndroidCryptoNative_SSLStreamWrite", nullptr}, + {0xad228cdc4edb11d6, "SystemNative_CloseDir", nullptr}, + {0xadc6889903a2d6f4, "SystemNative_Rename", nullptr}, + {0xae320903718eb45d, "SystemNative_MapTcpState", nullptr}, + {0xaf72b94c4acee897, "BrotliDecoderHasMoreOutput", nullptr}, + {0xaf9706efc72c3904, "SystemNative_SetIPv6MulticastOption", nullptr}, + {0xafd9f6338cdbadd4, "SystemNative_GetHostEntryForName", nullptr}, + {0xafe3d21bbaa71464, "CompressionNative_DeflateEnd", nullptr}, + {0xb0b66a7145de350d, "SystemNative_Access", nullptr}, + {0xb0df46ff09c57741, "AndroidCryptoNative_GetRsaParameters", nullptr}, + {0xb0e18377ed603e0b, "SystemNative_GetGroupList", nullptr}, + {0xb1c394b9992bd67d, "AndroidCryptoNative_EcDsaSign", nullptr}, + {0xb1ff12f3bd735982, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, + {0xb361006446f560e8, "SystemNative_LogError", nullptr}, + {0xb3e1e5e50cde576e, "BrotliEncoderVersion", nullptr}, + {0xb41fa43cc5c261cb, "BrotliDecoderGetErrorCode", nullptr}, + {0xb4996dd1aba38200, "AndroidCryptoNative_EcDsaSize", nullptr}, + {0xb516027cb59e6541, "BrotliDecoderIsFinished", nullptr}, + {0xb575ec01a7a79f8f, "AndroidCryptoNative_DesCfb8", nullptr}, + {0xb600c44028c1743d, "SystemNative_Socket", nullptr}, + {0xb632e9bc6f7be0a9, "SystemNative_GetSockName", nullptr}, + {0xb6540b73eff28747, "SystemNative_SetRawSockOpt", nullptr}, + {0xb66be1550d27bfb4, "AndroidCryptoNative_GetECCurveParameters", nullptr}, + {0xb69c3cc8b9f6a724, "BrotliDecoderIsUsed", nullptr}, + {0xb6ab9abf7887911f, "SystemNative_ReadEvents", nullptr}, + {0xb73c597de01bc0b2, "SystemNative_GetPwUidR", nullptr}, + {0xb78af5975603cd20, "SystemNative_Sync", nullptr}, + {0xb7bbbe2c16a565c6, "SystemNative_Calloc", nullptr}, + {0xb828d9e7df5437a5, "BrotliDecoderErrorString", nullptr}, + {0xba2f6d298f3be8bc, "CryptoNative_EvpMd5", nullptr}, + {0xbb3343826d504870, "SystemNative_GetBootTimeTicks", nullptr}, + {0xbb5e970ecb6745da, "SystemNative_SymLink", nullptr}, + {0xbbd20cce92ec2c12, "SystemNative_FcntlGetFD", nullptr}, + {0xbcd9e53d2d288094, "SystemNative_GetNameInfo", nullptr}, + {0xbd5a0be2f7904089, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, + {0xbd89ef4df5486744, "SystemNative_Send", nullptr}, + {0xbdbbd2898347c0d1, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, + {0xbdd3128e77381b01, "SystemNative_EnumerateInterfaceAddresses", nullptr}, + {0xbe8df478de07c6d8, "BrotliDefaultFreeFunc", nullptr}, + {0xc00ebc097b776c1f, "SystemNative_GetPriority", nullptr}, + {0xc036b23d88fad91b, "SystemNative_iOSSupportVersion", nullptr}, + {0xc0bb2dd0c5b74436, "CryptoNative_EnsureOpenSslInitialized", nullptr}, + {0xc10e411c989a9314, "CompressionNative_Deflate", nullptr}, + {0xc11cd661db8be230, "AndroidCryptoNative_Des3Cfb64", nullptr}, + {0xc183a0550feea0d6, "BrotliEncoderCompressStream", nullptr}, + {0xc19b94823ea1d39e, "CryptoNative_HmacOneShot", nullptr}, + {0xc1b8a5f1c799e4bb, "BrotliGetDictionary", nullptr}, + {0xc1c679eefc134d31, "SystemNative_LowLevelMonitor_Release", nullptr}, + {0xc2d5e1c465b2f5b6, "AndroidCryptoNative_DsaSizeP", nullptr}, + {0xc3145e336c38379b, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, + {0xc3c10021b10ba455, "SystemNative_GetEGid", nullptr}, + {0xc3fe9394fe1f3f02, "SystemNative_GetSocketType", nullptr}, + {0xc560d9947ab2a34d, "SystemNative_RegisterForSigChld", nullptr}, + {0xc5bed971846027de, "SystemNative_GetCpuUtilization", nullptr}, + {0xc69433678dd341ca, "SystemNative_ForkAndExecProcess", nullptr}, + {0xc7815e0476511544, "AndroidCryptoNative_X509Encode", nullptr}, + {0xc7ae1b8d93af5d73, "SystemNative_ChMod", nullptr}, + {0xc7d536c0e7eb3fe2, "SystemNative_FreeSocketEventBuffer", nullptr}, + {0xc7f81d5b58b65ac0, "BrotliEncoderCreateInstance", nullptr}, + {0xc87a5ee4869035c6, "SystemNative_UninitializeConsoleAfterRead", nullptr}, + {0xc8a52a8b6d96b32b, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, + {0xc93df58ae5457bfd, "SystemNative_GetControlMessageBufferSize", nullptr}, + {0xc956e528f995739c, "SystemNative_ReceiveMessage", nullptr}, + {0xca001af79c0d7a8b, "CompressionNative_InflateEnd", nullptr}, + {0xca48c3927c202794, "AndroidCryptoNative_GetECKeyParameters", nullptr}, + {0xcaae6d345ba32c7b, "SystemNative_Kill", nullptr}, + {0xcaec08aa13779f7f, "SystemNative_GetEnviron", nullptr}, + {0xcaf599a20538b10b, "SystemNative_SetWindowSize", nullptr}, + {0xcb4bcdafdc81d116, "AndroidCryptoNative_CipherCreatePartial", nullptr}, + {0xcbbb90469d28cded, "SystemNative_SearchPath", nullptr}, + {0xcc433093c073719e, "AndroidCryptoNative_SSLStreamRead", nullptr}, + {0xcc43d880192dd6ff, "SystemNative_ConvertErrorPlatformToPal", nullptr}, + {0xcc788c0474c3e178, "SystemNative_LSeek", nullptr}, + {0xcd5d8a63493f5e38, "CompressionNative_InflateInit2_", nullptr}, + {0xcdcb014df9a6eae2, "SystemNative_SetPort", nullptr}, + {0xce36e2e1a139a020, "SystemNative_GetDefaultTimeZone", nullptr}, + {0xce6ddfe40fed99d9, "SystemNative_PRead", nullptr}, + {0xce9f8a6ac705faa5, "AndroidCryptoNative_X509DecodeCollection", nullptr}, + {0xceba527295694651, "BrotliDecoderCreateInstance", nullptr}, + {0xd392d6ed5dcc111c, "SystemNative_GetDomainName", nullptr}, + {0xd55437b16dc84f3b, "SystemNative_GetIPv4GlobalStatistics", nullptr}, + {0xd5c063a90ae882c1, "AndroidCryptoNative_CipherIsSupported", nullptr}, + {0xd7d818c7640598dc, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, + {0xd7f1a8f616897ace, "AndroidCryptoNative_Aes256Cfb8", nullptr}, + {0xd88be8f9e9f28e90, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, + {0xd8976692c4c68818, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, + {0xd8a9e47b6ca78448, "CryptoNative_ErrPeekLastError", nullptr}, + {0xd9bd0b370726ce34, "AndroidCryptoNative_CipherReset", nullptr}, + {0xda05c57c78aa6706, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, + {0xda38bffa1d16cdd6, "SystemNative_SetLingerOption", nullptr}, + {0xda4898a26933f73d, "AndroidCryptoNative_DsaVerify", nullptr}, + {0xda6b3192974ca60e, "SystemNative_Open", nullptr}, + {0xdab5eb45815daabc, "SystemNative_GetAtOutOfBandMark", nullptr}, + {0xdae32aac0c0d305c, "SystemNative_ReadProcessStatusInfo", nullptr}, + {0xdbb4752ed23670f0, "AndroidCryptoNative_DesCbc", nullptr}, + {0xdbee22594fa8c585, "SystemNative_CreateAutoreleasePool", nullptr}, + {0xdc51159ffe70b0e0, "BrotliDecoderVersion", nullptr}, + {0xdd4c03f06ce96e04, "AndroidCryptoNative_RsaDestroy", nullptr}, + {0xdde06993f87d6ffc, "AndroidCryptoNative_Aes128Cfb128", nullptr}, + {0xde1e22dd097f799c, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, + {0xde259001bf54e6f1, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, + {0xdec5c7544d2c8cb1, "AndroidCryptoNative_GetDsaParameters", nullptr}, + {0xdf650444c8af0763, "SystemNative_FcntlGetIsNonBlocking", nullptr}, + {0xdfede2defd776f7e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, + {0xe059239741e0011a, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, + {0xe0a170d2b947a8fc, "SystemNative_SendMessage", nullptr}, + {0xe0a601fd89d9b279, "SystemNative_SetErrNo", nullptr}, + {0xe0f34ce89fd38aef, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, + {0xe20c29fb8b19da7b, "SystemNative_Listen", nullptr}, + {0xe36a157177b2db08, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, + {0xe44f737a5bebdd90, "SystemNative_SetIPv4Address", nullptr}, + {0xe582a4a60bb74c35, "SystemNative_GetProcAddress", nullptr}, + {0xe604fca300068c0c, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, + {0xe6838f2add787bfe, "SystemNative_FreeLibrary", nullptr}, + {0xe73aeaf9e3a10343, "SystemNative_PWrite", nullptr}, + {0xe78ff100d1d73d99, "SystemNative_SetReceiveTimeout", nullptr}, + {0xe853ecfe4d402ed0, "SystemNative_Poll", nullptr}, + {0xea5e6653389b924a, "CompressionNative_DeflateInit2_", nullptr}, + {0xea61d6c040267b2d, "BrotliSetDictionaryData", nullptr}, + {0xeaafb7963ceb9bf4, "SystemNative_GetTcpGlobalStatistics", nullptr}, + {0xeab45239fb3f138d, "AndroidCryptoNative_GetBigNumBytes", nullptr}, + {0xead798b3c60b390e, "CompressionNative_InflateReset", nullptr}, + {0xec67e4076662c2de, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, + {0xef71ee101b3ece96, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, + {0xeff5d014640ae969, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, + {0xf0045895a9043221, "SystemNative_SearchPath_TempDirectory", nullptr}, + {0xf0ec052da6c5fa70, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, + {0xf1577384f409ea85, "AndroidCryptoNative_BigNumToBinary", nullptr}, + {0xf2c7fa39bf166188, "SystemNative_Free", nullptr}, + {0xf38b47e43f352491, "SystemNative_GetUdpGlobalStatistics", nullptr}, + {0xf432f105a045b088, "CryptoNative_ErrClearError", nullptr}, + {0xf4dea312f71c5ff2, "AndroidCryptoNative_Aes128Ecb", nullptr}, + {0xf4f5526ddc32beac, "CryptoNative_HmacDestroy", nullptr}, + {0xf57f81262f07542c, "AndroidCryptoNative_Des3Ecb", nullptr}, + {0xf6ede5d5d8729315, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, + {0xf75d4fdd6e749a84, "BrotliTransformDictionaryWord", nullptr}, + {0xf7b334768844b502, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, + {0xf85b8ffeba9b06c1, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, + {0xf870179a8d8d1872, "SystemNative_PosixFAdvise", nullptr}, + {0xf8c983dd21ef9fe6, "SystemNative_GetPid", nullptr}, + {0xf96bc1e7e15e69f2, "AndroidCryptoNative_CipherUpdate", nullptr}, + {0xf970881d4fa83e07, "AndroidCryptoNative_CipherCreate", nullptr}, + {0xf9c3d216226b3355, "AndroidCryptoNative_CipherSetTagLength", nullptr}, + {0xf9dea6e72f1fffc9, "CryptoNative_EvpMdCtxCreate", nullptr}, + {0xfa26b86cedf66721, "SystemNative_Sysctl", nullptr}, + {0xfaa7766eaa2c54a5, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, + {0xfb3e394cc613f202, "SystemNative_GetPeerName", nullptr}, + {0xfbb57319454b1074, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, + {0xfc0bad2b1528000f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, + {0xfcdeea476953780c, "AndroidCryptoNative_Aes192Cfb128", nullptr}, + {0xfd2cdd99f11de76c, "AndroidCryptoNative_EcKeyGetSize", nullptr}, + {0xfd4f2784ec1c98aa, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, + {0xfe3dd06281f7cd1f, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, + {0xff28b3bec4f32a2c, "SystemNative_GetFileSystemType", nullptr}, + {0xff9b8d95b0e209fb, "BrotliEncoderHasMoreOutput", nullptr}, + {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, +}; +>>>>>>> 13ba4b152 (Let's see what breaks) constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; +<<<<<<< HEAD constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; #else //32-bit internal p/invoke table @@ -1082,15 +1572,508 @@ constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; {0xff975200, "SystemNative_Realloc", nullptr}, }}; +======= +#else +//32-bit internal p/invoke table +static PinvokeEntry internal_pinvokes[] = { + {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, + {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, + {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, + {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, + {0x2a0e1744, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, + {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, + {0x2f7d0f53, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, + {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, + {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, + {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, + {0x395808e5, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, + {0x42b41fe4, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, + {0x434ad3e4, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, + {0x4b58e0da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, + {0x501befde, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, + {0x501ebdc2, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, + {0x7a6909a0, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, + {0x7c94dbf5, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, + {0x8f6837ec, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, + {0x9070e02c, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, + {0x910452d0, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, + {0x934790b1, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, + {0x9a734f16, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, + {0x9b7b9290, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, + {0x9c5b24a8, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, + {0xa04e5d1c, "monodroid_free", reinterpret_cast(&monodroid_free)}, + {0xa11d71da, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, + {0xa7ea4a5f, "path_combine", reinterpret_cast(&path_combine)}, + {0xad511c82, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, + {0xb02468aa, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, + {0xbe8d7701, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, + {0xc0d097a7, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, + {0xc439b5d7, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, + {0xc5146c54, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, + {0xc58eafa5, "java_interop_free", reinterpret_cast(&java_interop_free)}, + {0xd3b5d2c1, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, + {0xd78c749d, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, + {0xd91f3619, "create_public_directory", reinterpret_cast(&create_public_directory)}, + {0xe215a17c, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, + {0xe4c3ee19, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, + {0xe7e77ca5, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, + {0xea2184e3, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, + {0xf4079b4a, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, + {0xf5a0ac55, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, + {0xf61941c3, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, + {0xf6ca4b3b, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, + {0xfa1832a6, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, + {0xfa4e32ca, "monodroid_log", reinterpret_cast(&monodroid_log)}, + {0xfdc3ae2a, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, +}; +//32-bit DotNet p/invoke table +static PinvokeEntry dotnet_pinvokes[] = { + {0xaf6b1c, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, + {0xc89820, "CompressionNative_InflateReset", nullptr}, + {0x1733089, "SystemNative_SetTerminalInvalidationHandler", nullptr}, + {0x1dd1f00, "AndroidCryptoNative_Aes192Cfb8", nullptr}, + {0x23a0578, "AndroidCryptoNative_NewGlobalReference", nullptr}, + {0x2f05496, "SystemNative_GetPeerName", nullptr}, + {0x3295077, "SystemNative_MapTcpState", nullptr}, + {0x3d9bc5f, "SystemNative_Unlink", nullptr}, + {0x3e12cb4, "SystemNative_INotifyInit", nullptr}, + {0x5b0fb1d, "SystemNative_InitializeConsoleBeforeRead", nullptr}, + {0x80f30b4, "BrotliDecoderTakeOutput", nullptr}, + {0x84ccf89, "SystemNative_MSync", nullptr}, + {0x8c636a2, "SystemNative_FcntlSetPipeSz", nullptr}, + {0x8de5b3d, "SystemNative_GetSid", nullptr}, + {0x92bf2d9, "AndroidCryptoNative_EcKeyGetSize", nullptr}, + {0xaa46d20, "SystemNative_SNPrintF", nullptr}, + {0xaa7c86e, "SystemNative_Exit", nullptr}, + {0xb6a80bd, "SystemNative_SetAddressFamily", nullptr}, + {0xbdd984d, "SystemNative_SetWindowSize", nullptr}, + {0xcc59904, "CryptoNative_HmacDestroy", nullptr}, + {0xd5ca844, "SystemNative_CreateSocketEventPort", nullptr}, + {0xd98d741, "SystemNative_Kill", nullptr}, + {0xfc48476, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, + {0x10d108c9, "SystemNative_FreeHostEntry", nullptr}, + {0x1165644f, "SystemNative_GetOSArchitecture", nullptr}, + {0x11778651, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, + {0x1178ebdd, "CryptoNative_EvpDigestFinalEx", nullptr}, + {0x11a2796d, "SystemNative_GetTcpGlobalStatistics", nullptr}, + {0x12fdf5c3, "SystemNative_ConvertErrorPlatformToPal", nullptr}, + {0x1348bf25, "AndroidCryptoNative_SSLStreamWrite", nullptr}, + {0x1376985b, "SystemNative_SetSockOpt", nullptr}, + {0x13925de2, "SystemNative_GetLingerOption", nullptr}, + {0x13f565a9, "SystemNative_GetControlMessageBufferSize", nullptr}, + {0x142a08a1, "SystemNative_PosixFAdvise", nullptr}, + {0x17549123, "SystemNative_Connect", nullptr}, + {0x17a5d095, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, + {0x17b96c39, "SystemNative_FreeSocketEventBuffer", nullptr}, + {0x1904820d, "SystemNative_GetHostEntryForName", nullptr}, + {0x19b6a696, "AndroidCryptoNative_X509DecodeCollection", nullptr}, + {0x1a302b28, "SystemNative_SchedSetAffinity", nullptr}, + {0x1ab1248e, "SystemNative_GetHostName", nullptr}, + {0x1bf277c4, "SystemNative_WaitForSocketEvents", nullptr}, + {0x1c4778bf, "SystemNative_AlignedFree", nullptr}, + {0x1cb466df, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, + {0x1cf7b52c, "SystemNative_MAdvise", nullptr}, + {0x1eb6eaaa, "CryptoNative_GetRandomBytes", nullptr}, + {0x1ebc63c1, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, + {0x1f186646, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, + {0x1f1cd573, "AndroidCryptoNative_Des3Cfb64", nullptr}, + {0x1f998744, "AndroidCryptoNative_Aes128Cfb128", nullptr}, + {0x1fdcd1e0, "CryptoNative_ErrPeekError", nullptr}, + {0x212e38c4, "SystemNative_GetUdpGlobalStatistics", nullptr}, + {0x22011e2b, "SystemNative_SetLingerOption", nullptr}, + {0x224ebd71, "SystemNative_Listen", nullptr}, + {0x2253b591, "BrotliGetTransforms", nullptr}, + {0x226eec4d, "SystemNative_Abort", nullptr}, + {0x229f73d4, "AndroidCryptoNative_RsaUpRef", nullptr}, + {0x22bbb587, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, + {0x2304e65b, "SystemNative_SetRLimit", nullptr}, + {0x23cfcfb0, "BrotliTransformDictionaryWord", nullptr}, + {0x260a3e8d, "CompressionNative_DeflateInit2_", nullptr}, + {0x289b5430, "SystemNative_Log", nullptr}, + {0x28d95a99, "SystemNative_CanGetHiddenFlag", nullptr}, + {0x28f3db4b, "SystemNative_ShmUnlink", nullptr}, + {0x2af6aa40, "SystemNative_Access", nullptr}, + {0x2b117055, "BrotliDecoderDecompress", nullptr}, + {0x2b7293c5, "SystemNative_GetTimestamp", nullptr}, + {0x2b747a9c, "SystemNative_MkNod", nullptr}, + {0x2bc9ff5e, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, + {0x2c4415fd, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, + {0x2c467430, "AndroidCryptoNative_GetECCurveParameters", nullptr}, + {0x2d21ad97, "SystemNative_GetReadDirRBufferSize", nullptr}, + {0x2d6e4a1c, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, + {0x2e66f31b, "BrotliDecoderDestroyInstance", nullptr}, + {0x2eb28fb6, "SystemNative_GetIPv4Address", nullptr}, + {0x2ff73621, "CryptoNative_ErrReasonErrorString", nullptr}, + {0x30af09b7, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, + {0x31120969, "SystemNative_Malloc", nullptr}, + {0x3374b950, "SystemNative_GetLoadLibraryError", nullptr}, + {0x349c5a8f, "SystemNative_GetNetworkInterfaces", nullptr}, + {0x354aa58f, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, + {0x363c0010, "CryptoNative_EvpDigestUpdate", nullptr}, + {0x367eee31, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, + {0x38575bc5, "SystemNative_GetUnixRelease", nullptr}, + {0x388a31d4, "SystemNative_PathConf", nullptr}, + {0x3a238b9f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, + {0x3a861d34, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, + {0x3af56a10, "AndroidCryptoNative_RsaSize", nullptr}, + {0x3bf3d465, "SystemNative_GetIPv6MulticastOption", nullptr}, + {0x3cb49aae, "SystemNative_GetPwNamR", nullptr}, + {0x3d150bdf, "AndroidCryptoNative_Aes128Ecb", nullptr}, + {0x3da52690, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, + {0x3de52faf, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, + {0x3df8d649, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, + {0x3e175e7c, "AndroidCryptoNative_Aes256Cfb128", nullptr}, + {0x3e273961, "SystemNative_StrErrorR", nullptr}, + {0x3e48f022, "SystemNative_GetMaximumAddressSize", nullptr}, + {0x3e778b38, "BrotliDecoderVersion", nullptr}, + {0x3ea31c40, "SystemNative_GetAddressFamily", nullptr}, + {0x3efdb5a0, "SystemNative_SendMessage", nullptr}, + {0x3f47618f, "CryptoNative_EnsureOpenSslInitialized", nullptr}, + {0x3f793993, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, + {0x40b0026c, "CompressionNative_DeflateEnd", nullptr}, + {0x40e64bdd, "CryptoNative_ErrClearError", nullptr}, + {0x413b9801, "SystemNative_Read", nullptr}, + {0x41818c1d, "SystemNative_GetPriority", nullptr}, + {0x41cf0c16, "AndroidCryptoNative_CipherCreate", nullptr}, + {0x42955366, "SystemNative_Disconnect", nullptr}, + {0x42afcfbb, "AndroidCryptoNative_CipherCreatePartial", nullptr}, + {0x430352b3, "SystemNative_GetNameInfo", nullptr}, + {0x43f6cea1, "AndroidCryptoNative_DesCfb8", nullptr}, + {0x4543d533, "AndroidCryptoNative_EcDsaVerify", nullptr}, + {0x45f09dca, "AndroidCryptoNative_CipherSetTagLength", nullptr}, + {0x477f60cf, "SystemNative_OpenDir", nullptr}, + {0x47a82b4e, "SystemNative_AlignedRealloc", nullptr}, + {0x48c17c9b, "SystemNative_Sysctl", nullptr}, + {0x493888ee, "CompressionNative_Crc32", nullptr}, + {0x494ef6d4, "SystemNative_GetIPv4MulticastOption", nullptr}, + {0x496f1885, "SystemNative_GetSocketErrorOption", nullptr}, + {0x49c2af32, "SystemNative_GetBootTimeTicks", nullptr}, + {0x49c81782, "SystemNative_MkDir", nullptr}, + {0x4a4ef46f, "SystemNative_FcntlGetFD", nullptr}, + {0x4b78d330, "CryptoNative_HmacCurrent", nullptr}, + {0x4c6d50ba, "SystemNative_GetIPv4GlobalStatistics", nullptr}, + {0x4ca38207, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, + {0x4cb997ae, "BrotliEncoderCompress", nullptr}, + {0x4d1a35d1, "SystemNative_LowLevelMonitor_Release", nullptr}, + {0x4d75bb15, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, + {0x4dbf0c74, "SystemNative_CreateSocketEventBuffer", nullptr}, + {0x4e4d4f2a, "SystemNative_SetIPv6Address", nullptr}, + {0x4f6011da, "SystemNative_GetPort", nullptr}, + {0x4f6c3726, "SystemNative_FcntlGetIsNonBlocking", nullptr}, + {0x50309413, "SystemNative_GetPeerUserName", nullptr}, + {0x50e88639, "CryptoNative_HmacUpdate", nullptr}, + {0x514e739b, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, + {0x52590509, "AndroidCryptoNative_Aes128Cbc", nullptr}, + {0x526c9f90, "SystemNative_GetNumRoutes", nullptr}, + {0x52896a81, "SystemNative_ChMod", nullptr}, + {0x5600bd0d, "AndroidCryptoNative_SSLStreamCreate", nullptr}, + {0x561fb6ff, "SystemNative_FStat", nullptr}, + {0x56993aa9, "SystemNative_SetKeypadXmit", nullptr}, + {0x57bdcc46, "SystemNative_Open", nullptr}, + {0x581adfc6, "SystemNative_GetSignalForBreak", nullptr}, + {0x5906e1ba, "SystemNative_Close", nullptr}, + {0x591c5746, "AndroidCryptoNative_EcKeyUpRef", nullptr}, + {0x59840533, "AndroidCryptoNative_X509Decode", nullptr}, + {0x5989ad17, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, + {0x599921d3, "SystemNative_SysConf", nullptr}, + {0x59b67f4d, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, + {0x59e712d5, "SystemNative_MkdTemp", nullptr}, + {0x5a492732, "SystemNative_FcntlSetFD", nullptr}, + {0x5ccc38dd, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, + {0x5e9ef1a2, "SystemNative_GetAtOutOfBandMark", nullptr}, + {0x5eb4f827, "SystemNative_LockFileRegion", nullptr}, + {0x5ed67634, "SystemNative_GetPwUidR", nullptr}, + {0x5f706f52, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, + {0x5fc58bed, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, + {0x60571eb9, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, + {0x6068baa0, "AndroidCryptoNative_GetRsaParameters", nullptr}, + {0x608ee1a5, "SystemNative_Calloc", nullptr}, + {0x60c353e5, "SystemNative_SetPosixSignalHandler", nullptr}, + {0x613c0080, "AndroidCryptoNative_Aes192Ccm", nullptr}, + {0x626db703, "SystemNative_LStat", nullptr}, + {0x6288dd9a, "SystemNative_SetSignalForBreak", nullptr}, + {0x62a36e75, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, + {0x639b2b1d, "AndroidCryptoNative_DsaVerify", nullptr}, + {0x6436999d, "AndroidCryptoNative_SSLStreamRead", nullptr}, + {0x6441bc65, "CryptoNative_EvpSha256", nullptr}, + {0x64f12e5b, "BrotliDecoderIsFinished", nullptr}, + {0x661c5218, "SystemNative_GetDomainName", nullptr}, + {0x6661a841, "BrotliDecoderDecompressStream", nullptr}, + {0x674bdf7f, "SystemNative_DisablePosixSignalHandling", nullptr}, + {0x679dd832, "SystemNative_SetPort", nullptr}, + {0x679f9b4e, "SystemNative_FcntlGetPipeSz", nullptr}, + {0x67de0842, "SystemNative_Dup", nullptr}, + {0x687726ff, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, + {0x68bdc398, "SystemNative_INotifyAddWatch", nullptr}, + {0x68c949a0, "AndroidCryptoNative_X509GetContentType", nullptr}, + {0x68f9f52f, "AndroidCryptoNative_CipherIsSupported", nullptr}, + {0x6907c8eb, "BrotliEncoderSetParameter", nullptr}, + {0x6adb646e, "SystemNative_ReadDirR", nullptr}, + {0x6b5343a0, "SystemNative_SetErrNo", nullptr}, + {0x6bbd3d10, "SystemNative_GetRLimit", nullptr}, + {0x6be1e33d, "SystemNative_EnumerateInterfaceAddresses", nullptr}, + {0x6cda2cf8, "SystemNative_SetSendTimeout", nullptr}, + {0x6d48392a, "SystemNative_Stat", nullptr}, + {0x6ece5fe6, "SystemNative_GetPid", nullptr}, + {0x6ef4e421, "AndroidCryptoNative_CipherDestroy", nullptr}, + {0x6f695cb8, "SystemNative_RmDir", nullptr}, + {0x6fa886b1, "SystemNative_GetSockName", nullptr}, + {0x708e7911, "SystemNative_SetIPv4Address", nullptr}, + {0x70d4f7e6, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, + {0x70e91ddd, "SystemNative_FChMod", nullptr}, + {0x71698a7f, "SystemNative_GetDomainSocketSizes", nullptr}, + {0x7243c4b4, "AndroidCryptoNative_Des3Cfb8", nullptr}, + {0x759f5b1e, "AndroidCryptoNative_Aes256Cfb8", nullptr}, + {0x75b11f61, "BrotliDecoderGetErrorCode", nullptr}, + {0x76e97b2e, "SystemNative_Rename", nullptr}, + {0x77cb373b, "SystemNative_GetIPSocketAddressSizes", nullptr}, + {0x78c1eb52, "AndroidCryptoNative_Des3Ecb", nullptr}, + {0x7a0529c1, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, + {0x7ad3b820, "AndroidCryptoNative_Aes192Cfb128", nullptr}, + {0x7cb19137, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, + {0x7d0c477d, "CryptoNative_ErrPeekLastError", nullptr}, + {0x7d2bb98a, "SystemNative_MksTemps", nullptr}, + {0x7de70253, "SystemNative_ConvertErrorPalToPlatform", nullptr}, + {0x7e882ae5, "BrotliEncoderIsFinished", nullptr}, + {0x7f5d9e25, "SystemNative_MUnmap", nullptr}, + {0x80deced4, "SystemNative_CreateAutoreleasePool", nullptr}, + {0x81a5efac, "SystemNative_SetEUid", nullptr}, + {0x82484cbf, "CryptoNative_EvpDigestOneShot", nullptr}, + {0x8289a6f7, "BrotliDefaultFreeFunc", nullptr}, + {0x83dad9bf, "SystemNative_Pipe", nullptr}, + {0x83db1b72, "CryptoNative_EvpDigestCurrent", nullptr}, + {0x84662605, "CompressionNative_Deflate", nullptr}, + {0x8526c9e8, "SystemNative_SetRawSockOpt", nullptr}, + {0x8574b133, "AndroidCryptoNative_Aes192Ecb", nullptr}, + {0x88a7558d, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, + {0x8bdaf06c, "SystemNative_GetWindowSize", nullptr}, + {0x8bfcd7ba, "CompressionNative_Inflate", nullptr}, + {0x8d38b733, "SystemNative_LSeek", nullptr}, + {0x8f4e59f1, "SystemNative_ReadStdin", nullptr}, + {0x909e12ee, "SystemNative_SearchPath", nullptr}, + {0x910b7740, "SystemNative_GetFormatInfoForMountPoint", nullptr}, + {0x913a3d68, "SystemNative_GetDeviceIdentifiers", nullptr}, + {0x9216d936, "SystemNative_GetGroupName", nullptr}, + {0x94477030, "AndroidCryptoNative_Aes256Ccm", nullptr}, + {0x95e99740, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, + {0x960d4fc0, "SystemNative_GetDefaultTimeZone", nullptr}, + {0x966f54af, "CryptoNative_EvpSha384", nullptr}, + {0x9787b4b4, "CryptoNative_EvpMdSize", nullptr}, + {0x98105435, "SystemNative_GetIPv6Address", nullptr}, + {0x984edaf1, "AndroidCryptoNative_RsaDestroy", nullptr}, + {0x9852b0fa, "SystemNative_INotifyRemoveWatch", nullptr}, + {0x98954db8, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, + {0x98ca7f1c, "SystemNative_ChDir", nullptr}, + {0x990163b4, "SystemNative_Receive", nullptr}, + {0x996952b3, "AndroidCryptoNative_CipherFinalEx", nullptr}, + {0x9a005080, "SystemNative_Bind", nullptr}, + {0x9a84ffd3, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, + {0x9abfce84, "SystemNative_GetEnviron", nullptr}, + {0x9bda7eb1, "SystemNative_ReadProcessStatusInfo", nullptr}, + {0x9cd6cae8, "AndroidCryptoNative_SSLStreamRelease", nullptr}, + {0x9d102d58, "CompressionNative_InflateEnd", nullptr}, + {0x9d7f4af6, "SystemNative_ReceiveMessage", nullptr}, + {0x9dc3baed, "SystemNative_LowLevelMonitor_Destroy", nullptr}, + {0x9e366e9c, "SystemNative_InterfaceNameToIndex", nullptr}, + {0x9e717f20, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, + {0x9f47b32d, "SystemNative_ShmOpen", nullptr}, + {0xa0db1858, "SystemNative_GetEnv", nullptr}, + {0xa1295a9f, "SystemNative_MkFifo", nullptr}, + {0xa1bec9da, "SystemNative_LogError", nullptr}, + {0xa1d774fc, "BrotliEncoderHasMoreOutput", nullptr}, + {0xa2430b33, "SystemNative_SearchPath_TempDirectory", nullptr}, + {0xa25daa0e, "BrotliSetDictionaryData", nullptr}, + {0xa2d2f390, "SystemNative_TryChangeSocketEventRegistration", nullptr}, + {0xa4636764, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, + {0xa477c74e, "SystemNative_TryGetIPPacketInformation", nullptr}, + {0xa635da0f, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, + {0xa691d151, "AndroidCryptoNative_Aes192Cbc", nullptr}, + {0xa72ce322, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, + {0xa826eabe, "SystemNative_FcntlSetIsNonBlocking", nullptr}, + {0xa829138a, "SystemNative_GetProcessPath", nullptr}, + {0xa8701bcf, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, + {0xa8da7ba1, "BrotliEncoderVersion", nullptr}, + {0xa936bc40, "AndroidCryptoNative_EcDsaSize", nullptr}, + {0xa9c29be5, "SystemNative_SetIPv6MulticastOption", nullptr}, + {0xa9c84a4a, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, + {0xaa2f32ad, "SystemNative_FTruncate", nullptr}, + {0xab37a684, "CryptoNative_HmacCreate", nullptr}, + {0xab3d1641, "AndroidCryptoNative_DesEcb", nullptr}, + {0xabe6739f, "BrotliGetDictionary", nullptr}, + {0xacc26fa4, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, + {0xacc28460, "SystemNative_GetProcAddress", nullptr}, + {0xad7fbde5, "SystemNative_FUTimens", nullptr}, + {0xae443204, "SystemNative_GetSockOpt", nullptr}, + {0xae449ad1, "BrotliDecoderIsUsed", nullptr}, + {0xafb02e71, "BrotliEncoderMaxCompressedSize", nullptr}, + {0xb01e9c27, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, + {0xb030a893, "SystemNative_LowLevelMonitor_Acquire", nullptr}, + {0xb0e270a0, "BrotliEncoderDestroyInstance", nullptr}, + {0xb22a12be, "BrotliEncoderCreateInstance", nullptr}, + {0xb26f05b6, "SystemNative_PWrite", nullptr}, + {0xb2965ccd, "CryptoNative_GetMaxMdSize", nullptr}, + {0xb2985645, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, + {0xb4110b14, "AndroidCryptoNative_DsaGenerateKey", nullptr}, + {0xb427959c, "SystemNative_FLock", nullptr}, + {0xb439ebdb, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, + {0xb444f04a, "SystemNative_Accept", nullptr}, + {0xb448a24a, "SystemNative_SymLink", nullptr}, + {0xb4e5c37d, "SystemNative_UTimensat", nullptr}, + {0xb5a5754a, "SystemNative_UninitializeConsoleAfterRead", nullptr}, + {0xb5db6a51, "SystemNative_PWriteV", nullptr}, + {0xb628f475, "SystemNative_GetBytesAvailable", nullptr}, + {0xb7041ffa, "SystemNative_GetControlCharacters", nullptr}, + {0xb7cc3cd1, "AndroidCryptoNative_DesCbc", nullptr}, + {0xb80f233c, "SystemNative_FSync", nullptr}, + {0xb84914f1, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, + {0xb862b34e, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, + {0xb884b933, "SystemNative_StdinReady", nullptr}, + {0xb96c2133, "SystemNative_GetErrNo", nullptr}, + {0xb97add7d, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, + {0xb9e6cb2c, "SystemNative_RealPath", nullptr}, + {0xba284ef4, "CryptoNative_EvpSha1", nullptr}, + {0xbb06f5e1, "AndroidCryptoNative_Aes192Gcm", nullptr}, + {0xbb25ff40, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, + {0xbb2ca4f3, "SystemNative_Link", nullptr}, + {0xbb92466f, "SystemNative_AlignedAlloc", nullptr}, + {0xbd658356, "CryptoNative_ErrErrorStringN", nullptr}, + {0xbdbf2140, "SystemNative_SchedGetAffinity", nullptr}, + {0xbec8a3f2, "SystemNative_FChflags", nullptr}, + {0xbf4eeb78, "AndroidCryptoNative_GetBigNumBytes", nullptr}, + {0xbf9766c3, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, + {0xbfa0ce53, "SystemNative_GetPlatformSignalNumber", nullptr}, + {0xbfaad12d, "BrotliDecoderSetParameter", nullptr}, + {0xc090b1d3, "CryptoNative_EvpSha512", nullptr}, + {0xc0d66913, "SystemNative_GetUnixVersion", nullptr}, + {0xc11dec94, "SystemNative_FAllocate", nullptr}, + {0xc1243135, "AndroidCryptoNative_Aes128Gcm", nullptr}, + {0xc1e4e6f6, "AndroidCryptoNative_BigNumToBinary", nullptr}, + {0xc25ffc33, "BrotliEncoderCompressStream", nullptr}, + {0xc3812682, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, + {0xc3dcc3a0, "AndroidCryptoNative_SetRsaParameters", nullptr}, + {0xc3e6ff56, "SystemNative_LowLevelMonitor_Create", nullptr}, + {0xc475f41c, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, + {0xc4ac1723, "AndroidCryptoNative_Aes256Cbc", nullptr}, + {0xc55548f2, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, + {0xc57b40fa, "SystemNative_LoadLibrary", nullptr}, + {0xc6d5929c, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, + {0xc6f2fb9e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, + {0xc717b16e, "CryptoNative_EvpMdCtxDestroy", nullptr}, + {0xc746b70c, "AndroidCryptoNative_DsaSign", nullptr}, + {0xc7f0668d, "CompressionNative_DeflateReset", nullptr}, + {0xc83527e0, "CryptoNative_HmacReset", nullptr}, + {0xc89ccd22, "SystemNative_SchedGetCpu", nullptr}, + {0xc8cce896, "SystemNative_GetSocketType", nullptr}, + {0xc8e06b20, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, + {0xc9b017c8, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, + {0xca5aab33, "SystemNative_Sync", nullptr}, + {0xcb458400, "CryptoNative_ErrGetErrorAlloc", nullptr}, + {0xcb746e5c, "SystemNative_SetIPv4MulticastOption", nullptr}, + {0xcb85cd8e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, + {0xccc0dd15, "SystemNative_RegisterForSigChld", nullptr}, + {0xcdfb627d, "SystemNative_FreeLibrary", nullptr}, + {0xce91e293, "SystemNative_GetGroupList", nullptr}, + {0xcf9bcc75, "AndroidCryptoNative_Aes256Gcm", nullptr}, + {0xcfa9e6f1, "AndroidCryptoNative_GetDsaParameters", nullptr}, + {0xcff9b341, "SystemNative_GetSystemTimeAsTicks", nullptr}, + {0xd199e841, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, + {0xd24d4849, "SystemNative_Socket", nullptr}, + {0xd298c3b3, "SystemNative_Write", nullptr}, + {0xd378ba49, "CryptoNative_EvpMd5", nullptr}, + {0xd473c64c, "SystemNative_SetReceiveTimeout", nullptr}, + {0xd4b91180, "SystemNative_ForkAndExecProcess", nullptr}, + {0xd6d7b4fb, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, + {0xd71d8c66, "AndroidCryptoNative_Aes256Ecb", nullptr}, + {0xd7ee326b, "AndroidCryptoNative_EcKeyDestroy", nullptr}, + {0xd818a523, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, + {0xd9458396, "BrotliDecoderCreateInstance", nullptr}, + {0xdaaa19b2, "SystemNative_GetAllMountPoints", nullptr}, + {0xdac67152, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, + {0xdad29aeb, "AndroidCryptoNative_CipherUpdate", nullptr}, + {0xdaf0460a, "SystemNative_SendFile", nullptr}, + {0xdbbf4917, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, + {0xdbdce4ef, "BrotliDefaultAllocFunc", nullptr}, + {0xdbe13a57, "SystemNative_GetCpuUtilization", nullptr}, + {0xdc3cbeec, "CryptoNative_HmacOneShot", nullptr}, + {0xdcaddb21, "AndroidCryptoNative_GetECKeyParameters", nullptr}, + {0xdd274c15, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, + {0xdd445632, "AndroidCryptoNative_X509ChainValidate", nullptr}, + {0xddd58443, "SystemNative_PReadV", nullptr}, + {0xdea9b9dc, "SystemNative_EnablePosixSignalHandling", nullptr}, + {0xdf4f1977, "AndroidCryptoNative_X509PublicKey", nullptr}, + {0xdf80df75, "SystemNative_iOSSupportVersion", nullptr}, + {0xe121bac7, "SystemNative_GetPeerID", nullptr}, + {0xe169faa6, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, + {0xe1b8b44f, "SystemNative_Send", nullptr}, + {0xe2a0d0de, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, + {0xe4a78efb, "SystemNative_SetPriority", nullptr}, + {0xe4dba4f6, "SystemNative_GetCwd", nullptr}, + {0xe4f87d25, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, + {0xe50c82b4, "SystemNative_CreateThread", nullptr}, + {0xe58ed8fe, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, + {0xe5ef37b3, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, + {0xe770cb3f, "SystemNative_CopyFile", nullptr}, + {0xe7a9a106, "CompressionNative_InflateInit2_", nullptr}, + {0xe7bd8dd1, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, + {0xe890cf58, "AndroidCryptoNative_EcDsaSign", nullptr}, + {0xe8b2ec8d, "BrotliDecoderErrorString", nullptr}, + {0xe972fbd9, "SystemNative_GetEGid", nullptr}, + {0xea86f52f, "BrotliEncoderTakeOutput", nullptr}, + {0xeb0d0522, "SystemNative_LowLevelMonitor_Wait", nullptr}, + {0xebacbf92, "AndroidCryptoNative_Aes128Cfb8", nullptr}, + {0xec31140d, "BrotliDecoderHasMoreOutput", nullptr}, + {0xec51a1b4, "SystemNative_LChflags", nullptr}, + {0xed6cc182, "CryptoNative_EvpMdCtxCreate", nullptr}, + {0xee74a5ad, "AndroidCryptoNative_DsaSizeP", nullptr}, + {0xef48c2eb, "CryptoNative_EvpDigestReset", nullptr}, + {0xef5890c7, "AndroidCryptoNative_Des3Cbc", nullptr}, + {0xefb38c9f, "SystemNative_Poll", nullptr}, + {0xefd277f7, "CryptoNative_HmacFinal", nullptr}, + {0xf06b440b, "AndroidCryptoNative_DsaSizeSignature", nullptr}, + {0xf0919525, "AndroidCryptoNative_CipherReset", nullptr}, + {0xf0e499c4, "SystemNative_PRead", nullptr}, + {0xf1bb5b47, "SystemNative_ReadLink", nullptr}, + {0xf23e6314, "AndroidCryptoNative_RsaCreate", nullptr}, + {0xf2a49cf0, "SystemNative_CloseSocketEventPort", nullptr}, + {0xf39b1c3a, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, + {0xf3b9c879, "AndroidCryptoNative_X509Encode", nullptr}, + {0xf432ab33, "SystemNative_CloseDir", nullptr}, + {0xf4a5a1c8, "SystemNative_SysLog", nullptr}, + {0xf500c9d3, "SystemNative_GetActiveUdpListeners", nullptr}, + {0xf57828fb, "SystemNative_IsATty", nullptr}, + {0xf6141499, "AndroidCryptoNative_X509ChainBuild", nullptr}, + {0xf629d20f, "SystemNative_Shutdown", nullptr}, + {0xf6b01c6b, "SystemNative_FreeEnviron", nullptr}, + {0xf6bfedad, "SystemNative_ReadEvents", nullptr}, + {0xf91cf365, "AndroidCryptoNative_Aes128Ccm", nullptr}, + {0xf94a4828, "SystemNative_GetEUid", nullptr}, + {0xf993f426, "SystemNative_Free", nullptr}, + {0xfa97914b, "SystemNative_MMap", nullptr}, + {0xfad61722, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, + {0xfb89157f, "SystemNative_GetGroups", nullptr}, + {0xfc83423c, "SystemNative_GetRawSockOpt", nullptr}, + {0xfe2f2c47, "SystemNative_DrainAutoreleasePool", nullptr}, + {0xfeb6c5c7, "SystemNative_WaitPidExitedNoHang", nullptr}, + {0xff3b4cfa, "SystemNative_GetFileSystemType", nullptr}, + {0xff975200, "SystemNative_Realloc", nullptr}, +}; +>>>>>>> 13ba4b152 (Let's see what breaks) constexpr hash_t java_interop_library_hash = 0x6e36e350; constexpr hash_t xa_internal_api_library_hash = 0x13c9bd62; constexpr hash_t system_native_library_hash = 0x5b9ade60; constexpr hash_t system_io_compression_native_library_hash = 0xafe3142c; constexpr hash_t system_security_cryptography_native_android_library_hash = 0x93625cd; +<<<<<<< HEAD constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a; #endif constexpr size_t internal_pinvokes_count = 47; constexpr size_t dotnet_pinvokes_count = 477; } // end of anonymous namespace +======= +#endif + +constexpr size_t internal_pinvokes_count = 49; +constexpr size_t dotnet_pinvokes_count = 428; +>>>>>>> 13ba4b152 (Let's see what breaks) diff --git a/src/native/pinvoke-override/precompiled.cc b/src/native/pinvoke-override/precompiled.cc index 1c84095080a..f8a48dc8e33 100644 --- a/src/native/pinvoke-override/precompiled.cc +++ b/src/native/pinvoke-override/precompiled.cc @@ -19,7 +19,11 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); if (library_name_hash == java_interop_library_hash || library_name_hash == xa_internal_api_library_hash) { +<<<<<<< HEAD PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes.data (), internal_pinvokes_count); +======= + PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes, internal_pinvokes_count); +>>>>>>> 13ba4b152 (Let's see what breaks) if (entry == nullptr) [[unlikely]] { log_fatal (LOG_ASSEMBLY, "Internal p/invoke symbol '%s @ %s' (hash: 0x%zx) not found in compile-time map.", library_name, entrypoint_name, entrypoint_hash); @@ -52,14 +56,21 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha dotnet_dso_handle = &system_security_cryptography_native_android_library_handle; } else if (library_name_hash == system_io_compression_native_library_hash) { dotnet_dso_handle = &system_io_compression_native_library_handle; +<<<<<<< HEAD } else if (library_name_hash == system_globalization_native_library_hash) { dotnet_dso_handle = &system_globalization_native_library_handle; +======= +>>>>>>> 13ba4b152 (Let's see what breaks) } else { dotnet_dso_handle = nullptr; } if (dotnet_dso_handle != nullptr) { +<<<<<<< HEAD PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes.data (), dotnet_pinvokes_count); +======= + PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes, dotnet_pinvokes_count); +>>>>>>> 13ba4b152 (Let's see what breaks) if (entry != nullptr) { if (entry->func != nullptr) { return entry->func; diff --git a/src/native/runtime-base/internal-pinvokes.hh b/src/native/runtime-base/internal-pinvokes.hh index a386f785d72..c3ad0e9cc3f 100644 --- a/src/native/runtime-base/internal-pinvokes.hh +++ b/src/native/runtime-base/internal-pinvokes.hh @@ -4,7 +4,6 @@ #include #include -<<<<<<< HEAD #include #include @@ -15,14 +14,16 @@ int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); -======= + #include #include "log_types.hh" +#include "timing.hh" +#include "xamarin-app.hh" +#include "xamarin_getifaddrs.h" -// int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); -// void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); ->>>>>>> c594b73b0 (Prepare for new p/invoke code, step #3) +int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); +void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); mono_bool _monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up); mono_bool _monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast); @@ -48,13 +49,8 @@ void monodroid_clear_gdb_wait (); void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v); void* _monodroid_timezone_get_default_id (); void _monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args); -<<<<<<< HEAD xamarin::android::managed_timing_sequence* monodroid_timing_start (const char *message); void monodroid_timing_stop (xamarin::android::managed_timing_sequence *sequence, const char *message); -======= -//managed_timing_sequence* monodroid_timing_start (const char *message); -//void monodroid_timing_stop (managed_timing_sequence *sequence, const char *message) ->>>>>>> c594b73b0 (Prepare for new p/invoke code, step #3) char** monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens); void monodroid_strfreev (char **str_array); char* monodroid_strdup_printf (const char *format, ...); @@ -71,11 +67,7 @@ void monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports); int monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path); void* monodroid_get_dylib (); const char* _monodroid_lookup_replacement_type (const char *jniSimpleReference); -<<<<<<< HEAD const JniRemappingReplacementMethod* _monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature); void monodroid_log_traces (uint32_t kind, const char *first_line); void _monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit); -======= -// const JniRemappingReplacementMethod* _monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature); -void monodroid_log_traces (uint32_t kind, const char *first_line); ->>>>>>> c594b73b0 (Prepare for new p/invoke code, step #3) + From 6177204591dce0d5f693150006ddc7c3aaa6871b Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 16 Jul 2024 17:30:46 +0200 Subject: [PATCH 14/53] Update the list of p/invokes, slight generated code changes --- .../pinvoke-override/pinvoke-override-api.hh | 7 - .../pinvoke-override/pinvoke-tables.include | 1492 ++++++++++++++--- src/native/pinvoke-override/precompiled.cc | 13 + 3 files changed, 1304 insertions(+), 208 deletions(-) diff --git a/src/native/pinvoke-override/pinvoke-override-api.hh b/src/native/pinvoke-override/pinvoke-override-api.hh index 61db13d7221..445f8cccf0b 100644 --- a/src/native/pinvoke-override/pinvoke-override-api.hh +++ b/src/native/pinvoke-override/pinvoke-override-api.hh @@ -78,21 +78,14 @@ namespace xamarin::android { static void* monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name); private: -<<<<<<< HEAD static xamarin::android::mutex pinvoke_map_write_lock; -======= - static std::mutex pinvoke_map_write_lock; ->>>>>>> 13ba4b152 (Let's see what breaks) static pinvoke_library_map other_pinvoke_map; #if defined(PRECOMPILED) static inline void *system_native_library_handle = nullptr; static inline void *system_security_cryptography_native_android_library_handle = nullptr; static inline void *system_io_compression_native_library_handle = nullptr; -<<<<<<< HEAD static inline void *system_globalization_native_library_handle = nullptr; -======= ->>>>>>> 13ba4b152 (Let's see what breaks) #endif }; } diff --git a/src/native/pinvoke-override/pinvoke-tables.include b/src/native/pinvoke-override/pinvoke-tables.include index c915b184ef5..d8b99f5946e 100644 --- a/src/native/pinvoke-override/pinvoke-tables.include +++ b/src/native/pinvoke-override/pinvoke-tables.include @@ -5,6 +5,7 @@ // A compiler with support for C++20 ranges is required // +<<<<<<< HEAD <<<<<<< HEAD #include #include @@ -544,9 +545,14 @@ namespace { }}; ======= +======= +#include +>>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) #include +namespace { #if INTPTR_MAX == INT64_MAX +<<<<<<< HEAD //64-bit internal p/invoke table static PinvokeEntry internal_pinvokes[] = { {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, @@ -1031,210 +1037,747 @@ static PinvokeEntry dotnet_pinvokes[] = { {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, }; >>>>>>> 13ba4b152 (Let's see what breaks) - -constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; -constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; -constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; -constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; -constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; -<<<<<<< HEAD -constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; -#else - //32-bit internal p/invoke table - std::array internal_pinvokes {{ - {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, - {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, - {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, - {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, - {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, - {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, - {0x395808e5, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, - {0x42b41fe4, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, - {0x434ad3e4, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, - {0x4b58e0da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, - {0x501befde, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, - {0x501ebdc2, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, - {0x7a6909a0, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, - {0x7c94dbf5, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, - {0x8f6837ec, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, - {0x9070e02c, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, - {0x910452d0, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, - {0x934790b1, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, - {0x9a734f16, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, - {0x9b7b9290, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, - {0x9c5b24a8, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, - {0xa04e5d1c, "monodroid_free", reinterpret_cast(&monodroid_free)}, - {0xa11d71da, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, - {0xa7ea4a5f, "path_combine", reinterpret_cast(&path_combine)}, - {0xad511c82, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, - {0xb02468aa, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, - {0xbe8d7701, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, - {0xc0d097a7, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, - {0xc439b5d7, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, - {0xc5146c54, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, - {0xc58eafa5, "java_interop_free", reinterpret_cast(&java_interop_free)}, - {0xd3b5d2c1, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, - {0xd78c749d, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, - {0xd91f3619, "create_public_directory", reinterpret_cast(&create_public_directory)}, - {0xe215a17c, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, - {0xe4c3ee19, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, - {0xe7e77ca5, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, - {0xea2184e3, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, - {0xf4079b4a, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, - {0xf5a0ac55, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, - {0xf61941c3, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, - {0xf6ca4b3b, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, - {0xfa1832a6, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, - {0xfa4e32ca, "monodroid_log", reinterpret_cast(&monodroid_log)}, - {0xfdc3ae2a, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, +======= + //64-bit internal p/invoke table + std::array internal_pinvokes {{ + {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, + {0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, + {0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, + {0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, + {0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, + {0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, + {0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, + {0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, + {0x3c5532ecdab53f89, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, + {0x423c8f539a2c56d2, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, + {0x4b1956138764939a, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, + {0x4d5b5b488f736058, "path_combine", reinterpret_cast(&path_combine)}, + {0x5a2614d15e2fdc2e, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, + {0x5f0b4e426eff086b, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, + {0x709af13cbfbe2e75, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, + {0x70ae32c9a4f1ad2c, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, + {0x70fc9bab8d56666d, "create_public_directory", reinterpret_cast(&create_public_directory)}, + {0x78514771a67ad724, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, + {0x9099a4b95e3c3a89, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, + {0x958cdb6fd9d1b67b, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, + {0xa6ec846592d99536, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, + {0xa7f58f3ee428cc6b, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, + {0xae3df96dda0143bd, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, + {0xb6222d90af401865, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, + {0xb8306f71b963cd3d, "monodroid_log", reinterpret_cast(&monodroid_log)}, + {0xbc90bafd5ff9c99e, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, + {0xbe5a300beec69c35, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, + {0xbfbb924fbe190616, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, + {0xc2a21d3f6c8ccc24, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, + {0xc5b4690e13898fa3, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, + {0xcc873ea8493d1dd5, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, + {0xce439cfbe29dec11, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, + {0xd1e121b94ea63f2e, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, + {0xd5151b00eb33d85e, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, + {0xda517ef392b6a888, "java_interop_free", reinterpret_cast(&java_interop_free)}, + {0xe27b9849b7e982cb, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, + {0xe370a0d91cd63bc0, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, + {0xe78f1161604ae672, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, + {0xe86307aac9a2631a, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, + {0xebc2c68e10075cc9, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, + {0xee83e38e479aeff1, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, + {0xf3048baf83034541, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, + {0xf41c48df6f9be476, "monodroid_free", reinterpret_cast(&monodroid_free)}, + {0xf5a918ef520db207, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, + {0xf5ed87b004005892, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, + {0xf8798f762db15bba, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, + {0xfa90326712e7e7c4, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, + {0xfdc17c4ea8335ffd, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, + {0xff010b3140f54d3f, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, }}; - //32-bit DotNet p/invoke table + //64-bit DotNet p/invoke table std::array dotnet_pinvokes {{ - {0xaf6b1c, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, - {0x1733089, "SystemNative_SetTerminalInvalidationHandler", nullptr}, - {0x1dd1f00, "AndroidCryptoNative_Aes192Cfb8", nullptr}, - {0x23a0578, "AndroidCryptoNative_NewGlobalReference", nullptr}, - {0x2f05496, "SystemNative_GetPeerName", nullptr}, - {0x3295077, "SystemNative_MapTcpState", nullptr}, - {0x3d9bc5f, "SystemNative_Unlink", nullptr}, - {0x3e12cb4, "SystemNative_INotifyInit", nullptr}, - {0x5b0fb1d, "SystemNative_InitializeConsoleBeforeRead", nullptr}, - {0x80f30b4, "BrotliDecoderTakeOutput", nullptr}, - {0x84ccf89, "SystemNative_MSync", nullptr}, - {0x8c636a2, "SystemNative_FcntlSetPipeSz", nullptr}, - {0x8de5b3d, "SystemNative_GetSid", nullptr}, - {0x92bf2d9, "AndroidCryptoNative_EcKeyGetSize", nullptr}, - {0xaa46d20, "SystemNative_SNPrintF", nullptr}, - {0xaa7c86e, "SystemNative_Exit", nullptr}, - {0xb6a80bd, "SystemNative_SetAddressFamily", nullptr}, - {0xbdd984d, "SystemNative_SetWindowSize", nullptr}, - {0xcc59904, "CryptoNative_HmacDestroy", nullptr}, - {0xd5ca844, "SystemNative_CreateSocketEventPort", nullptr}, - {0xd98d741, "SystemNative_Kill", nullptr}, - {0xdfe3e26, "SystemNative_Connectx", nullptr}, - {0xfc48476, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, - {0x10d108c9, "SystemNative_FreeHostEntry", nullptr}, - {0x1165644f, "SystemNative_GetOSArchitecture", nullptr}, - {0x11778651, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, - {0x1178ebdd, "CryptoNative_EvpDigestFinalEx", nullptr}, - {0x11a2796d, "SystemNative_GetTcpGlobalStatistics", nullptr}, - {0x11d9981e, "SystemNative_MProtect", nullptr}, - {0x12105897, "GlobalizationNative_NormalizeString", nullptr}, - {0x12b01cc9, "GlobalizationNative_IsNormalized", nullptr}, - {0x12fdf5c3, "SystemNative_ConvertErrorPlatformToPal", nullptr}, - {0x1348bf25, "AndroidCryptoNative_SSLStreamWrite", nullptr}, - {0x1376985b, "SystemNative_SetSockOpt", nullptr}, - {0x13925de2, "SystemNative_GetLingerOption", nullptr}, - {0x13f565a9, "SystemNative_GetControlMessageBufferSize", nullptr}, - {0x142a08a1, "SystemNative_PosixFAdvise", nullptr}, - {0x16d98313, "GlobalizationNative_IndexOf", nullptr}, - {0x17549123, "SystemNative_Connect", nullptr}, - {0x17a5d095, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, - {0x17b96c39, "SystemNative_FreeSocketEventBuffer", nullptr}, - {0x1904820d, "SystemNative_GetHostEntryForName", nullptr}, - {0x19b6a696, "AndroidCryptoNative_X509DecodeCollection", nullptr}, - {0x1a302b28, "SystemNative_SchedSetAffinity", nullptr}, - {0x1aa4105d, "GlobalizationNative_GetSortKey", nullptr}, - {0x1ab1248e, "SystemNative_GetHostName", nullptr}, - {0x1bf277c4, "SystemNative_WaitForSocketEvents", nullptr}, - {0x1c4778bf, "SystemNative_AlignedFree", nullptr}, - {0x1cb466df, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, - {0x1cf7b52c, "SystemNative_MAdvise", nullptr}, - {0x1eb6eaaa, "CryptoNative_GetRandomBytes", nullptr}, - {0x1ebc63c1, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, - {0x1f186646, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, - {0x1f1cd573, "AndroidCryptoNative_Des3Cfb64", nullptr}, - {0x1f998744, "AndroidCryptoNative_Aes128Cfb128", nullptr}, - {0x1fdcd1e0, "CryptoNative_ErrPeekError", nullptr}, - {0x212e38c4, "SystemNative_GetUdpGlobalStatistics", nullptr}, - {0x218fa94a, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, - {0x22011e2b, "SystemNative_SetLingerOption", nullptr}, - {0x224ebd71, "SystemNative_Listen", nullptr}, - {0x2253b591, "BrotliGetTransforms", nullptr}, - {0x226eec4d, "SystemNative_Abort", nullptr}, - {0x229f73d4, "AndroidCryptoNative_RsaUpRef", nullptr}, - {0x22bbb587, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, - {0x2304e65b, "SystemNative_SetRLimit", nullptr}, - {0x23cfcfb0, "BrotliTransformDictionaryWord", nullptr}, - {0x260a3e8d, "CompressionNative_DeflateInit2_", nullptr}, - {0x289b5430, "SystemNative_Log", nullptr}, - {0x28d95a99, "SystemNative_CanGetHiddenFlag", nullptr}, - {0x28f3db4b, "SystemNative_ShmUnlink", nullptr}, - {0x2af6aa40, "SystemNative_Access", nullptr}, - {0x2b117055, "BrotliDecoderDecompress", nullptr}, - {0x2b7293c5, "SystemNative_GetTimestamp", nullptr}, - {0x2b747a9c, "SystemNative_MkNod", nullptr}, - {0x2bc9ff5e, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, - {0x2c4415fd, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, - {0x2c467430, "AndroidCryptoNative_GetECCurveParameters", nullptr}, - {0x2d21ad97, "SystemNative_GetReadDirRBufferSize", nullptr}, - {0x2d6e4a1c, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, - {0x2e66f31b, "BrotliDecoderDestroyInstance", nullptr}, - {0x2eb28fb6, "SystemNative_GetIPv4Address", nullptr}, - {0x2f7d80dd, "GlobalizationNative_WindowsIdToIanaId", nullptr}, - {0x2ff73621, "CryptoNative_ErrReasonErrorString", nullptr}, - {0x30af09b7, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, - {0x31120969, "SystemNative_Malloc", nullptr}, - {0x3374b950, "SystemNative_GetLoadLibraryError", nullptr}, - {0x34867c2f, "SystemNative_TryGetUInt32OSThreadId", nullptr}, - {0x349c5a8f, "SystemNative_GetNetworkInterfaces", nullptr}, - {0x354aa58f, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, - {0x363c0010, "CryptoNative_EvpDigestUpdate", nullptr}, - {0x367eee31, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, - {0x38406fa3, "GlobalizationNative_ChangeCaseInvariant", nullptr}, - {0x38575bc5, "SystemNative_GetUnixRelease", nullptr}, - {0x388a31d4, "SystemNative_PathConf", nullptr}, - {0x3a238b9f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, - {0x3a861d34, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, - {0x3af56a10, "AndroidCryptoNative_RsaSize", nullptr}, - {0x3b286185, "GlobalizationNative_ChangeCaseTurkish", nullptr}, - {0x3bf3d465, "SystemNative_GetIPv6MulticastOption", nullptr}, - {0x3cb49aae, "SystemNative_GetPwNamR", nullptr}, - {0x3d150bdf, "AndroidCryptoNative_Aes128Ecb", nullptr}, - {0x3d823979, "GlobalizationNative_ToUnicode", nullptr}, - {0x3da52690, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, - {0x3de52faf, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, - {0x3df8d649, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, - {0x3e175e7c, "AndroidCryptoNative_Aes256Cfb128", nullptr}, - {0x3e273961, "SystemNative_StrErrorR", nullptr}, - {0x3e48f022, "SystemNative_GetMaximumAddressSize", nullptr}, - {0x3e778b38, "BrotliDecoderVersion", nullptr}, - {0x3ea31c40, "SystemNative_GetAddressFamily", nullptr}, - {0x3efdb5a0, "SystemNative_SendMessage", nullptr}, - {0x3f47618f, "CryptoNative_EnsureOpenSslInitialized", nullptr}, - {0x3f793993, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, - {0x40b0026c, "CompressionNative_DeflateEnd", nullptr}, - {0x40e64bdd, "CryptoNative_ErrClearError", nullptr}, - {0x413b9801, "SystemNative_Read", nullptr}, - {0x41818c1d, "SystemNative_GetPriority", nullptr}, - {0x41cf0c16, "AndroidCryptoNative_CipherCreate", nullptr}, - {0x42955366, "SystemNative_Disconnect", nullptr}, - {0x42afcfbb, "AndroidCryptoNative_CipherCreatePartial", nullptr}, - {0x430352b3, "SystemNative_GetNameInfo", nullptr}, - {0x43f6cea1, "AndroidCryptoNative_DesCfb8", nullptr}, - {0x4543d533, "AndroidCryptoNative_EcDsaVerify", nullptr}, - {0x45a00971, "GlobalizationNative_CloseSortHandle", nullptr}, - {0x45f09dca, "AndroidCryptoNative_CipherSetTagLength", nullptr}, - {0x46268e76, "GlobalizationNative_GetCalendarInfo", nullptr}, - {0x477f60cf, "SystemNative_OpenDir", nullptr}, - {0x47a82b4e, "SystemNative_AlignedRealloc", nullptr}, - {0x48c17c9b, "SystemNative_Sysctl", nullptr}, - {0x493888ee, "CompressionNative_Crc32", nullptr}, - {0x494ef6d4, "SystemNative_GetIPv4MulticastOption", nullptr}, - {0x496f1885, "SystemNative_GetSocketErrorOption", nullptr}, - {0x49c2af32, "SystemNative_GetBootTimeTicks", nullptr}, - {0x49c81782, "SystemNative_MkDir", nullptr}, - {0x49f60a0f, "GlobalizationNative_GetLocales", nullptr}, - {0x4a4ef46f, "SystemNative_FcntlGetFD", nullptr}, - {0x4a98a396, "GlobalizationNative_GetLocaleInfoInt", nullptr}, - {0x4b78d330, "CryptoNative_HmacCurrent", nullptr}, - {0x4c2eae6c, "GlobalizationNative_EnumCalendarInfo", nullptr}, - {0x4c6d50ba, "SystemNative_GetIPv4GlobalStatistics", nullptr}, - {0x4ca38207, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, - {0x4cb997ae, "BrotliEncoderCompress", nullptr}, + {0x99f2ee02463000, "CompressionNative_Crc32", nullptr}, + {0xb38afc8bfe830b, "SystemNative_Bind", nullptr}, + {0x190fe65d8736dcb, "SystemNative_TryGetIPPacketInformation", nullptr}, + {0x1c8b86562ad5772, "SystemNative_Receive", nullptr}, + {0x202543f28ecaf06, "SystemNative_Abort", nullptr}, + {0x25abeafa88904a2, "SystemNative_SetPosixSignalHandler", nullptr}, + {0x33158212a812caf, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, + {0x3511e36d0a6c1b5, "SystemNative_LockFileRegion", nullptr}, + {0x375a0e90c77ca35, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, + {0x37b9dd562235e42, "SystemNative_MSync", nullptr}, + {0x3a5df4793dd3230, "SystemNative_INotifyInit", nullptr}, + {0x3d24547fa4fc31b, "SystemNative_GetUInt64OSThreadId", nullptr}, + {0x410f8526b1edfc3, "GlobalizationNative_GetLocaleInfoInt", nullptr}, + {0x47302bd7e277183, "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", nullptr}, + {0x581df5b0a00c422, "SystemNative_SetRLimit", nullptr}, + {0x598db66ca39c41f, "AndroidCryptoNative_EcKeyUpRef", nullptr}, + {0x5b5ab451ff38f8e, "SystemNative_GetMaximumAddressSize", nullptr}, + {0x656cac62ccc9e3c, "AndroidCryptoNative_X509GetContentType", nullptr}, + {0x6861b5336291d12, "SystemNative_PathConf", nullptr}, + {0x690c4347972024f, "AndroidCryptoNative_Aes256Gcm", nullptr}, + {0x6a1f4deffa02c30, "SystemNative_LowLevelMonitor_Acquire", nullptr}, + {0x7b5579ab0499b1f, "AndroidCryptoNative_RsaSize", nullptr}, + {0x7ce8a9b967dd269, "SystemNative_Read", nullptr}, + {0x7f0e1227c9c0225, "CryptoNative_EvpMdCtxDestroy", nullptr}, + {0x8352ae4bba2b83b, "SystemNative_SetSendTimeout", nullptr}, + {0x98bd27a7461321d, "SystemNative_Dup", nullptr}, + {0x9a39fbf59eed9f9, "CryptoNative_EvpSha1", nullptr}, + {0xa4aeeaff9ca2d10, "BrotliDecoderDecompressStream", nullptr}, + {0xa906c14ca5834bc, "SystemNative_GetEUid", nullptr}, + {0xac9f9c1abb62a92, "SystemNative_Log", nullptr}, + {0xadb2441bcfcdfe9, "SystemNative_CreateThread", nullptr}, + {0xafbf5c69d1badc0, "SystemNative_SetTerminalInvalidationHandler", nullptr}, + {0xba897b7abe67b16, "SystemNative_FcntlSetPipeSz", nullptr}, + {0xc305c22ce7ab8a0, "SystemNative_SetSockOpt", nullptr}, + {0xc79e924361c15ca, "SystemNative_RealPath", nullptr}, + {0xcaba893801c6a6f, "AndroidCryptoNative_Aes256Ecb", nullptr}, + {0xcbe6d3d22131194, "AndroidCryptoNative_SetRsaParameters", nullptr}, + {0xe7e93cf9237e1f2, "GlobalizationNative_ToAscii", nullptr}, + {0xef8dd67e25bac53, "SystemNative_GetWindowSize", nullptr}, + {0xfa0899cf8d00a87, "SystemNative_MkDir", nullptr}, + {0xfe7079441ac127e, "SystemNative_CreateSocketEventPort", nullptr}, + {0x1027786cdd9a3e9c, "AndroidCryptoNative_Aes192Cbc", nullptr}, + {0x10d733abd1fd94bb, "SystemNative_TryChangeSocketEventRegistration", nullptr}, + {0x114b8384553f5418, "SystemNative_GetSystemTimeAsTicks", nullptr}, + {0x119a38c3e288a233, "SystemNative_SNPrintF_1S", nullptr}, + {0x11b6f4f0aafeda95, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, + {0x11cc73f2926d4064, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, + {0x121bc483ac26f5f8, "SystemNative_GetGroupName", nullptr}, + {0x12d65f9f65b01497, "SystemNative_GetRawSockOpt", nullptr}, + {0x12eaf09505dc19fd, "SystemNative_FStat", nullptr}, + {0x13577369f5ec4b0a, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, + {0x1399413d8a7d9dd8, "SystemNative_GetAddressFamily", nullptr}, + {0x13a1c2de7fb2519f, "SystemNative_CloseSocketEventPort", nullptr}, + {0x146cd1dc4fb2ba58, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, + {0x14b7e3527b60e83f, "CryptoNative_ErrErrorStringN", nullptr}, + {0x15bd710d3a9b3b0c, "CryptoNative_EvpDigestFinalEx", nullptr}, + {0x176e22ea7c580dae, "SystemNative_ReadDirR", nullptr}, + {0x18580a4592ed1ea6, "GlobalizationNative_GetSortKey", nullptr}, + {0x185f5d25252c3c72, "SystemNative_FAllocate", nullptr}, + {0x18d6b5e9fec9b0dc, "SystemNative_Connectx", nullptr}, + {0x18f7da5f584b5b59, "SystemNative_PReadV", nullptr}, + {0x1948a0cf88329c2f, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, + {0x1ac95b02f23933cc, "SystemNative_CanGetHiddenFlag", nullptr}, + {0x1d1bb0528d517729, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, + {0x1d4dcbc06728e689, "SystemNative_Close", nullptr}, + {0x1d6d4278ffbbab77, "SystemNative_Pipe", nullptr}, + {0x1d8d6a688fc5bfb3, "SystemNative_SendFile", nullptr}, + {0x1e6228e955989698, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, + {0x1e8edcc515cd23f9, "CryptoNative_EvpDigestOneShot", nullptr}, + {0x1f1c61a157636aad, "SystemNative_Stat", nullptr}, + {0x1f45ac9d3c6b1554, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, + {0x1f72f52873ced9c9, "GlobalizationNative_InitOrdinalCasingPage", nullptr}, + {0x1f7d2360a1cdcbff, "AndroidCryptoNative_SSLStreamCreate", nullptr}, + {0x1f849e45a3014a9f, "SystemNative_GetIPv6Address", nullptr}, + {0x1f9361fc7b624c1b, "SystemNative_LowLevelMonitor_Wait", nullptr}, + {0x205a31e661496019, "CryptoNative_ErrGetErrorAlloc", nullptr}, + {0x20784dcc7e9cee75, "BrotliGetTransforms", nullptr}, + {0x2178ba302d0c5f1c, "GlobalizationNative_GetCalendars", nullptr}, + {0x218fce505a140c55, "AndroidCryptoNative_EcDsaVerify", nullptr}, + {0x2291e0ba4e1b55b0, "SystemNative_LStat", nullptr}, + {0x23ac2a4c4d1c744e, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, + {0x24f840f903a26ded, "SystemNative_ConvertErrorPalToPlatform", nullptr}, + {0x24ff74e427d0626e, "SystemNative_GetErrNo", nullptr}, + {0x254905036a0061cf, "SystemNative_CreateSocketEventBuffer", nullptr}, + {0x255c4a2e297fd9f5, "SystemNative_INotifyAddWatch", nullptr}, + {0x267c94097a3bf1f3, "AndroidCryptoNative_CipherDestroy", nullptr}, + {0x27944922cd8283ca, "CryptoNative_EvpSha384", nullptr}, + {0x2795a01c2c64aea1, "CryptoNative_HmacReset", nullptr}, + {0x27f3d9266af2b315, "SystemNative_GetIPv4Address", nullptr}, + {0x2925953889c48cab, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, + {0x2a49948ae20571cb, "SystemNative_SchedGetAffinity", nullptr}, + {0x2b45d7cdf6e8e0c7, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, + {0x2c352dd7c367e438, "CryptoNative_EvpSha512", nullptr}, + {0x2c7e5e179cc917cb, "AndroidCryptoNative_DsaSizeSignature", nullptr}, + {0x2c8da1192c5d7d2b, "SystemNative_FLock", nullptr}, + {0x2d64b1ac218cf29e, "SystemNative_AlignedRealloc", nullptr}, + {0x2e1102c297588e10, "BrotliEncoderDestroyInstance", nullptr}, + {0x2e429d96a9fc92bd, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, + {0x2fdcf708ff792105, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, + {0x301c465c1ac0adf9, "SystemNative_MProtect", nullptr}, + {0x307db94ae9f929e5, "CryptoNative_GetMaxMdSize", nullptr}, + {0x31027564deeb71b0, "AndroidCryptoNative_Aes128Cbc", nullptr}, + {0x32e594690358a960, "GlobalizationNative_GetLocaleInfoString", nullptr}, + {0x3319a5483b3cc1fc, "SystemNative_GetRLimit", nullptr}, + {0x3424ffcb69ecef57, "SystemNative_Unlink", nullptr}, + {0x346a9bb11364833c, "SystemNative_DrainAutoreleasePool", nullptr}, + {0x35169e67cc0f8529, "SystemNative_GetIPv6MulticastOption", nullptr}, + {0x359205b4a10fa780, "SystemNative_LowLevelMonitor_Destroy", nullptr}, + {0x35c1fa8dffcbbd8c, "CryptoNative_EvpDigestReset", nullptr}, + {0x36128eed665b1923, "SystemNative_ShmUnlink", nullptr}, + {0x364dcf65ae63adff, "SystemNative_GetSocketErrorOption", nullptr}, + {0x3757b327944abb54, "SystemNative_EnablePosixSignalHandling", nullptr}, + {0x38b4bd21127ceffd, "SystemNative_StrErrorR", nullptr}, + {0x38c7de719e8ae69d, "SystemNative_RmDir", nullptr}, + {0x391bbbb9bbde4455, "SystemNative_SetIPv4MulticastOption", nullptr}, + {0x3a7245f3ea476bf7, "SystemNative_SNPrintF", nullptr}, + {0x3ae92e4198427b0d, "SystemNative_ReadLink", nullptr}, + {0x3e0de839e6cfa6e5, "SystemNative_Accept", nullptr}, + {0x3e7cf9a4789a31c7, "SystemNative_FChflags", nullptr}, + {0x3f19a16a3230b551, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, + {0x3f49b6278f04ae84, "SystemNative_Disconnect", nullptr}, + {0x3fba15600bf0f229, "SystemNative_SetEUid", nullptr}, + {0x401935ffc3454bb1, "AndroidCryptoNative_X509PublicKey", nullptr}, + {0x403e1bc0b3baba84, "CompressionNative_Inflate", nullptr}, + {0x40bfa1211f5f6f9c, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, + {0x40d61d78487edb08, "GlobalizationNative_GetICUVersion", nullptr}, + {0x41b6e7f32da99fa9, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, + {0x41c169fb0e30a390, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, + {0x41c1f2c9153639af, "SystemNative_FUTimens", nullptr}, + {0x420718c398131a55, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, + {0x42339dd2717504d9, "SystemNative_GetLingerOption", nullptr}, + {0x42783107bf2935ec, "SystemNative_FreeHostEntry", nullptr}, + {0x42eb0578a9d62b78, "SystemNative_GetFormatInfoForMountPoint", nullptr}, + {0x4360eb8a25122eee, "GlobalizationNative_StartsWith", nullptr}, + {0x43741165a5ba60d5, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, + {0x44ccb27979f980ce, "SystemNative_AlignedAlloc", nullptr}, + {0x44f1a5c46033eec2, "SystemNative_SysLog", nullptr}, + {0x469898c8d892af83, "BrotliEncoderCompress", nullptr}, + {0x483b434d7b089c7e, "SystemNative_Write", nullptr}, + {0x4845e1c76265acc9, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, + {0x484a3a445bdb14fc, "SystemNative_GetOSArchitecture", nullptr}, + {0x4909639a9d87bdb5, "SystemNative_AlignedFree", nullptr}, + {0x49e3ba95feb79c6c, "SystemNative_SetAddressFamily", nullptr}, + {0x4a7272ac9d117f2d, "AndroidCryptoNative_EcKeyDestroy", nullptr}, + {0x4b00795bbeea6f60, "SystemNative_SetIPv6Address", nullptr}, + {0x4bd4b1c0803c8c55, "GlobalizationNative_GetLocaleName", nullptr}, + {0x4be7ceca50f3298c, "SystemNative_LowLevelMonitor_Create", nullptr}, + {0x4bec4a1d7dfd4cf7, "SystemNative_GetUnixRelease", nullptr}, + {0x4bfff22801b209ca, "SystemNative_LChflags", nullptr}, + {0x4c22cc4f2b1dab26, "SystemNative_SetPriority", nullptr}, + {0x4c5d96426f92c29d, "CryptoNative_HmacUpdate", nullptr}, + {0x4d6361e5095cff36, "AndroidCryptoNative_DsaSign", nullptr}, + {0x4d74053b37e582fa, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, + {0x4f22643b9509cc12, "GlobalizationNative_IsNormalized", nullptr}, + {0x501daf7e3a890220, "AndroidCryptoNative_X509ChainBuild", nullptr}, + {0x507983f11ffec7a8, "GlobalizationNative_GetTimeZoneDisplayName", nullptr}, + {0x509ff12da4e77259, "SystemNative_GetSocketAddressSizes", nullptr}, + {0x523240c01d14ad50, "SystemNative_GetPeerID", nullptr}, + {0x52794f1118d32f08, "SystemNative_GetUnixVersion", nullptr}, + {0x52fc107ebdb6fcc7, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, + {0x5381564d2c06c0a3, "SystemNative_SysConf", nullptr}, + {0x54ec3421ab70a40a, "Java_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate", nullptr}, + {0x556bc89d2d4dfc85, "SystemNative_GetDeviceIdentifiers", nullptr}, + {0x558250d199e906bb, "CryptoNative_ErrReasonErrorString", nullptr}, + {0x5592a052ceb4caf6, "SystemNative_GetProcessPath", nullptr}, + {0x55fe2620f63d83d8, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, + {0x56e982948d00f10d, "GlobalizationNative_IndexOf", nullptr}, + {0x574d77a68ec3e488, "SystemNative_GetEnv", nullptr}, + {0x5755d1cd0c158620, "BrotliDecoderSetParameter", nullptr}, + {0x580dda20ac9e83c6, "BrotliEncoderSetParameter", nullptr}, + {0x583db0344a1cd715, "SystemNative_GetActiveUdpListeners", nullptr}, + {0x5908581fe73717f0, "SystemNative_InterfaceNameToIndex", nullptr}, + {0x5916efc3e1e49137, "CryptoNative_ErrPeekError", nullptr}, + {0x5a114024ecd1162c, "CryptoNative_EvpDigestUpdate", nullptr}, + {0x5a305cf2a314d6a6, "SystemNative_FTruncate", nullptr}, + {0x5a337d9cc7d8bcfd, "CryptoNative_HmacCurrent", nullptr}, + {0x5d503db70d17dad2, "BrotliEncoderIsFinished", nullptr}, + {0x5dd1d1d024378765, "CryptoNative_EvpMdSize", nullptr}, + {0x5e53b688fede3216, "SystemNative_GetControlCharacters", nullptr}, + {0x5fa62856bdbba9c0, "SystemNative_GetPort", nullptr}, + {0x5fd29ac523ff6e3d, "AndroidCryptoNative_SSLStreamRelease", nullptr}, + {0x5ffae3c8023a80b8, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, + {0x600b4418896f7808, "SystemNative_Exit", nullptr}, + {0x6089f0c8112eb3d9, "SystemNative_InitializeConsoleBeforeRead", nullptr}, + {0x613307e537d462db, "SystemNative_GetReadDirRBufferSize", nullptr}, + {0x61bacd7170fd8c9b, "SystemNative_SchedSetAffinity", nullptr}, + {0x61f3ce1b18b20d6f, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, + {0x62351df42d842942, "SystemNative_GetSignalForBreak", nullptr}, + {0x635327a9b09a910d, "GlobalizationNative_NormalizeString", nullptr}, + {0x6393d30aceaa6df2, "SystemNative_PWriteV", nullptr}, + {0x6448f0806bd3a338, "SystemNative_FreeEnviron", nullptr}, + {0x648a9b317bc64fe0, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, + {0x650eddee76c6b8da, "SystemNative_GetHostName", nullptr}, + {0x652badfba5d61929, "SystemNative_FcntlSetFD", nullptr}, + {0x66e049fe27bf91ea, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, + {0x6792c0a7ea5d19c9, "BrotliEncoderTakeOutput", nullptr}, + {0x67a8868ef592a3fd, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, + {0x67a9b5bbce322f8c, "AndroidCryptoNative_Des3Cbc", nullptr}, + {0x67d2cd86792b1d0c, "SystemNative_Realloc", nullptr}, + {0x67e9d60481f4be06, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, + {0x68df81a8fb5bf442, "SystemNative_GetSockOpt", nullptr}, + {0x68f3fe6083c0355b, "SystemNative_GetLoadLibraryError", nullptr}, + {0x69ad99fac0467f64, "SystemNative_Link", nullptr}, + {0x6a59d9242cd31785, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, + {0x6ac3aeecfc75bfad, "GlobalizationNative_GetSortVersion", nullptr}, + {0x6b9097385aa77917, "SystemNative_FSync", nullptr}, + {0x6b9bce16ba8e845f, "SystemNative_Malloc", nullptr}, + {0x6bc18fbbbf267e2a, "SystemNative_ReceiveSocketError", nullptr}, + {0x6d566e1f6e5a2d8f, "BrotliDefaultAllocFunc", nullptr}, + {0x6dbd90e9cc86310b, "AndroidCryptoNative_CipherFinalEx", nullptr}, + {0x6dfd40c2dd0d7382, "AndroidCryptoNative_RsaUpRef", nullptr}, + {0x6e2c1caff08e6e2d, "SystemNative_ReadStdin", nullptr}, + {0x6ee05d5e8650e56c, "SystemNative_DisablePosixSignalHandling", nullptr}, + {0x6f990f1f7bc80630, "AndroidCryptoNative_RsaCreate", nullptr}, + {0x70f907b97d3fe059, "AndroidCryptoNative_Aes192Ccm", nullptr}, + {0x7150f0eb40797bb3, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, + {0x724820d307055ed1, "CryptoNative_HmacFinal", nullptr}, + {0x729afe37cdb8ae8f, "SystemNative_Connect", nullptr}, + {0x730ae9a7469a7321, "SystemNative_GetAllMountPoints", nullptr}, + {0x7356b141407d261e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, + {0x742da00b2dbf435d, "SystemNative_LoadLibrary", nullptr}, + {0x74ec4a8d869776ad, "AndroidCryptoNative_Aes128Ccm", nullptr}, + {0x7559feb379d38da5, "SystemNative_GetTimeZoneData", nullptr}, + {0x758dfbf057da0da0, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, + {0x77ca6a148e5a51d9, "GlobalizationNative_IanaIdToWindowsId", nullptr}, + {0x7975d1d7029cf1a3, "AndroidCryptoNative_Aes128Gcm", nullptr}, + {0x79f5c24afbd04af1, "AndroidCryptoNative_Aes256Cbc", nullptr}, + {0x7a37e0d077f2dfe5, "AndroidCryptoNative_DsaGenerateKey", nullptr}, + {0x7a4d912694906c9c, "GlobalizationNative_ToUnicode", nullptr}, + {0x7af1f52a7a632e95, "BrotliDecoderTakeOutput", nullptr}, + {0x7d5273ad530e7298, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, + {0x7d7ee4bce74d4de9, "SystemNative_GetDomainSocketSizes", nullptr}, + {0x7e1766c6df3ad261, "SystemNative_MUnmap", nullptr}, + {0x7e4bdf46d4ff9f11, "SystemNative_MkNod", nullptr}, + {0x7e5fa2f70891c7fe, "GlobalizationNative_ChangeCaseTurkish", nullptr}, + {0x7ec328b6ba9eab8a, "SystemNative_WaitForSocketEvents", nullptr}, + {0x7fa96d0284954375, "AndroidCryptoNative_X509Decode", nullptr}, + {0x80ef5040fdcc248d, "BrotliEncoderMaxCompressedSize", nullptr}, + {0x813bedf08c3388d4, "AndroidCryptoNative_Aes128Cfb8", nullptr}, + {0x84c8a7489b37fea0, "SystemNative_GetPlatformSignalNumber", nullptr}, + {0x84cc0301870c37ce, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, + {0x8502eeba98158e79, "SystemNative_FcntlSetIsNonBlocking", nullptr}, + {0x8530d37777969db6, "SystemNative_SetKeypadXmit", nullptr}, + {0x85d0033bc38bb4bb, "SystemNative_MAdvise", nullptr}, + {0x868e09dc7dfea364, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, + {0x870191ad244b8069, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, + {0x87019b7831c0c34c, "AndroidCryptoNative_Aes192Gcm", nullptr}, + {0x87c447e7f873cff0, "AndroidCryptoNative_X509ChainValidate", nullptr}, + {0x889350f209555ecb, "SystemNative_MkdTemp", nullptr}, + {0x88a08b60b80c70cc, "SystemNative_FChMod", nullptr}, + {0x88cfeefc903f9d60, "CryptoNative_EvpDigestCurrent", nullptr}, + {0x8bcabce135063bed, "SystemNative_OpenDir", nullptr}, + {0x8df448aee6e8fa5e, "SystemNative_WaitPidExitedNoHang", nullptr}, + {0x8e96cb02418947cc, "SystemNative_FcntlGetPipeSz", nullptr}, + {0x8fb6ed14ee0256bc, "SystemNative_GetTimestamp", nullptr}, + {0x8ffe2d950d138c01, "SystemNative_SchedGetCpu", nullptr}, + {0x9039632237d70ae7, "AndroidCryptoNative_NewGlobalReference", nullptr}, + {0x9161ade1206fd86e, "AndroidCryptoNative_Aes256Cfb128", nullptr}, + {0x9167a072639a7c95, "AndroidCryptoNative_Aes256Ccm", nullptr}, + {0x91f065ec0d3aec55, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, + {0x93a8bec488055608, "SystemNative_GetPwNamR", nullptr}, + {0x95a0e2fc5c0cb49e, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, + {0x95a4cb8563cc6b14, "SystemNative_ShmOpen", nullptr}, + {0x9856fa59ed936b73, "SystemNative_GetSid", nullptr}, + {0x996ada1c038aabba, "SystemNative_MksTemps", nullptr}, + {0x9991a277809ef205, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, + {0x99a840c495204202, "SystemNative_GetBytesAvailable", nullptr}, + {0x99e3660fc483d7be, "CryptoNative_GetRandomBytes", nullptr}, + {0x9aa9eaee3dd8b23b, "SystemNative_GetIPv4MulticastOption", nullptr}, + {0x9aaaad33b28af82f, "SystemNative_SetSignalForBreak", nullptr}, + {0x9aab07f824659d3e, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, + {0x9c3e8b890033819a, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, + {0x9c832cd7fcbf2de0, "SystemNative_MkFifo", nullptr}, + {0x9d2cb31282abd3d9, "SystemNative_GetNetworkInterfaces", nullptr}, + {0x9e25ebf4f61cc299, "SystemNative_ChDir", nullptr}, + {0x9e79166979634030, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, + {0x9edddf30d660eff4, "AndroidCryptoNative_Aes192Ecb", nullptr}, + {0x9fb01da1222e905a, "SystemNative_IsATty", nullptr}, + {0xa193402ff5140ac1, "GlobalizationNative_GetCalendarInfo", nullptr}, + {0xa1e881a63614507e, "SystemNative_INotifyRemoveWatch", nullptr}, + {0xa2254fea4d8b6909, "SystemNative_MMap", nullptr}, + {0xa272b5349013d9ef, "CryptoNative_EvpSha256", nullptr}, + {0xa2d7790a850024c0, "SystemNative_GetNumRoutes", nullptr}, + {0xa302613a430248b8, "SystemNative_GetGroups", nullptr}, + {0xa308025a784497df, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, + {0xa56532a23755cd87, "SystemNative_StdinReady", nullptr}, + {0xa56954e28eb9a9c9, "AndroidCryptoNative_Des3Cfb8", nullptr}, + {0xa57e18f82abd5958, "BrotliDecoderDestroyInstance", nullptr}, + {0xa5eda72b95fe78c3, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, + {0xa831a683f743e417, "GlobalizationNative_WindowsIdToIanaId", nullptr}, + {0xa89b70c38d3ba079, "CryptoNative_HmacCreate", nullptr}, + {0xa89ec9958d999483, "SystemNative_GetCwd", nullptr}, + {0xa8bdc3e7ee898dfc, "SystemNative_Shutdown", nullptr}, + {0xa93eb533acf7564d, "AndroidCryptoNative_DesEcb", nullptr}, + {0xa94b1cf083978da9, "CryptoNative_EvpMdCtxCopyEx", nullptr}, + {0xa961e8db31830e16, "AndroidCryptoNative_Aes192Cfb8", nullptr}, + {0xaa8f0f87ae474ffe, "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", nullptr}, + {0xabdcf2f74d210f35, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, + {0xac11eab9d9c31b01, "SystemNative_UTimensat", nullptr}, + {0xac5c6a70d140a4bf, "GlobalizationNative_GetLocaleTimeFormat", nullptr}, + {0xac7725c652a5fb5b, "SystemNative_CopyFile", nullptr}, + {0xad1a2d6575cdd4e3, "AndroidCryptoNative_SSLStreamWrite", nullptr}, + {0xad228cdc4edb11d6, "SystemNative_CloseDir", nullptr}, + {0xadc6889903a2d6f4, "SystemNative_Rename", nullptr}, + {0xae320903718eb45d, "SystemNative_MapTcpState", nullptr}, + {0xae82e9ceae24192d, "AndroidCryptoNative_Pbkdf2", nullptr}, + {0xaf72b94c4acee897, "BrotliDecoderHasMoreOutput", nullptr}, + {0xaf9706efc72c3904, "SystemNative_SetIPv6MulticastOption", nullptr}, + {0xafd9f6338cdbadd4, "SystemNative_GetHostEntryForName", nullptr}, + {0xafe3d21bbaa71464, "CompressionNative_DeflateEnd", nullptr}, + {0xb0b66a7145de350d, "SystemNative_Access", nullptr}, + {0xb0df46ff09c57741, "AndroidCryptoNative_GetRsaParameters", nullptr}, + {0xb0e18377ed603e0b, "SystemNative_GetGroupList", nullptr}, + {0xb1c394b9992bd67d, "AndroidCryptoNative_EcDsaSign", nullptr}, + {0xb1ff12f3bd735982, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, + {0xb361006446f560e8, "SystemNative_LogError", nullptr}, + {0xb3e1e5e50cde576e, "BrotliEncoderVersion", nullptr}, + {0xb41fa43cc5c261cb, "BrotliDecoderGetErrorCode", nullptr}, + {0xb4996dd1aba38200, "AndroidCryptoNative_EcDsaSize", nullptr}, + {0xb516027cb59e6541, "BrotliDecoderIsFinished", nullptr}, + {0xb575ec01a7a79f8f, "AndroidCryptoNative_DesCfb8", nullptr}, + {0xb600c44028c1743d, "SystemNative_Socket", nullptr}, + {0xb632e9bc6f7be0a9, "SystemNative_GetSockName", nullptr}, + {0xb6540b73eff28747, "SystemNative_SetRawSockOpt", nullptr}, + {0xb66be1550d27bfb4, "AndroidCryptoNative_GetECCurveParameters", nullptr}, + {0xb69c3cc8b9f6a724, "BrotliDecoderIsUsed", nullptr}, + {0xb6ab9abf7887911f, "SystemNative_ReadEvents", nullptr}, + {0xb73c597de01bc0b2, "SystemNative_GetPwUidR", nullptr}, + {0xb78af5975603cd20, "SystemNative_Sync", nullptr}, + {0xb7bbbe2c16a565c6, "SystemNative_Calloc", nullptr}, + {0xb81236cd1fe85cc9, "GlobalizationNative_GetLatestJapaneseEra", nullptr}, + {0xb828d9e7df5437a5, "BrotliDecoderErrorString", nullptr}, + {0xb95350c7ec77bc72, "GlobalizationNative_ChangeCase", nullptr}, + {0xba2f6d298f3be8bc, "CryptoNative_EvpMd5", nullptr}, + {0xbb3343826d504870, "SystemNative_GetBootTimeTicks", nullptr}, + {0xbb5e970ecb6745da, "SystemNative_SymLink", nullptr}, + {0xbbd20cce92ec2c12, "SystemNative_FcntlGetFD", nullptr}, + {0xbcd9e53d2d288094, "SystemNative_GetNameInfo", nullptr}, + {0xbd5a0be2f7904089, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, + {0xbd89ef4df5486744, "SystemNative_Send", nullptr}, + {0xbdbbd2898347c0d1, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, + {0xbdd3128e77381b01, "SystemNative_EnumerateInterfaceAddresses", nullptr}, + {0xbe8df478de07c6d8, "BrotliDefaultFreeFunc", nullptr}, + {0xc00ebc097b776c1f, "SystemNative_GetPriority", nullptr}, + {0xc036b23d88fad91b, "SystemNative_iOSSupportVersion", nullptr}, + {0xc0bb2dd0c5b74436, "CryptoNative_EnsureOpenSslInitialized", nullptr}, + {0xc10e411c989a9314, "CompressionNative_Deflate", nullptr}, + {0xc11cd661db8be230, "AndroidCryptoNative_Des3Cfb64", nullptr}, + {0xc183a0550feea0d6, "BrotliEncoderCompressStream", nullptr}, + {0xc19b94823ea1d39e, "CryptoNative_HmacOneShot", nullptr}, + {0xc1b8a5f1c799e4bb, "BrotliGetDictionary", nullptr}, + {0xc1c679eefc134d31, "SystemNative_LowLevelMonitor_Release", nullptr}, + {0xc287daf58054a21d, "GlobalizationNative_EndsWith", nullptr}, + {0xc2d5e1c465b2f5b6, "AndroidCryptoNative_DsaSizeP", nullptr}, + {0xc3145e336c38379b, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, + {0xc3c10021b10ba455, "SystemNative_GetEGid", nullptr}, + {0xc3fe9394fe1f3f02, "SystemNative_GetSocketType", nullptr}, + {0xc560d9947ab2a34d, "SystemNative_RegisterForSigChld", nullptr}, + {0xc5bed971846027de, "SystemNative_GetCpuUtilization", nullptr}, + {0xc69433678dd341ca, "SystemNative_ForkAndExecProcess", nullptr}, + {0xc7815e0476511544, "AndroidCryptoNative_X509Encode", nullptr}, + {0xc7ae1b8d93af5d73, "SystemNative_ChMod", nullptr}, + {0xc7d536c0e7eb3fe2, "SystemNative_FreeSocketEventBuffer", nullptr}, + {0xc7f81d5b58b65ac0, "BrotliEncoderCreateInstance", nullptr}, + {0xc87a5ee4869035c6, "SystemNative_UninitializeConsoleAfterRead", nullptr}, + {0xc8a52a8b6d96b32b, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, + {0xc8b772178f955d87, "GlobalizationNative_GetSortHandle", nullptr}, + {0xc93df58ae5457bfd, "SystemNative_GetControlMessageBufferSize", nullptr}, + {0xc956e528f995739c, "SystemNative_ReceiveMessage", nullptr}, + {0xca001af79c0d7a8b, "CompressionNative_InflateEnd", nullptr}, + {0xca48c3927c202794, "AndroidCryptoNative_GetECKeyParameters", nullptr}, + {0xcaae6d345ba32c7b, "SystemNative_Kill", nullptr}, + {0xcaec08aa13779f7f, "SystemNative_GetEnviron", nullptr}, + {0xcaf599a20538b10b, "SystemNative_SetWindowSize", nullptr}, + {0xcb4bcdafdc81d116, "AndroidCryptoNative_CipherCreatePartial", nullptr}, + {0xcbbb90469d28cded, "SystemNative_SearchPath", nullptr}, + {0xcc433093c073719e, "AndroidCryptoNative_SSLStreamRead", nullptr}, + {0xcc43d880192dd6ff, "SystemNative_ConvertErrorPlatformToPal", nullptr}, + {0xcc788c0474c3e178, "SystemNative_LSeek", nullptr}, + {0xcd5d8a63493f5e38, "CompressionNative_InflateInit2_", nullptr}, + {0xcdcb014df9a6eae2, "SystemNative_SetPort", nullptr}, + {0xce36e2e1a139a020, "SystemNative_GetDefaultTimeZone", nullptr}, + {0xce6ddfe40fed99d9, "SystemNative_PRead", nullptr}, + {0xce9f8a6ac705faa5, "AndroidCryptoNative_X509DecodeCollection", nullptr}, + {0xceba527295694651, "BrotliDecoderCreateInstance", nullptr}, + {0xd0899515dfe85287, "GlobalizationNative_LoadICU", nullptr}, + {0xd185dfe303ab91dd, "GlobalizationNative_CompareString", nullptr}, + {0xd392d6ed5dcc111c, "SystemNative_GetDomainName", nullptr}, + {0xd5264d57a926edfb, "GlobalizationNative_InitICUFunctions", nullptr}, + {0xd55437b16dc84f3b, "SystemNative_GetIPv4GlobalStatistics", nullptr}, + {0xd5c063a90ae882c1, "AndroidCryptoNative_CipherIsSupported", nullptr}, + {0xd7d818c7640598dc, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, + {0xd7f1a8f616897ace, "AndroidCryptoNative_Aes256Cfb8", nullptr}, + {0xd88be8f9e9f28e90, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, + {0xd8976692c4c68818, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, + {0xd8a9e47b6ca78448, "CryptoNative_ErrPeekLastError", nullptr}, + {0xd995e71361e6ed2e, "GlobalizationNative_IsPredefinedLocale", nullptr}, + {0xd9bd0b370726ce34, "AndroidCryptoNative_CipherReset", nullptr}, + {0xda05c57c78aa6706, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, + {0xda38bffa1d16cdd6, "SystemNative_SetLingerOption", nullptr}, + {0xda4898a26933f73d, "AndroidCryptoNative_DsaVerify", nullptr}, + {0xda6b3192974ca60e, "SystemNative_Open", nullptr}, + {0xdab5eb45815daabc, "SystemNative_GetAtOutOfBandMark", nullptr}, + {0xdae32aac0c0d305c, "SystemNative_ReadProcessStatusInfo", nullptr}, + {0xdbb4752ed23670f0, "AndroidCryptoNative_DesCbc", nullptr}, + {0xdbee22594fa8c585, "SystemNative_CreateAutoreleasePool", nullptr}, + {0xdc51159ffe70b0e0, "BrotliDecoderVersion", nullptr}, + {0xdc780005b0d39711, "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", nullptr}, + {0xdd4c03f06ce96e04, "AndroidCryptoNative_RsaDestroy", nullptr}, + {0xdde06993f87d6ffc, "AndroidCryptoNative_Aes128Cfb128", nullptr}, + {0xde1e22dd097f799c, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, + {0xde259001bf54e6f1, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, + {0xdec5c7544d2c8cb1, "AndroidCryptoNative_GetDsaParameters", nullptr}, + {0xdf650444c8af0763, "SystemNative_FcntlGetIsNonBlocking", nullptr}, + {0xdfede2defd776f7e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, + {0xe059239741e0011a, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, + {0xe072da8f2d921f53, "GlobalizationNative_GetDefaultLocaleName", nullptr}, + {0xe0a170d2b947a8fc, "SystemNative_SendMessage", nullptr}, + {0xe0a601fd89d9b279, "SystemNative_SetErrNo", nullptr}, + {0xe0f34ce89fd38aef, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, + {0xe1930d112ce74c9e, "SystemNative_TryGetUInt32OSThreadId", nullptr}, + {0xe20c29fb8b19da7b, "SystemNative_Listen", nullptr}, + {0xe36a157177b2db08, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, + {0xe44f737a5bebdd90, "SystemNative_SetIPv4Address", nullptr}, + {0xe582a4a60bb74c35, "SystemNative_GetProcAddress", nullptr}, + {0xe604fca300068c0c, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, + {0xe6838f2add787bfe, "SystemNative_FreeLibrary", nullptr}, + {0xe73aeaf9e3a10343, "SystemNative_PWrite", nullptr}, + {0xe78ff100d1d73d99, "SystemNative_SetReceiveTimeout", nullptr}, + {0xe853ecfe4d402ed0, "SystemNative_Poll", nullptr}, + {0xea21aa1f2b2a671c, "GlobalizationNative_LastIndexOf", nullptr}, + {0xea5e6653389b924a, "CompressionNative_DeflateInit2_", nullptr}, + {0xea61d6c040267b2d, "BrotliSetDictionaryData", nullptr}, + {0xeaafb7963ceb9bf4, "SystemNative_GetTcpGlobalStatistics", nullptr}, + {0xeab45239fb3f138d, "AndroidCryptoNative_GetBigNumBytes", nullptr}, + {0xec67e4076662c2de, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, + {0xee4dd111dc8d98f3, "GlobalizationNative_GetJapaneseEraStartDate", nullptr}, + {0xef71ee101b3ece96, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, + {0xeff5d014640ae969, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, + {0xf0045895a9043221, "SystemNative_SearchPath_TempDirectory", nullptr}, + {0xf0658a22dd5ede19, "SystemNative_SNPrintF_1I", nullptr}, + {0xf0ec052da6c5fa70, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, + {0xf1577384f409ea85, "AndroidCryptoNative_BigNumToBinary", nullptr}, + {0xf2c7fa39bf166188, "SystemNative_Free", nullptr}, + {0xf2d074e0aeca51ce, "GlobalizationNative_GetLocales", nullptr}, + {0xf3693f3cadb9b6f4, "GlobalizationNative_EnumCalendarInfo", nullptr}, + {0xf38b47e43f352491, "SystemNative_GetUdpGlobalStatistics", nullptr}, + {0xf432f105a045b088, "CryptoNative_ErrClearError", nullptr}, + {0xf4dea312f71c5ff2, "AndroidCryptoNative_Aes128Ecb", nullptr}, + {0xf4f5526ddc32beac, "CryptoNative_HmacDestroy", nullptr}, + {0xf57f81262f07542c, "AndroidCryptoNative_Des3Ecb", nullptr}, + {0xf63fa2bfce5c4f80, "GlobalizationNative_GetLocaleInfoGroupingSizes", nullptr}, + {0xf6ede5d5d8729315, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, + {0xf75d4fdd6e749a84, "BrotliTransformDictionaryWord", nullptr}, + {0xf7b334768844b502, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, + {0xf85b8ffeba9b06c1, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, + {0xf870179a8d8d1872, "SystemNative_PosixFAdvise", nullptr}, + {0xf8c983dd21ef9fe6, "SystemNative_GetPid", nullptr}, + {0xf96bc1e7e15e69f2, "AndroidCryptoNative_CipherUpdate", nullptr}, + {0xf970881d4fa83e07, "AndroidCryptoNative_CipherCreate", nullptr}, + {0xf9c3d216226b3355, "AndroidCryptoNative_CipherSetTagLength", nullptr}, + {0xf9dea6e72f1fffc9, "CryptoNative_EvpMdCtxCreate", nullptr}, + {0xfa21f0a127c9dce9, "GlobalizationNative_ChangeCaseInvariant", nullptr}, + {0xfa2669c25616a8ff, "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", nullptr}, + {0xfa26b86cedf66721, "SystemNative_Sysctl", nullptr}, + {0xfaa7766eaa2c54a5, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, + {0xfacf02f439426705, "GlobalizationNative_CloseSortHandle", nullptr}, + {0xfb3e394cc613f202, "SystemNative_GetPeerName", nullptr}, + {0xfbb57319454b1074, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, + {0xfc0bad2b1528000f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, + {0xfcdeea476953780c, "AndroidCryptoNative_Aes192Cfb128", nullptr}, + {0xfd2cdd99f11de76c, "AndroidCryptoNative_EcKeyGetSize", nullptr}, + {0xfd4f2784ec1c98aa, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, + {0xfe3dd06281f7cd1f, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, + {0xff28b3bec4f32a2c, "SystemNative_GetFileSystemType", nullptr}, + {0xff9b8d95b0e209fb, "BrotliEncoderHasMoreOutput", nullptr}, + {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, + }}; + +>>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) + +constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; +constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; +constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; +constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; +constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; +<<<<<<< HEAD +<<<<<<< HEAD +constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; +#else + //32-bit internal p/invoke table + std::array internal_pinvokes {{ + {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, + {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, + {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, + {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, + {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, + {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, + {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, + {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, + {0x395808e5, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, + {0x42b41fe4, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, + {0x434ad3e4, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, + {0x4b58e0da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, + {0x501befde, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, + {0x501ebdc2, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, + {0x7a6909a0, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, + {0x7c94dbf5, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, + {0x8f6837ec, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, + {0x9070e02c, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, + {0x910452d0, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, + {0x934790b1, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, + {0x9a734f16, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, + {0x9b7b9290, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, + {0x9c5b24a8, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, + {0xa04e5d1c, "monodroid_free", reinterpret_cast(&monodroid_free)}, + {0xa11d71da, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, + {0xa7ea4a5f, "path_combine", reinterpret_cast(&path_combine)}, + {0xad511c82, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, + {0xb02468aa, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, + {0xbe8d7701, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, + {0xc0d097a7, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, + {0xc439b5d7, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, + {0xc5146c54, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, + {0xc58eafa5, "java_interop_free", reinterpret_cast(&java_interop_free)}, + {0xd3b5d2c1, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, + {0xd78c749d, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, + {0xd91f3619, "create_public_directory", reinterpret_cast(&create_public_directory)}, + {0xe215a17c, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, + {0xe4c3ee19, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, + {0xe7e77ca5, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, + {0xea2184e3, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, + {0xf4079b4a, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, + {0xf5a0ac55, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, + {0xf61941c3, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, + {0xf6ca4b3b, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, + {0xfa1832a6, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, + {0xfa4e32ca, "monodroid_log", reinterpret_cast(&monodroid_log)}, + {0xfdc3ae2a, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, + }}; + + //32-bit DotNet p/invoke table + std::array dotnet_pinvokes {{ + {0xaf6b1c, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, + {0x1733089, "SystemNative_SetTerminalInvalidationHandler", nullptr}, + {0x1dd1f00, "AndroidCryptoNative_Aes192Cfb8", nullptr}, + {0x23a0578, "AndroidCryptoNative_NewGlobalReference", nullptr}, + {0x2f05496, "SystemNative_GetPeerName", nullptr}, + {0x3295077, "SystemNative_MapTcpState", nullptr}, + {0x3d9bc5f, "SystemNative_Unlink", nullptr}, + {0x3e12cb4, "SystemNative_INotifyInit", nullptr}, + {0x5b0fb1d, "SystemNative_InitializeConsoleBeforeRead", nullptr}, + {0x80f30b4, "BrotliDecoderTakeOutput", nullptr}, + {0x84ccf89, "SystemNative_MSync", nullptr}, + {0x8c636a2, "SystemNative_FcntlSetPipeSz", nullptr}, + {0x8de5b3d, "SystemNative_GetSid", nullptr}, + {0x92bf2d9, "AndroidCryptoNative_EcKeyGetSize", nullptr}, + {0xaa46d20, "SystemNative_SNPrintF", nullptr}, + {0xaa7c86e, "SystemNative_Exit", nullptr}, + {0xb6a80bd, "SystemNative_SetAddressFamily", nullptr}, + {0xbdd984d, "SystemNative_SetWindowSize", nullptr}, + {0xcc59904, "CryptoNative_HmacDestroy", nullptr}, + {0xd5ca844, "SystemNative_CreateSocketEventPort", nullptr}, + {0xd98d741, "SystemNative_Kill", nullptr}, + {0xdfe3e26, "SystemNative_Connectx", nullptr}, + {0xfc48476, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, + {0x10d108c9, "SystemNative_FreeHostEntry", nullptr}, + {0x1165644f, "SystemNative_GetOSArchitecture", nullptr}, + {0x11778651, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, + {0x1178ebdd, "CryptoNative_EvpDigestFinalEx", nullptr}, + {0x11a2796d, "SystemNative_GetTcpGlobalStatistics", nullptr}, + {0x11d9981e, "SystemNative_MProtect", nullptr}, + {0x12105897, "GlobalizationNative_NormalizeString", nullptr}, + {0x12b01cc9, "GlobalizationNative_IsNormalized", nullptr}, + {0x12fdf5c3, "SystemNative_ConvertErrorPlatformToPal", nullptr}, + {0x1348bf25, "AndroidCryptoNative_SSLStreamWrite", nullptr}, + {0x1376985b, "SystemNative_SetSockOpt", nullptr}, + {0x13925de2, "SystemNative_GetLingerOption", nullptr}, + {0x13f565a9, "SystemNative_GetControlMessageBufferSize", nullptr}, + {0x142a08a1, "SystemNative_PosixFAdvise", nullptr}, + {0x16d98313, "GlobalizationNative_IndexOf", nullptr}, + {0x17549123, "SystemNative_Connect", nullptr}, + {0x17a5d095, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, + {0x17b96c39, "SystemNative_FreeSocketEventBuffer", nullptr}, + {0x1904820d, "SystemNative_GetHostEntryForName", nullptr}, + {0x19b6a696, "AndroidCryptoNative_X509DecodeCollection", nullptr}, + {0x1a302b28, "SystemNative_SchedSetAffinity", nullptr}, + {0x1aa4105d, "GlobalizationNative_GetSortKey", nullptr}, + {0x1ab1248e, "SystemNative_GetHostName", nullptr}, + {0x1bf277c4, "SystemNative_WaitForSocketEvents", nullptr}, + {0x1c4778bf, "SystemNative_AlignedFree", nullptr}, + {0x1cb466df, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, + {0x1cf7b52c, "SystemNative_MAdvise", nullptr}, + {0x1eb6eaaa, "CryptoNative_GetRandomBytes", nullptr}, + {0x1ebc63c1, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, + {0x1f186646, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, + {0x1f1cd573, "AndroidCryptoNative_Des3Cfb64", nullptr}, + {0x1f998744, "AndroidCryptoNative_Aes128Cfb128", nullptr}, + {0x1fdcd1e0, "CryptoNative_ErrPeekError", nullptr}, + {0x212e38c4, "SystemNative_GetUdpGlobalStatistics", nullptr}, + {0x218fa94a, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, + {0x22011e2b, "SystemNative_SetLingerOption", nullptr}, + {0x224ebd71, "SystemNative_Listen", nullptr}, + {0x2253b591, "BrotliGetTransforms", nullptr}, + {0x226eec4d, "SystemNative_Abort", nullptr}, + {0x229f73d4, "AndroidCryptoNative_RsaUpRef", nullptr}, + {0x22bbb587, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, + {0x2304e65b, "SystemNative_SetRLimit", nullptr}, + {0x23cfcfb0, "BrotliTransformDictionaryWord", nullptr}, + {0x260a3e8d, "CompressionNative_DeflateInit2_", nullptr}, + {0x289b5430, "SystemNative_Log", nullptr}, + {0x28d95a99, "SystemNative_CanGetHiddenFlag", nullptr}, + {0x28f3db4b, "SystemNative_ShmUnlink", nullptr}, + {0x2af6aa40, "SystemNative_Access", nullptr}, + {0x2b117055, "BrotliDecoderDecompress", nullptr}, + {0x2b7293c5, "SystemNative_GetTimestamp", nullptr}, + {0x2b747a9c, "SystemNative_MkNod", nullptr}, + {0x2bc9ff5e, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, + {0x2c4415fd, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, + {0x2c467430, "AndroidCryptoNative_GetECCurveParameters", nullptr}, + {0x2d21ad97, "SystemNative_GetReadDirRBufferSize", nullptr}, + {0x2d6e4a1c, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, + {0x2e66f31b, "BrotliDecoderDestroyInstance", nullptr}, + {0x2eb28fb6, "SystemNative_GetIPv4Address", nullptr}, + {0x2f7d80dd, "GlobalizationNative_WindowsIdToIanaId", nullptr}, + {0x2ff73621, "CryptoNative_ErrReasonErrorString", nullptr}, + {0x30af09b7, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, + {0x31120969, "SystemNative_Malloc", nullptr}, + {0x3374b950, "SystemNative_GetLoadLibraryError", nullptr}, + {0x34867c2f, "SystemNative_TryGetUInt32OSThreadId", nullptr}, + {0x349c5a8f, "SystemNative_GetNetworkInterfaces", nullptr}, + {0x354aa58f, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, + {0x363c0010, "CryptoNative_EvpDigestUpdate", nullptr}, + {0x367eee31, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, + {0x38406fa3, "GlobalizationNative_ChangeCaseInvariant", nullptr}, + {0x38575bc5, "SystemNative_GetUnixRelease", nullptr}, + {0x388a31d4, "SystemNative_PathConf", nullptr}, + {0x3a238b9f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, + {0x3a861d34, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, + {0x3af56a10, "AndroidCryptoNative_RsaSize", nullptr}, + {0x3b286185, "GlobalizationNative_ChangeCaseTurkish", nullptr}, + {0x3bf3d465, "SystemNative_GetIPv6MulticastOption", nullptr}, + {0x3cb49aae, "SystemNative_GetPwNamR", nullptr}, + {0x3d150bdf, "AndroidCryptoNative_Aes128Ecb", nullptr}, + {0x3d823979, "GlobalizationNative_ToUnicode", nullptr}, + {0x3da52690, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, + {0x3de52faf, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, + {0x3df8d649, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, + {0x3e175e7c, "AndroidCryptoNative_Aes256Cfb128", nullptr}, + {0x3e273961, "SystemNative_StrErrorR", nullptr}, + {0x3e48f022, "SystemNative_GetMaximumAddressSize", nullptr}, + {0x3e778b38, "BrotliDecoderVersion", nullptr}, + {0x3ea31c40, "SystemNative_GetAddressFamily", nullptr}, + {0x3efdb5a0, "SystemNative_SendMessage", nullptr}, + {0x3f47618f, "CryptoNative_EnsureOpenSslInitialized", nullptr}, + {0x3f793993, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, + {0x40b0026c, "CompressionNative_DeflateEnd", nullptr}, + {0x40e64bdd, "CryptoNative_ErrClearError", nullptr}, + {0x413b9801, "SystemNative_Read", nullptr}, + {0x41818c1d, "SystemNative_GetPriority", nullptr}, + {0x41cf0c16, "AndroidCryptoNative_CipherCreate", nullptr}, + {0x42955366, "SystemNative_Disconnect", nullptr}, + {0x42afcfbb, "AndroidCryptoNative_CipherCreatePartial", nullptr}, + {0x430352b3, "SystemNative_GetNameInfo", nullptr}, + {0x43f6cea1, "AndroidCryptoNative_DesCfb8", nullptr}, + {0x4543d533, "AndroidCryptoNative_EcDsaVerify", nullptr}, + {0x45a00971, "GlobalizationNative_CloseSortHandle", nullptr}, + {0x45f09dca, "AndroidCryptoNative_CipherSetTagLength", nullptr}, + {0x46268e76, "GlobalizationNative_GetCalendarInfo", nullptr}, + {0x477f60cf, "SystemNative_OpenDir", nullptr}, + {0x47a82b4e, "SystemNative_AlignedRealloc", nullptr}, + {0x48c17c9b, "SystemNative_Sysctl", nullptr}, + {0x493888ee, "CompressionNative_Crc32", nullptr}, + {0x494ef6d4, "SystemNative_GetIPv4MulticastOption", nullptr}, + {0x496f1885, "SystemNative_GetSocketErrorOption", nullptr}, + {0x49c2af32, "SystemNative_GetBootTimeTicks", nullptr}, + {0x49c81782, "SystemNative_MkDir", nullptr}, + {0x49f60a0f, "GlobalizationNative_GetLocales", nullptr}, + {0x4a4ef46f, "SystemNative_FcntlGetFD", nullptr}, + {0x4a98a396, "GlobalizationNative_GetLocaleInfoInt", nullptr}, + {0x4b78d330, "CryptoNative_HmacCurrent", nullptr}, + {0x4c2eae6c, "GlobalizationNative_EnumCalendarInfo", nullptr}, + {0x4c6d50ba, "SystemNative_GetIPv4GlobalStatistics", nullptr}, + {0x4ca38207, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, + {0x4cb997ae, "BrotliEncoderCompress", nullptr}, {0x4d1a35d1, "SystemNative_LowLevelMonitor_Release", nullptr}, {0x4d75bb15, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, {0x4dbf0c74, "SystemNative_CreateSocketEventBuffer", nullptr}, @@ -2058,6 +2601,544 @@ static PinvokeEntry dotnet_pinvokes[] = { {0xff975200, "SystemNative_Realloc", nullptr}, }; >>>>>>> 13ba4b152 (Let's see what breaks) +======= +constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; +#else + //32-bit internal p/invoke table + std::array internal_pinvokes {{ + {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, + {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, + {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, + {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, + {0x2a0e1744, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, + {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, + {0x2f7d0f53, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, + {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, + {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, + {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, + {0x395808e5, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, + {0x42b41fe4, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, + {0x434ad3e4, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, + {0x4b58e0da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, + {0x501befde, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, + {0x501ebdc2, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, + {0x7a6909a0, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, + {0x7c94dbf5, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, + {0x8f6837ec, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, + {0x9070e02c, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, + {0x910452d0, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, + {0x934790b1, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, + {0x9a734f16, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, + {0x9b7b9290, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, + {0x9c5b24a8, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, + {0xa04e5d1c, "monodroid_free", reinterpret_cast(&monodroid_free)}, + {0xa11d71da, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, + {0xa7ea4a5f, "path_combine", reinterpret_cast(&path_combine)}, + {0xad511c82, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, + {0xb02468aa, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, + {0xbe8d7701, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, + {0xc0d097a7, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, + {0xc439b5d7, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, + {0xc5146c54, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, + {0xc58eafa5, "java_interop_free", reinterpret_cast(&java_interop_free)}, + {0xd3b5d2c1, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, + {0xd78c749d, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, + {0xd91f3619, "create_public_directory", reinterpret_cast(&create_public_directory)}, + {0xe215a17c, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, + {0xe4c3ee19, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, + {0xe7e77ca5, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, + {0xea2184e3, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, + {0xf4079b4a, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, + {0xf5a0ac55, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, + {0xf61941c3, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, + {0xf6ca4b3b, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, + {0xfa1832a6, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, + {0xfa4e32ca, "monodroid_log", reinterpret_cast(&monodroid_log)}, + {0xfdc3ae2a, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, + }}; + + //32-bit DotNet p/invoke table + std::array dotnet_pinvokes {{ + {0xaf6b1c, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, + {0x1733089, "SystemNative_SetTerminalInvalidationHandler", nullptr}, + {0x1dd1f00, "AndroidCryptoNative_Aes192Cfb8", nullptr}, + {0x23a0578, "AndroidCryptoNative_NewGlobalReference", nullptr}, + {0x2f05496, "SystemNative_GetPeerName", nullptr}, + {0x3295077, "SystemNative_MapTcpState", nullptr}, + {0x3d9bc5f, "SystemNative_Unlink", nullptr}, + {0x3e12cb4, "SystemNative_INotifyInit", nullptr}, + {0x5b0fb1d, "SystemNative_InitializeConsoleBeforeRead", nullptr}, + {0x80f30b4, "BrotliDecoderTakeOutput", nullptr}, + {0x84ccf89, "SystemNative_MSync", nullptr}, + {0x8c636a2, "SystemNative_FcntlSetPipeSz", nullptr}, + {0x8de5b3d, "SystemNative_GetSid", nullptr}, + {0x92bf2d9, "AndroidCryptoNative_EcKeyGetSize", nullptr}, + {0xaa46d20, "SystemNative_SNPrintF", nullptr}, + {0xaa7c86e, "SystemNative_Exit", nullptr}, + {0xb6a80bd, "SystemNative_SetAddressFamily", nullptr}, + {0xbdd984d, "SystemNative_SetWindowSize", nullptr}, + {0xcc59904, "CryptoNative_HmacDestroy", nullptr}, + {0xd5ca844, "SystemNative_CreateSocketEventPort", nullptr}, + {0xd98d741, "SystemNative_Kill", nullptr}, + {0xdfe3e26, "SystemNative_Connectx", nullptr}, + {0xfc48476, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, + {0x10d108c9, "SystemNative_FreeHostEntry", nullptr}, + {0x1165644f, "SystemNative_GetOSArchitecture", nullptr}, + {0x11778651, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, + {0x1178ebdd, "CryptoNative_EvpDigestFinalEx", nullptr}, + {0x11a2796d, "SystemNative_GetTcpGlobalStatistics", nullptr}, + {0x11d9981e, "SystemNative_MProtect", nullptr}, + {0x12105897, "GlobalizationNative_NormalizeString", nullptr}, + {0x12b01cc9, "GlobalizationNative_IsNormalized", nullptr}, + {0x12fdf5c3, "SystemNative_ConvertErrorPlatformToPal", nullptr}, + {0x1348bf25, "AndroidCryptoNative_SSLStreamWrite", nullptr}, + {0x1376985b, "SystemNative_SetSockOpt", nullptr}, + {0x13925de2, "SystemNative_GetLingerOption", nullptr}, + {0x13f565a9, "SystemNative_GetControlMessageBufferSize", nullptr}, + {0x142a08a1, "SystemNative_PosixFAdvise", nullptr}, + {0x16d98313, "GlobalizationNative_IndexOf", nullptr}, + {0x17549123, "SystemNative_Connect", nullptr}, + {0x17a5d095, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, + {0x17b96c39, "SystemNative_FreeSocketEventBuffer", nullptr}, + {0x1904820d, "SystemNative_GetHostEntryForName", nullptr}, + {0x19b6a696, "AndroidCryptoNative_X509DecodeCollection", nullptr}, + {0x1a302b28, "SystemNative_SchedSetAffinity", nullptr}, + {0x1aa4105d, "GlobalizationNative_GetSortKey", nullptr}, + {0x1ab1248e, "SystemNative_GetHostName", nullptr}, + {0x1bf277c4, "SystemNative_WaitForSocketEvents", nullptr}, + {0x1c4778bf, "SystemNative_AlignedFree", nullptr}, + {0x1cb466df, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, + {0x1cf7b52c, "SystemNative_MAdvise", nullptr}, + {0x1eb6eaaa, "CryptoNative_GetRandomBytes", nullptr}, + {0x1ebc63c1, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, + {0x1f186646, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, + {0x1f1cd573, "AndroidCryptoNative_Des3Cfb64", nullptr}, + {0x1f998744, "AndroidCryptoNative_Aes128Cfb128", nullptr}, + {0x1fdcd1e0, "CryptoNative_ErrPeekError", nullptr}, + {0x212e38c4, "SystemNative_GetUdpGlobalStatistics", nullptr}, + {0x218fa94a, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, + {0x22011e2b, "SystemNative_SetLingerOption", nullptr}, + {0x224ebd71, "SystemNative_Listen", nullptr}, + {0x2253b591, "BrotliGetTransforms", nullptr}, + {0x226eec4d, "SystemNative_Abort", nullptr}, + {0x229f73d4, "AndroidCryptoNative_RsaUpRef", nullptr}, + {0x22bbb587, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, + {0x2304e65b, "SystemNative_SetRLimit", nullptr}, + {0x23cfcfb0, "BrotliTransformDictionaryWord", nullptr}, + {0x260a3e8d, "CompressionNative_DeflateInit2_", nullptr}, + {0x289b5430, "SystemNative_Log", nullptr}, + {0x28d95a99, "SystemNative_CanGetHiddenFlag", nullptr}, + {0x28f3db4b, "SystemNative_ShmUnlink", nullptr}, + {0x2af6aa40, "SystemNative_Access", nullptr}, + {0x2b117055, "BrotliDecoderDecompress", nullptr}, + {0x2b7293c5, "SystemNative_GetTimestamp", nullptr}, + {0x2b747a9c, "SystemNative_MkNod", nullptr}, + {0x2bc9ff5e, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, + {0x2c4415fd, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, + {0x2c467430, "AndroidCryptoNative_GetECCurveParameters", nullptr}, + {0x2d21ad97, "SystemNative_GetReadDirRBufferSize", nullptr}, + {0x2d6e4a1c, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, + {0x2e66f31b, "BrotliDecoderDestroyInstance", nullptr}, + {0x2eb28fb6, "SystemNative_GetIPv4Address", nullptr}, + {0x2f7d80dd, "GlobalizationNative_WindowsIdToIanaId", nullptr}, + {0x2ff73621, "CryptoNative_ErrReasonErrorString", nullptr}, + {0x30af09b7, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, + {0x31120969, "SystemNative_Malloc", nullptr}, + {0x3374b950, "SystemNative_GetLoadLibraryError", nullptr}, + {0x34867c2f, "SystemNative_TryGetUInt32OSThreadId", nullptr}, + {0x349c5a8f, "SystemNative_GetNetworkInterfaces", nullptr}, + {0x354aa58f, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, + {0x363c0010, "CryptoNative_EvpDigestUpdate", nullptr}, + {0x367eee31, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, + {0x38406fa3, "GlobalizationNative_ChangeCaseInvariant", nullptr}, + {0x38575bc5, "SystemNative_GetUnixRelease", nullptr}, + {0x388a31d4, "SystemNative_PathConf", nullptr}, + {0x3a238b9f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, + {0x3a861d34, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, + {0x3af56a10, "AndroidCryptoNative_RsaSize", nullptr}, + {0x3b286185, "GlobalizationNative_ChangeCaseTurkish", nullptr}, + {0x3bf3d465, "SystemNative_GetIPv6MulticastOption", nullptr}, + {0x3cb49aae, "SystemNative_GetPwNamR", nullptr}, + {0x3d150bdf, "AndroidCryptoNative_Aes128Ecb", nullptr}, + {0x3d823979, "GlobalizationNative_ToUnicode", nullptr}, + {0x3da52690, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, + {0x3de52faf, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, + {0x3df8d649, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, + {0x3e175e7c, "AndroidCryptoNative_Aes256Cfb128", nullptr}, + {0x3e273961, "SystemNative_StrErrorR", nullptr}, + {0x3e48f022, "SystemNative_GetMaximumAddressSize", nullptr}, + {0x3e778b38, "BrotliDecoderVersion", nullptr}, + {0x3ea31c40, "SystemNative_GetAddressFamily", nullptr}, + {0x3efdb5a0, "SystemNative_SendMessage", nullptr}, + {0x3f47618f, "CryptoNative_EnsureOpenSslInitialized", nullptr}, + {0x3f793993, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, + {0x40b0026c, "CompressionNative_DeflateEnd", nullptr}, + {0x40e64bdd, "CryptoNative_ErrClearError", nullptr}, + {0x413b9801, "SystemNative_Read", nullptr}, + {0x41818c1d, "SystemNative_GetPriority", nullptr}, + {0x41cf0c16, "AndroidCryptoNative_CipherCreate", nullptr}, + {0x42955366, "SystemNative_Disconnect", nullptr}, + {0x42afcfbb, "AndroidCryptoNative_CipherCreatePartial", nullptr}, + {0x430352b3, "SystemNative_GetNameInfo", nullptr}, + {0x43f6cea1, "AndroidCryptoNative_DesCfb8", nullptr}, + {0x4543d533, "AndroidCryptoNative_EcDsaVerify", nullptr}, + {0x45a00971, "GlobalizationNative_CloseSortHandle", nullptr}, + {0x45f09dca, "AndroidCryptoNative_CipherSetTagLength", nullptr}, + {0x46268e76, "GlobalizationNative_GetCalendarInfo", nullptr}, + {0x477f60cf, "SystemNative_OpenDir", nullptr}, + {0x47a82b4e, "SystemNative_AlignedRealloc", nullptr}, + {0x48c17c9b, "SystemNative_Sysctl", nullptr}, + {0x493888ee, "CompressionNative_Crc32", nullptr}, + {0x494ef6d4, "SystemNative_GetIPv4MulticastOption", nullptr}, + {0x496f1885, "SystemNative_GetSocketErrorOption", nullptr}, + {0x49c2af32, "SystemNative_GetBootTimeTicks", nullptr}, + {0x49c81782, "SystemNative_MkDir", nullptr}, + {0x49f60a0f, "GlobalizationNative_GetLocales", nullptr}, + {0x4a4ef46f, "SystemNative_FcntlGetFD", nullptr}, + {0x4a98a396, "GlobalizationNative_GetLocaleInfoInt", nullptr}, + {0x4b78d330, "CryptoNative_HmacCurrent", nullptr}, + {0x4c2eae6c, "GlobalizationNative_EnumCalendarInfo", nullptr}, + {0x4c6d50ba, "SystemNative_GetIPv4GlobalStatistics", nullptr}, + {0x4ca38207, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, + {0x4cb997ae, "BrotliEncoderCompress", nullptr}, + {0x4d1a35d1, "SystemNative_LowLevelMonitor_Release", nullptr}, + {0x4d75bb15, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, + {0x4dbf0c74, "SystemNative_CreateSocketEventBuffer", nullptr}, + {0x4e4d4f2a, "SystemNative_SetIPv6Address", nullptr}, + {0x4f6011da, "SystemNative_GetPort", nullptr}, + {0x4f6c3726, "SystemNative_FcntlGetIsNonBlocking", nullptr}, + {0x50e88639, "CryptoNative_HmacUpdate", nullptr}, + {0x514e739b, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, + {0x52590509, "AndroidCryptoNative_Aes128Cbc", nullptr}, + {0x526c9f90, "SystemNative_GetNumRoutes", nullptr}, + {0x52896a81, "SystemNative_ChMod", nullptr}, + {0x538521c9, "GlobalizationNative_IanaIdToWindowsId", nullptr}, + {0x54d6c29d, "GlobalizationNative_GetJapaneseEraStartDate", nullptr}, + {0x5600bd0d, "AndroidCryptoNative_SSLStreamCreate", nullptr}, + {0x561fb6ff, "SystemNative_FStat", nullptr}, + {0x564f6794, "AndroidCryptoNative_Pbkdf2", nullptr}, + {0x56993aa9, "SystemNative_SetKeypadXmit", nullptr}, + {0x57bdcc46, "SystemNative_Open", nullptr}, + {0x581adfc6, "SystemNative_GetSignalForBreak", nullptr}, + {0x5906e1ba, "SystemNative_Close", nullptr}, + {0x591c5746, "AndroidCryptoNative_EcKeyUpRef", nullptr}, + {0x59840533, "AndroidCryptoNative_X509Decode", nullptr}, + {0x5989ad17, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, + {0x599921d3, "SystemNative_SysConf", nullptr}, + {0x59b67f4d, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, + {0x59e712d5, "SystemNative_MkdTemp", nullptr}, + {0x5a492732, "SystemNative_FcntlSetFD", nullptr}, + {0x5ccc38dd, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, + {0x5e9ef1a2, "SystemNative_GetAtOutOfBandMark", nullptr}, + {0x5eb4f827, "SystemNative_LockFileRegion", nullptr}, + {0x5ed67634, "SystemNative_GetPwUidR", nullptr}, + {0x5efc6409, "SystemNative_ReceiveSocketError", nullptr}, + {0x5f706f52, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, + {0x5fc58bed, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, + {0x60571eb9, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, + {0x6068baa0, "AndroidCryptoNative_GetRsaParameters", nullptr}, + {0x608ee1a5, "SystemNative_Calloc", nullptr}, + {0x60c353e5, "SystemNative_SetPosixSignalHandler", nullptr}, + {0x613c0080, "AndroidCryptoNative_Aes192Ccm", nullptr}, + {0x626db703, "SystemNative_LStat", nullptr}, + {0x6288dd9a, "SystemNative_SetSignalForBreak", nullptr}, + {0x62a36e75, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, + {0x639b2b1d, "AndroidCryptoNative_DsaVerify", nullptr}, + {0x6436999d, "AndroidCryptoNative_SSLStreamRead", nullptr}, + {0x6441bc65, "CryptoNative_EvpSha256", nullptr}, + {0x64f12e5b, "BrotliDecoderIsFinished", nullptr}, + {0x661c5218, "SystemNative_GetDomainName", nullptr}, + {0x6661a841, "BrotliDecoderDecompressStream", nullptr}, + {0x66b5bf9d, "GlobalizationNative_IsPredefinedLocale", nullptr}, + {0x674bdf7f, "SystemNative_DisablePosixSignalHandling", nullptr}, + {0x679dd832, "SystemNative_SetPort", nullptr}, + {0x679f9b4e, "SystemNative_FcntlGetPipeSz", nullptr}, + {0x67de0842, "SystemNative_Dup", nullptr}, + {0x687726ff, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, + {0x68bdc398, "SystemNative_INotifyAddWatch", nullptr}, + {0x68c949a0, "AndroidCryptoNative_X509GetContentType", nullptr}, + {0x68f9f52f, "AndroidCryptoNative_CipherIsSupported", nullptr}, + {0x6907c8eb, "BrotliEncoderSetParameter", nullptr}, + {0x6adb646e, "SystemNative_ReadDirR", nullptr}, + {0x6b5343a0, "SystemNative_SetErrNo", nullptr}, + {0x6bbd3d10, "SystemNative_GetRLimit", nullptr}, + {0x6be1e33d, "SystemNative_EnumerateInterfaceAddresses", nullptr}, + {0x6cda2cf8, "SystemNative_SetSendTimeout", nullptr}, + {0x6d48392a, "SystemNative_Stat", nullptr}, + {0x6ece5fe6, "SystemNative_GetPid", nullptr}, + {0x6ef4e421, "AndroidCryptoNative_CipherDestroy", nullptr}, + {0x6f18d737, "GlobalizationNative_InitICUFunctions", nullptr}, + {0x6f695cb8, "SystemNative_RmDir", nullptr}, + {0x6fa886b1, "SystemNative_GetSockName", nullptr}, + {0x6fc36e5f, "GlobalizationNative_StartsWith", nullptr}, + {0x708e7911, "SystemNative_SetIPv4Address", nullptr}, + {0x70d4f7e6, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, + {0x70e91ddd, "SystemNative_FChMod", nullptr}, + {0x71698a7f, "SystemNative_GetDomainSocketSizes", nullptr}, + {0x7243c4b4, "AndroidCryptoNative_Des3Cfb8", nullptr}, + {0x758dd6aa, "SystemNative_GetTimeZoneData", nullptr}, + {0x759f5b1e, "AndroidCryptoNative_Aes256Cfb8", nullptr}, + {0x75b11f61, "BrotliDecoderGetErrorCode", nullptr}, + {0x76e97b2e, "SystemNative_Rename", nullptr}, + {0x78c1eb52, "AndroidCryptoNative_Des3Ecb", nullptr}, + {0x7a0529c1, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, + {0x7a4012d2, "GlobalizationNative_GetICUVersion", nullptr}, + {0x7aa30494, "Java_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate", nullptr}, + {0x7ad3b820, "AndroidCryptoNative_Aes192Cfb128", nullptr}, + {0x7cb19137, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, + {0x7d0c477d, "CryptoNative_ErrPeekLastError", nullptr}, + {0x7d2bb98a, "SystemNative_MksTemps", nullptr}, + {0x7de70253, "SystemNative_ConvertErrorPalToPlatform", nullptr}, + {0x7e882ae5, "BrotliEncoderIsFinished", nullptr}, + {0x7e9a677b, "GlobalizationNative_GetSortVersion", nullptr}, + {0x7f5d9e25, "SystemNative_MUnmap", nullptr}, + {0x80d5027e, "CryptoNative_EvpMdCtxCopyEx", nullptr}, + {0x80deced4, "SystemNative_CreateAutoreleasePool", nullptr}, + {0x81a5efac, "SystemNative_SetEUid", nullptr}, + {0x82484cbf, "CryptoNative_EvpDigestOneShot", nullptr}, + {0x8289a6f7, "BrotliDefaultFreeFunc", nullptr}, + {0x83dad9bf, "SystemNative_Pipe", nullptr}, + {0x83db1b72, "CryptoNative_EvpDigestCurrent", nullptr}, + {0x84662605, "CompressionNative_Deflate", nullptr}, + {0x8526c9e8, "SystemNative_SetRawSockOpt", nullptr}, + {0x8574b133, "AndroidCryptoNative_Aes192Ecb", nullptr}, + {0x85abed93, "GlobalizationNative_GetCalendars", nullptr}, + {0x8808879d, "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", nullptr}, + {0x88a7558d, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, + {0x8ba80ef4, "GlobalizationNative_InitOrdinalCasingPage", nullptr}, + {0x8bdaf06c, "SystemNative_GetWindowSize", nullptr}, + {0x8bfcd7ba, "CompressionNative_Inflate", nullptr}, + {0x8d38b733, "SystemNative_LSeek", nullptr}, + {0x8f4e59f1, "SystemNative_ReadStdin", nullptr}, + {0x8f628a8d, "GlobalizationNative_CompareString", nullptr}, + {0x909e12ee, "SystemNative_SearchPath", nullptr}, + {0x910b7740, "SystemNative_GetFormatInfoForMountPoint", nullptr}, + {0x913a3d68, "SystemNative_GetDeviceIdentifiers", nullptr}, + {0x9216d936, "SystemNative_GetGroupName", nullptr}, + {0x94477030, "AndroidCryptoNative_Aes256Ccm", nullptr}, + {0x95e99740, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, + {0x960d4fc0, "SystemNative_GetDefaultTimeZone", nullptr}, + {0x966f54af, "CryptoNative_EvpSha384", nullptr}, + {0x96912459, "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", nullptr}, + {0x9787b4b4, "CryptoNative_EvpMdSize", nullptr}, + {0x98105435, "SystemNative_GetIPv6Address", nullptr}, + {0x984edaf1, "AndroidCryptoNative_RsaDestroy", nullptr}, + {0x9852b0fa, "SystemNative_INotifyRemoveWatch", nullptr}, + {0x98954db8, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, + {0x98ca7f1c, "SystemNative_ChDir", nullptr}, + {0x990163b4, "SystemNative_Receive", nullptr}, + {0x996952b3, "AndroidCryptoNative_CipherFinalEx", nullptr}, + {0x9a005080, "SystemNative_Bind", nullptr}, + {0x9a84ffd3, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, + {0x9abfce84, "SystemNative_GetEnviron", nullptr}, + {0x9bda7eb1, "SystemNative_ReadProcessStatusInfo", nullptr}, + {0x9cd6cae8, "AndroidCryptoNative_SSLStreamRelease", nullptr}, + {0x9d102d58, "CompressionNative_InflateEnd", nullptr}, + {0x9d2f90cf, "GlobalizationNative_GetLatestJapaneseEra", nullptr}, + {0x9d7f4af6, "SystemNative_ReceiveMessage", nullptr}, + {0x9dc3baed, "SystemNative_LowLevelMonitor_Destroy", nullptr}, + {0x9e366e9c, "SystemNative_InterfaceNameToIndex", nullptr}, + {0x9e717f20, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, + {0x9f47b32d, "SystemNative_ShmOpen", nullptr}, + {0x9feb81cb, "SystemNative_SNPrintF_1I", nullptr}, + {0xa0db1858, "SystemNative_GetEnv", nullptr}, + {0xa1295a9f, "SystemNative_MkFifo", nullptr}, + {0xa1bec9da, "SystemNative_LogError", nullptr}, + {0xa1d774fc, "BrotliEncoderHasMoreOutput", nullptr}, + {0xa2430b33, "SystemNative_SearchPath_TempDirectory", nullptr}, + {0xa25daa0e, "BrotliSetDictionaryData", nullptr}, + {0xa2d2f390, "SystemNative_TryChangeSocketEventRegistration", nullptr}, + {0xa39be756, "GlobalizationNative_LoadICU", nullptr}, + {0xa4636764, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, + {0xa477c74e, "SystemNative_TryGetIPPacketInformation", nullptr}, + {0xa635da0f, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, + {0xa691d151, "AndroidCryptoNative_Aes192Cbc", nullptr}, + {0xa72ce322, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, + {0xa8074d4c, "GlobalizationNative_GetSortHandle", nullptr}, + {0xa826eabe, "SystemNative_FcntlSetIsNonBlocking", nullptr}, + {0xa829138a, "SystemNative_GetProcessPath", nullptr}, + {0xa8701bcf, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, + {0xa8da7ba1, "BrotliEncoderVersion", nullptr}, + {0xa936bc40, "AndroidCryptoNative_EcDsaSize", nullptr}, + {0xa9c29be5, "SystemNative_SetIPv6MulticastOption", nullptr}, + {0xa9c84a4a, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, + {0xaa13ec2b, "GlobalizationNative_GetLocaleInfoGroupingSizes", nullptr}, + {0xaa2f32ad, "SystemNative_FTruncate", nullptr}, + {0xab37a684, "CryptoNative_HmacCreate", nullptr}, + {0xab3d1641, "AndroidCryptoNative_DesEcb", nullptr}, + {0xabe6739f, "BrotliGetDictionary", nullptr}, + {0xacc26fa4, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, + {0xacc28460, "SystemNative_GetProcAddress", nullptr}, + {0xad7fbde5, "SystemNative_FUTimens", nullptr}, + {0xae443204, "SystemNative_GetSockOpt", nullptr}, + {0xae449ad1, "BrotliDecoderIsUsed", nullptr}, + {0xae8752e4, "GlobalizationNative_ToAscii", nullptr}, + {0xafb02e71, "BrotliEncoderMaxCompressedSize", nullptr}, + {0xb01e9c27, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, + {0xb030a893, "SystemNative_LowLevelMonitor_Acquire", nullptr}, + {0xb0e270a0, "BrotliEncoderDestroyInstance", nullptr}, + {0xb22a12be, "BrotliEncoderCreateInstance", nullptr}, + {0xb26f05b6, "SystemNative_PWrite", nullptr}, + {0xb2965ccd, "CryptoNative_GetMaxMdSize", nullptr}, + {0xb2985645, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, + {0xb4110b14, "AndroidCryptoNative_DsaGenerateKey", nullptr}, + {0xb427959c, "SystemNative_FLock", nullptr}, + {0xb439ebdb, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, + {0xb444f04a, "SystemNative_Accept", nullptr}, + {0xb448a24a, "SystemNative_SymLink", nullptr}, + {0xb4e5c37d, "SystemNative_UTimensat", nullptr}, + {0xb584e8fb, "GlobalizationNative_GetTimeZoneDisplayName", nullptr}, + {0xb5a5754a, "SystemNative_UninitializeConsoleAfterRead", nullptr}, + {0xb5db6a51, "SystemNative_PWriteV", nullptr}, + {0xb628f475, "SystemNative_GetBytesAvailable", nullptr}, + {0xb7041ffa, "SystemNative_GetControlCharacters", nullptr}, + {0xb7cc3cd1, "AndroidCryptoNative_DesCbc", nullptr}, + {0xb7ebdf2c, "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", nullptr}, + {0xb80f233c, "SystemNative_FSync", nullptr}, + {0xb84914f1, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, + {0xb862b34e, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, + {0xb884b933, "SystemNative_StdinReady", nullptr}, + {0xb96c2133, "SystemNative_GetErrNo", nullptr}, + {0xb97add7d, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, + {0xb9e6cb2c, "SystemNative_RealPath", nullptr}, + {0xba284ef4, "CryptoNative_EvpSha1", nullptr}, + {0xbb06f5e1, "AndroidCryptoNative_Aes192Gcm", nullptr}, + {0xbb25ff40, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, + {0xbb2ca4f3, "SystemNative_Link", nullptr}, + {0xbb92466f, "SystemNative_AlignedAlloc", nullptr}, + {0xbd658356, "CryptoNative_ErrErrorStringN", nullptr}, + {0xbdbf2140, "SystemNative_SchedGetAffinity", nullptr}, + {0xbec8a3f2, "SystemNative_FChflags", nullptr}, + {0xbf4eeb78, "AndroidCryptoNative_GetBigNumBytes", nullptr}, + {0xbf9766c3, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, + {0xbfa0ce53, "SystemNative_GetPlatformSignalNumber", nullptr}, + {0xbfaad12d, "BrotliDecoderSetParameter", nullptr}, + {0xc090b1d3, "CryptoNative_EvpSha512", nullptr}, + {0xc0d66913, "SystemNative_GetUnixVersion", nullptr}, + {0xc11dec94, "SystemNative_FAllocate", nullptr}, + {0xc1243135, "AndroidCryptoNative_Aes128Gcm", nullptr}, + {0xc1e4e6f6, "AndroidCryptoNative_BigNumToBinary", nullptr}, + {0xc25ffc33, "BrotliEncoderCompressStream", nullptr}, + {0xc3812682, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, + {0xc3dcc3a0, "AndroidCryptoNative_SetRsaParameters", nullptr}, + {0xc3e6ff56, "SystemNative_LowLevelMonitor_Create", nullptr}, + {0xc475f41c, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, + {0xc4ac1723, "AndroidCryptoNative_Aes256Cbc", nullptr}, + {0xc55548f2, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, + {0xc57b40fa, "SystemNative_LoadLibrary", nullptr}, + {0xc5a83c28, "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", nullptr}, + {0xc6d5929c, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, + {0xc6f2fb9e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, + {0xc717b16e, "CryptoNative_EvpMdCtxDestroy", nullptr}, + {0xc746b70c, "AndroidCryptoNative_DsaSign", nullptr}, + {0xc83527e0, "CryptoNative_HmacReset", nullptr}, + {0xc89ccd22, "SystemNative_SchedGetCpu", nullptr}, + {0xc8cce896, "SystemNative_GetSocketType", nullptr}, + {0xc8e06b20, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, + {0xc9b017c8, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, + {0xca4dad90, "GlobalizationNative_ChangeCase", nullptr}, + {0xca5aab33, "SystemNative_Sync", nullptr}, + {0xcb458400, "CryptoNative_ErrGetErrorAlloc", nullptr}, + {0xcb746e5c, "SystemNative_SetIPv4MulticastOption", nullptr}, + {0xcb85cd8e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, + {0xccc0dd15, "SystemNative_RegisterForSigChld", nullptr}, + {0xcdfb627d, "SystemNative_FreeLibrary", nullptr}, + {0xce91e293, "SystemNative_GetGroupList", nullptr}, + {0xcf0912c8, "GlobalizationNative_GetLocaleTimeFormat", nullptr}, + {0xcf9bcc75, "AndroidCryptoNative_Aes256Gcm", nullptr}, + {0xcfa9e6f1, "AndroidCryptoNative_GetDsaParameters", nullptr}, + {0xcff9b341, "SystemNative_GetSystemTimeAsTicks", nullptr}, + {0xd199e841, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, + {0xd24d4849, "SystemNative_Socket", nullptr}, + {0xd298c3b3, "SystemNative_Write", nullptr}, + {0xd378ba49, "CryptoNative_EvpMd5", nullptr}, + {0xd473c64c, "SystemNative_SetReceiveTimeout", nullptr}, + {0xd4b91180, "SystemNative_ForkAndExecProcess", nullptr}, + {0xd6d7b4fb, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, + {0xd71d8c66, "AndroidCryptoNative_Aes256Ecb", nullptr}, + {0xd7ee326b, "AndroidCryptoNative_EcKeyDestroy", nullptr}, + {0xd818a523, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, + {0xd9458396, "BrotliDecoderCreateInstance", nullptr}, + {0xda040de4, "GlobalizationNative_EndsWith", nullptr}, + {0xdaaa19b2, "SystemNative_GetAllMountPoints", nullptr}, + {0xdac67152, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, + {0xdad29aeb, "AndroidCryptoNative_CipherUpdate", nullptr}, + {0xdaf0460a, "SystemNative_SendFile", nullptr}, + {0xdbbf4917, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, + {0xdbdce4ef, "BrotliDefaultAllocFunc", nullptr}, + {0xdbe13a57, "SystemNative_GetCpuUtilization", nullptr}, + {0xdc3cbeec, "CryptoNative_HmacOneShot", nullptr}, + {0xdcaddb21, "AndroidCryptoNative_GetECKeyParameters", nullptr}, + {0xdd274c15, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, + {0xdd445632, "AndroidCryptoNative_X509ChainValidate", nullptr}, + {0xddd58443, "SystemNative_PReadV", nullptr}, + {0xdea9b9dc, "SystemNative_EnablePosixSignalHandling", nullptr}, + {0xdf0260d8, "GlobalizationNative_GetLocaleInfoString", nullptr}, + {0xdf4f1977, "AndroidCryptoNative_X509PublicKey", nullptr}, + {0xdf5d3dc8, "GlobalizationNative_GetDefaultLocaleName", nullptr}, + {0xdf80df75, "SystemNative_iOSSupportVersion", nullptr}, + {0xe121bac7, "SystemNative_GetPeerID", nullptr}, + {0xe169faa6, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, + {0xe1b8b44f, "SystemNative_Send", nullptr}, + {0xe2a0d0de, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, + {0xe4a78efb, "SystemNative_SetPriority", nullptr}, + {0xe4dba4f6, "SystemNative_GetCwd", nullptr}, + {0xe4f87d25, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, + {0xe50c82b4, "SystemNative_CreateThread", nullptr}, + {0xe58ed8fe, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, + {0xe5ef37b3, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, + {0xe70a3634, "GlobalizationNative_GetLocaleName", nullptr}, + {0xe770cb3f, "SystemNative_CopyFile", nullptr}, + {0xe7a9a106, "CompressionNative_InflateInit2_", nullptr}, + {0xe7bd8dd1, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, + {0xe890cf58, "AndroidCryptoNative_EcDsaSign", nullptr}, + {0xe8b2ec8d, "BrotliDecoderErrorString", nullptr}, + {0xe972fbd9, "SystemNative_GetEGid", nullptr}, + {0xe9bc4e53, "SystemNative_SNPrintF_1S", nullptr}, + {0xea86f52f, "BrotliEncoderTakeOutput", nullptr}, + {0xeb0d0522, "SystemNative_LowLevelMonitor_Wait", nullptr}, + {0xebacbf92, "AndroidCryptoNative_Aes128Cfb8", nullptr}, + {0xec31140d, "BrotliDecoderHasMoreOutput", nullptr}, + {0xec51a1b4, "SystemNative_LChflags", nullptr}, + {0xed6cc182, "CryptoNative_EvpMdCtxCreate", nullptr}, + {0xee74a5ad, "AndroidCryptoNative_DsaSizeP", nullptr}, + {0xef48c2eb, "CryptoNative_EvpDigestReset", nullptr}, + {0xef5890c7, "AndroidCryptoNative_Des3Cbc", nullptr}, + {0xefb38c9f, "SystemNative_Poll", nullptr}, + {0xefd277f7, "CryptoNative_HmacFinal", nullptr}, + {0xf06b440b, "AndroidCryptoNative_DsaSizeSignature", nullptr}, + {0xf0919525, "AndroidCryptoNative_CipherReset", nullptr}, + {0xf0e499c4, "SystemNative_PRead", nullptr}, + {0xf1bb5b47, "SystemNative_ReadLink", nullptr}, + {0xf23e6314, "AndroidCryptoNative_RsaCreate", nullptr}, + {0xf2a49cf0, "SystemNative_CloseSocketEventPort", nullptr}, + {0xf39b1c3a, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, + {0xf3b9c879, "AndroidCryptoNative_X509Encode", nullptr}, + {0xf432ab33, "SystemNative_CloseDir", nullptr}, + {0xf4a5a1c8, "SystemNative_SysLog", nullptr}, + {0xf500c9d3, "SystemNative_GetActiveUdpListeners", nullptr}, + {0xf57828fb, "SystemNative_IsATty", nullptr}, + {0xf5918f53, "SystemNative_GetSocketAddressSizes", nullptr}, + {0xf6141499, "AndroidCryptoNative_X509ChainBuild", nullptr}, + {0xf629d20f, "SystemNative_Shutdown", nullptr}, + {0xf6b01c6b, "SystemNative_FreeEnviron", nullptr}, + {0xf6bfedad, "SystemNative_ReadEvents", nullptr}, + {0xf91cf365, "AndroidCryptoNative_Aes128Ccm", nullptr}, + {0xf94a4828, "SystemNative_GetEUid", nullptr}, + {0xf993f426, "SystemNative_Free", nullptr}, + {0xfa97914b, "SystemNative_MMap", nullptr}, + {0xfad61722, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, + {0xfae25aa7, "GlobalizationNative_LastIndexOf", nullptr}, + {0xfb89157f, "SystemNative_GetGroups", nullptr}, + {0xfc83423c, "SystemNative_GetRawSockOpt", nullptr}, + {0xfd9099cc, "SystemNative_GetUInt64OSThreadId", nullptr}, + {0xfe2f2c47, "SystemNative_DrainAutoreleasePool", nullptr}, + {0xfeb6c5c7, "SystemNative_WaitPidExitedNoHang", nullptr}, + {0xff3b4cfa, "SystemNative_GetFileSystemType", nullptr}, + {0xff975200, "SystemNative_Realloc", nullptr}, + }}; + +>>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) constexpr hash_t java_interop_library_hash = 0x6e36e350; constexpr hash_t xa_internal_api_library_hash = 0x13c9bd62; @@ -2065,6 +3146,7 @@ constexpr hash_t system_native_library_hash = 0x5b9ade60; constexpr hash_t system_io_compression_native_library_hash = 0xafe3142c; constexpr hash_t system_security_cryptography_native_android_library_hash = 0x93625cd; <<<<<<< HEAD +<<<<<<< HEAD constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a; #endif @@ -2077,3 +3159,11 @@ constexpr size_t dotnet_pinvokes_count = 477; constexpr size_t internal_pinvokes_count = 49; constexpr size_t dotnet_pinvokes_count = 428; >>>>>>> 13ba4b152 (Let's see what breaks) +======= +constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a; +#endif + +constexpr size_t internal_pinvokes_count = 49; +constexpr size_t dotnet_pinvokes_count = 477; +} // end of anonymous namespace +>>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) diff --git a/src/native/pinvoke-override/precompiled.cc b/src/native/pinvoke-override/precompiled.cc index f8a48dc8e33..db6691815d8 100644 --- a/src/native/pinvoke-override/precompiled.cc +++ b/src/native/pinvoke-override/precompiled.cc @@ -19,11 +19,15 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); if (library_name_hash == java_interop_library_hash || library_name_hash == xa_internal_api_library_hash) { +<<<<<<< HEAD <<<<<<< HEAD PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes.data (), internal_pinvokes_count); ======= PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes, internal_pinvokes_count); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes.data (), internal_pinvokes_count); +>>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) if (entry == nullptr) [[unlikely]] { log_fatal (LOG_ASSEMBLY, "Internal p/invoke symbol '%s @ %s' (hash: 0x%zx) not found in compile-time map.", library_name, entrypoint_name, entrypoint_hash); @@ -56,21 +60,30 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha dotnet_dso_handle = &system_security_cryptography_native_android_library_handle; } else if (library_name_hash == system_io_compression_native_library_hash) { dotnet_dso_handle = &system_io_compression_native_library_handle; +<<<<<<< HEAD <<<<<<< HEAD } else if (library_name_hash == system_globalization_native_library_hash) { dotnet_dso_handle = &system_globalization_native_library_handle; ======= >>>>>>> 13ba4b152 (Let's see what breaks) +======= + } else if (library_name_hash == system_globalization_native_library_hash) { + dotnet_dso_handle = &system_globalization_native_library_handle; +>>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) } else { dotnet_dso_handle = nullptr; } if (dotnet_dso_handle != nullptr) { +<<<<<<< HEAD <<<<<<< HEAD PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes.data (), dotnet_pinvokes_count); ======= PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes, dotnet_pinvokes_count); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes.data (), dotnet_pinvokes_count); +>>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) if (entry != nullptr) { if (entry->func != nullptr) { return entry->func; From 4f5a86bb360dcf412f9e8c06432e609ff569b2d3 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 16 Jul 2024 17:44:35 +0200 Subject: [PATCH 15/53] Formatting --- src/native/monodroid/internal-pinvokes.cc | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/native/monodroid/internal-pinvokes.cc b/src/native/monodroid/internal-pinvokes.cc index 34cc1ccbca5..6bc978943c0 100644 --- a/src/native/monodroid/internal-pinvokes.cc +++ b/src/native/monodroid/internal-pinvokes.cc @@ -15,16 +15,21 @@ monodroid_get_log_categories () int monodroid_get_system_property (const char *name, char **value) { +<<<<<<< HEAD <<<<<<< HEAD return AndroidSystem::monodroid_get_system_property (name, value); ======= return AndroidSystem::monodroid_get_system_property (name, value); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + return AndroidSystem::monodroid_get_system_property (name, value); +>>>>>>> 87926b42b (Formatting) } int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) { +<<<<<<< HEAD <<<<<<< HEAD embeddedAssemblies.set_assemblies_prefix (prefix); return 0; @@ -32,6 +37,10 @@ monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) embeddedAssemblies.set_assemblies_prefix (prefix); return 0; >>>>>>> 13ba4b152 (Let's see what breaks) +======= + embeddedAssemblies.set_assemblies_prefix (prefix); + return 0; +>>>>>>> 87926b42b (Formatting) } void @@ -71,21 +80,29 @@ monodroid_log (LogLevel level, LogCategories category, const char *message) void monodroid_free (void *ptr) { +<<<<<<< HEAD <<<<<<< HEAD free (ptr); ======= free (ptr); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + free (ptr); +>>>>>>> 87926b42b (Formatting) } int _monodroid_max_gref_get () { +<<<<<<< HEAD <<<<<<< HEAD return static_cast(AndroidSystem::get_max_gref_count ()); ======= return static_cast(AndroidSystem::get_max_gref_count ()); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + return static_cast(AndroidSystem::get_max_gref_count ()); +>>>>>>> 87926b42b (Formatting) } int @@ -98,31 +115,43 @@ _monodroid_gref_get () void _monodroid_gref_log (const char *message) { +<<<<<<< HEAD <<<<<<< HEAD osBridge._monodroid_gref_log (message); ======= osBridge._monodroid_gref_log (message); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + osBridge._monodroid_gref_log (message); +>>>>>>> 87926b42b (Formatting) } int _monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD <<<<<<< HEAD return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); ======= return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); +>>>>>>> 87926b42b (Formatting) } void _monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD <<<<<<< HEAD osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); ======= osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); +>>>>>>> 87926b42b (Formatting) } int @@ -134,51 +163,71 @@ _monodroid_weak_gref_get () void _monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD <<<<<<< HEAD osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); ======= osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); +>>>>>>> 87926b42b (Formatting) } void _monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD <<<<<<< HEAD osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); ======= osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); +>>>>>>> 87926b42b (Formatting) } void _monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD <<<<<<< HEAD osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); ======= osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); +>>>>>>> 87926b42b (Formatting) } void _monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { +<<<<<<< HEAD <<<<<<< HEAD osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); ======= osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); +>>>>>>> 87926b42b (Formatting) } void _monodroid_gc_wait_for_bridge_processing () { +<<<<<<< HEAD <<<<<<< HEAD mono_gc_wait_for_bridge_processing (); ======= mono_gc_wait_for_bridge_processing (); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + mono_gc_wait_for_bridge_processing (); +>>>>>>> 87926b42b (Formatting) } <<<<<<< HEAD @@ -186,27 +235,36 @@ _monodroid_gc_wait_for_bridge_processing () int _monodroid_get_android_api_level () { +<<<<<<< HEAD <<<<<<< HEAD return monodroidRuntime.get_android_api_level (); ======= return monodroidRuntime.get_android_api_level (); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + return monodroidRuntime.get_android_api_level (); +>>>>>>> 87926b42b (Formatting) } >>>>>>> badc53112 (Let's see what breaks) void monodroid_clear_gdb_wait () { +<<<<<<< HEAD <<<<<<< HEAD monodroidRuntime.set_monodroid_gdb_wait (false); ======= monodroidRuntime.set_monodroid_gdb_wait (false); >>>>>>> 13ba4b152 (Let's see what breaks) +======= + monodroidRuntime.set_monodroid_gdb_wait (false); +>>>>>>> 87926b42b (Formatting) } void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v) { +<<<<<<< HEAD <<<<<<< HEAD intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); return (void*) rv; @@ -214,6 +272,10 @@ _monodroid_get_identity_hash_code (JNIEnv *env, void *v) intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); return (void*) rv; >>>>>>> 13ba4b152 (Let's see what breaks) +======= + intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); + return (void*) rv; +>>>>>>> 87926b42b (Formatting) } void* @@ -371,11 +433,15 @@ monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports) https://github.com/dotnet/java-interop/blob/master/src/java-interop/java-interop-gc-bridge-mono.c#L266 it should also accept libmono_path = nullptr parameter +<<<<<<< HEAD <<<<<<< HEAD */ ======= */ >>>>>>> 13ba4b152 (Let's see what breaks) +======= + */ +>>>>>>> 87926b42b (Formatting) int monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path) { From 71f70a92a5bc194d6695e613de308a10e65a422a Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 23 Jul 2024 18:23:56 +0200 Subject: [PATCH 16/53] Fix post-rebase issues and conflicts --- src/native/pinvoke-override/common.cc | 4 ++++ src/native/pinvoke-override/pinvoke-override-api.hh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/native/pinvoke-override/common.cc b/src/native/pinvoke-override/common.cc index b41a61adf68..8c9dcad7f6e 100644 --- a/src/native/pinvoke-override/common.cc +++ b/src/native/pinvoke-override/common.cc @@ -4,7 +4,11 @@ using namespace xamarin::android; PinvokeOverride::pinvoke_library_map PinvokeOverride::other_pinvoke_map (PinvokeOverride::LIBRARY_MAP_INITIAL_BUCKET_COUNT); <<<<<<< HEAD +<<<<<<< HEAD xamarin::android::mutex PinvokeOverride::pinvoke_map_write_lock; ======= std::mutex PinvokeOverride::pinvoke_map_write_lock; >>>>>>> 13ba4b152 (Let's see what breaks) +======= +xamarin::android::mutex PinvokeOverride::pinvoke_map_write_lock; +>>>>>>> da87011a5 (Fix post-rebase issues and conflicts) diff --git a/src/native/pinvoke-override/pinvoke-override-api.hh b/src/native/pinvoke-override/pinvoke-override-api.hh index 445f8cccf0b..115e84b2951 100644 --- a/src/native/pinvoke-override/pinvoke-override-api.hh +++ b/src/native/pinvoke-override/pinvoke-override-api.hh @@ -78,7 +78,11 @@ namespace xamarin::android { static void* monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name); private: +<<<<<<< HEAD static xamarin::android::mutex pinvoke_map_write_lock; +======= + static xamarin::android::mutex pinvoke_map_write_lock; +>>>>>>> da87011a5 (Fix post-rebase issues and conflicts) static pinvoke_library_map other_pinvoke_map; #if defined(PRECOMPILED) From 7b561dc77b8af3b0b020f5c62508b81b863d420c Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 23 Jul 2024 18:47:11 +0200 Subject: [PATCH 17/53] Update TODO --- NativeLinkingTODO.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NativeLinkingTODO.md b/NativeLinkingTODO.md index f2f58b895db..e284987451f 100644 --- a/NativeLinkingTODO.md +++ b/NativeLinkingTODO.md @@ -19,6 +19,10 @@ a bit more complicated to implement but would give us much faster code, thus it's the preferred solution. +# Helpers + + * linker can output a list of pinvokes, see https://github.com/dotnet/android/issues/7114 + # Ideas * Use [mold](https://github.com/rui314/mold) which has recently been re-licensed under `MIT/X11` From 4f5328174e3ea5ae6aa8fa8f942b8664a99d2388 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 24 Jul 2024 17:16:15 +0200 Subject: [PATCH 18/53] Post-rebase fixes --- src/native/monodroid/internal-pinvokes.cc | 132 -- src/native/pinvoke-override/CMakeLists.txt | 3 - src/native/pinvoke-override/common.cc | 8 - .../pinvoke-override/pinvoke-override-api.hh | 4 - .../pinvoke-override/pinvoke-tables.include | 2085 +---------------- src/native/pinvoke-override/precompiled.cc | 24 - 6 files changed, 6 insertions(+), 2250 deletions(-) diff --git a/src/native/monodroid/internal-pinvokes.cc b/src/native/monodroid/internal-pinvokes.cc index 6bc978943c0..bf56ee0530b 100644 --- a/src/native/monodroid/internal-pinvokes.cc +++ b/src/native/monodroid/internal-pinvokes.cc @@ -15,32 +15,14 @@ monodroid_get_log_categories () int monodroid_get_system_property (const char *name, char **value) { -<<<<<<< HEAD -<<<<<<< HEAD - return AndroidSystem::monodroid_get_system_property (name, value); -======= - return AndroidSystem::monodroid_get_system_property (name, value); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= return AndroidSystem::monodroid_get_system_property (name, value); ->>>>>>> 87926b42b (Formatting) } int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) { -<<<<<<< HEAD -<<<<<<< HEAD - embeddedAssemblies.set_assemblies_prefix (prefix); - return 0; -======= - embeddedAssemblies.set_assemblies_prefix (prefix); - return 0; ->>>>>>> 13ba4b152 (Let's see what breaks) -======= embeddedAssemblies.set_assemblies_prefix (prefix); return 0; ->>>>>>> 87926b42b (Formatting) } void @@ -80,29 +62,13 @@ monodroid_log (LogLevel level, LogCategories category, const char *message) void monodroid_free (void *ptr) { -<<<<<<< HEAD -<<<<<<< HEAD - free (ptr); -======= - free (ptr); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= free (ptr); ->>>>>>> 87926b42b (Formatting) } int _monodroid_max_gref_get () { -<<<<<<< HEAD -<<<<<<< HEAD - return static_cast(AndroidSystem::get_max_gref_count ()); -======= - return static_cast(AndroidSystem::get_max_gref_count ()); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= return static_cast(AndroidSystem::get_max_gref_count ()); ->>>>>>> 87926b42b (Formatting) } int @@ -115,43 +81,19 @@ _monodroid_gref_get () void _monodroid_gref_log (const char *message) { -<<<<<<< HEAD -<<<<<<< HEAD - osBridge._monodroid_gref_log (message); -======= - osBridge._monodroid_gref_log (message); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= osBridge._monodroid_gref_log (message); ->>>>>>> 87926b42b (Formatting) } int _monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) { -<<<<<<< HEAD -<<<<<<< HEAD - return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); -======= - return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); ->>>>>>> 87926b42b (Formatting) } void _monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { -<<<<<<< HEAD -<<<<<<< HEAD - osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); -======= - osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); ->>>>>>> 87926b42b (Formatting) } int @@ -163,71 +105,31 @@ _monodroid_weak_gref_get () void _monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) { -<<<<<<< HEAD -<<<<<<< HEAD - osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); -======= - osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); ->>>>>>> 87926b42b (Formatting) } void _monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { -<<<<<<< HEAD -<<<<<<< HEAD - osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); -======= - osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); ->>>>>>> 87926b42b (Formatting) } void _monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { -<<<<<<< HEAD -<<<<<<< HEAD osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); -======= - osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= - osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); ->>>>>>> 87926b42b (Formatting) } void _monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) { -<<<<<<< HEAD -<<<<<<< HEAD osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); -======= - osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= - osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); ->>>>>>> 87926b42b (Formatting) } void _monodroid_gc_wait_for_bridge_processing () { -<<<<<<< HEAD -<<<<<<< HEAD mono_gc_wait_for_bridge_processing (); -======= - mono_gc_wait_for_bridge_processing (); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= - mono_gc_wait_for_bridge_processing (); ->>>>>>> 87926b42b (Formatting) } <<<<<<< HEAD @@ -235,47 +137,21 @@ _monodroid_gc_wait_for_bridge_processing () int _monodroid_get_android_api_level () { -<<<<<<< HEAD -<<<<<<< HEAD return monodroidRuntime.get_android_api_level (); -======= - return monodroidRuntime.get_android_api_level (); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= - return monodroidRuntime.get_android_api_level (); ->>>>>>> 87926b42b (Formatting) } >>>>>>> badc53112 (Let's see what breaks) void monodroid_clear_gdb_wait () { -<<<<<<< HEAD -<<<<<<< HEAD monodroidRuntime.set_monodroid_gdb_wait (false); -======= - monodroidRuntime.set_monodroid_gdb_wait (false); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= - monodroidRuntime.set_monodroid_gdb_wait (false); ->>>>>>> 87926b42b (Formatting) } void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v) { -<<<<<<< HEAD -<<<<<<< HEAD - intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); - return (void*) rv; -======= - intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); - return (void*) rv; ->>>>>>> 13ba4b152 (Let's see what breaks) -======= intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); return (void*) rv; ->>>>>>> 87926b42b (Formatting) } void* @@ -433,15 +309,7 @@ monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports) https://github.com/dotnet/java-interop/blob/master/src/java-interop/java-interop-gc-bridge-mono.c#L266 it should also accept libmono_path = nullptr parameter -<<<<<<< HEAD -<<<<<<< HEAD - */ -======= -*/ ->>>>>>> 13ba4b152 (Let's see what breaks) -======= */ ->>>>>>> 87926b42b (Formatting) int monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path) { diff --git a/src/native/pinvoke-override/CMakeLists.txt b/src/native/pinvoke-override/CMakeLists.txt index 11b69cfecfc..82dd535fafe 100644 --- a/src/native/pinvoke-override/CMakeLists.txt +++ b/src/native/pinvoke-override/CMakeLists.txt @@ -35,11 +35,8 @@ macro(create_library _libname _alias _sources) add_library(${_alias} ALIAS ${_libname}) -<<<<<<< HEAD set_static_library_suffix(${_libname}) -======= ->>>>>>> 13ba4b152 (Let's see what breaks) target_compile_definitions( ${_libname} PRIVATE diff --git a/src/native/pinvoke-override/common.cc b/src/native/pinvoke-override/common.cc index 8c9dcad7f6e..aaf56d38ee7 100644 --- a/src/native/pinvoke-override/common.cc +++ b/src/native/pinvoke-override/common.cc @@ -3,12 +3,4 @@ using namespace xamarin::android; PinvokeOverride::pinvoke_library_map PinvokeOverride::other_pinvoke_map (PinvokeOverride::LIBRARY_MAP_INITIAL_BUCKET_COUNT); -<<<<<<< HEAD -<<<<<<< HEAD xamarin::android::mutex PinvokeOverride::pinvoke_map_write_lock; -======= -std::mutex PinvokeOverride::pinvoke_map_write_lock; ->>>>>>> 13ba4b152 (Let's see what breaks) -======= -xamarin::android::mutex PinvokeOverride::pinvoke_map_write_lock; ->>>>>>> da87011a5 (Fix post-rebase issues and conflicts) diff --git a/src/native/pinvoke-override/pinvoke-override-api.hh b/src/native/pinvoke-override/pinvoke-override-api.hh index 115e84b2951..445f8cccf0b 100644 --- a/src/native/pinvoke-override/pinvoke-override-api.hh +++ b/src/native/pinvoke-override/pinvoke-override-api.hh @@ -78,11 +78,7 @@ namespace xamarin::android { static void* monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name); private: -<<<<<<< HEAD static xamarin::android::mutex pinvoke_map_write_lock; -======= - static xamarin::android::mutex pinvoke_map_write_lock; ->>>>>>> da87011a5 (Fix post-rebase issues and conflicts) static pinvoke_library_map other_pinvoke_map; #if defined(PRECOMPILED) diff --git a/src/native/pinvoke-override/pinvoke-tables.include b/src/native/pinvoke-override/pinvoke-tables.include index d8b99f5946e..dc4f761d8c8 100644 --- a/src/native/pinvoke-override/pinvoke-tables.include +++ b/src/native/pinvoke-override/pinvoke-tables.include @@ -5,8 +5,6 @@ // A compiler with support for C++20 ranges is required // -<<<<<<< HEAD -<<<<<<< HEAD #include #include @@ -544,2075 +542,21 @@ namespace { {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, }}; -======= -======= -#include ->>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) -#include - -namespace { -#if INTPTR_MAX == INT64_MAX -<<<<<<< HEAD -//64-bit internal p/invoke table -static PinvokeEntry internal_pinvokes[] = { - {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, - {0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, - {0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, - {0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, - {0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, - {0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, - {0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, - {0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, - {0x3c5532ecdab53f89, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, - {0x423c8f539a2c56d2, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, - {0x4b1956138764939a, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, - {0x4d5b5b488f736058, "path_combine", reinterpret_cast(&path_combine)}, - {0x5a2614d15e2fdc2e, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, - {0x5f0b4e426eff086b, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, - {0x709af13cbfbe2e75, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, - {0x70ae32c9a4f1ad2c, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, - {0x70fc9bab8d56666d, "create_public_directory", reinterpret_cast(&create_public_directory)}, - {0x78514771a67ad724, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, - {0x9099a4b95e3c3a89, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, - {0x958cdb6fd9d1b67b, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, - {0xa6ec846592d99536, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, - {0xa7f58f3ee428cc6b, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, - {0xae3df96dda0143bd, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, - {0xb6222d90af401865, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, - {0xb8306f71b963cd3d, "monodroid_log", reinterpret_cast(&monodroid_log)}, - {0xbc90bafd5ff9c99e, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, - {0xbe5a300beec69c35, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, - {0xbfbb924fbe190616, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, - {0xc2a21d3f6c8ccc24, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, - {0xc5b4690e13898fa3, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, - {0xcc873ea8493d1dd5, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, - {0xce439cfbe29dec11, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, - {0xd1e121b94ea63f2e, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, - {0xd5151b00eb33d85e, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, - {0xda517ef392b6a888, "java_interop_free", reinterpret_cast(&java_interop_free)}, - {0xe27b9849b7e982cb, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0xe370a0d91cd63bc0, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, - {0xe78f1161604ae672, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, - {0xe86307aac9a2631a, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, - {0xebc2c68e10075cc9, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, - {0xee83e38e479aeff1, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, - {0xf3048baf83034541, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, - {0xf41c48df6f9be476, "monodroid_free", reinterpret_cast(&monodroid_free)}, - {0xf5a918ef520db207, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, - {0xf5ed87b004005892, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, - {0xf8798f762db15bba, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, - {0xfa90326712e7e7c4, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, - {0xfdc17c4ea8335ffd, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0xff010b3140f54d3f, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, -}; -//64-bit DotNet p/invoke table -static PinvokeEntry dotnet_pinvokes[] = { - {0x99f2ee02463000, "CompressionNative_Crc32", nullptr}, - {0xb38afc8bfe830b, "SystemNative_Bind", nullptr}, - {0x190fe65d8736dcb, "SystemNative_TryGetIPPacketInformation", nullptr}, - {0x1c8b86562ad5772, "SystemNative_Receive", nullptr}, - {0x202543f28ecaf06, "SystemNative_Abort", nullptr}, - {0x25abeafa88904a2, "SystemNative_SetPosixSignalHandler", nullptr}, - {0x33158212a812caf, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, - {0x3511e36d0a6c1b5, "SystemNative_LockFileRegion", nullptr}, - {0x375a0e90c77ca35, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, - {0x37b9dd562235e42, "SystemNative_MSync", nullptr}, - {0x3a5df4793dd3230, "SystemNative_INotifyInit", nullptr}, - {0x581df5b0a00c422, "SystemNative_SetRLimit", nullptr}, - {0x598db66ca39c41f, "AndroidCryptoNative_EcKeyUpRef", nullptr}, - {0x5b5ab451ff38f8e, "SystemNative_GetMaximumAddressSize", nullptr}, - {0x656cac62ccc9e3c, "AndroidCryptoNative_X509GetContentType", nullptr}, - {0x6861b5336291d12, "SystemNative_PathConf", nullptr}, - {0x690c4347972024f, "AndroidCryptoNative_Aes256Gcm", nullptr}, - {0x6a1f4deffa02c30, "SystemNative_LowLevelMonitor_Acquire", nullptr}, - {0x7b5579ab0499b1f, "AndroidCryptoNative_RsaSize", nullptr}, - {0x7ce8a9b967dd269, "SystemNative_Read", nullptr}, - {0x7f0e1227c9c0225, "CryptoNative_EvpMdCtxDestroy", nullptr}, - {0x8352ae4bba2b83b, "SystemNative_SetSendTimeout", nullptr}, - {0x98bd27a7461321d, "SystemNative_Dup", nullptr}, - {0x9a39fbf59eed9f9, "CryptoNative_EvpSha1", nullptr}, - {0xa4aeeaff9ca2d10, "BrotliDecoderDecompressStream", nullptr}, - {0xa906c14ca5834bc, "SystemNative_GetEUid", nullptr}, - {0xac9f9c1abb62a92, "SystemNative_Log", nullptr}, - {0xadb2441bcfcdfe9, "SystemNative_CreateThread", nullptr}, - {0xafbf5c69d1badc0, "SystemNative_SetTerminalInvalidationHandler", nullptr}, - {0xba897b7abe67b16, "SystemNative_FcntlSetPipeSz", nullptr}, - {0xc305c22ce7ab8a0, "SystemNative_SetSockOpt", nullptr}, - {0xc79e924361c15ca, "SystemNative_RealPath", nullptr}, - {0xcaba893801c6a6f, "AndroidCryptoNative_Aes256Ecb", nullptr}, - {0xcbe6d3d22131194, "AndroidCryptoNative_SetRsaParameters", nullptr}, - {0xef8dd67e25bac53, "SystemNative_GetWindowSize", nullptr}, - {0xfa0899cf8d00a87, "SystemNative_MkDir", nullptr}, - {0xfe7079441ac127e, "SystemNative_CreateSocketEventPort", nullptr}, - {0x1027786cdd9a3e9c, "AndroidCryptoNative_Aes192Cbc", nullptr}, - {0x10d733abd1fd94bb, "SystemNative_TryChangeSocketEventRegistration", nullptr}, - {0x114b8384553f5418, "SystemNative_GetSystemTimeAsTicks", nullptr}, - {0x11b6f4f0aafeda95, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, - {0x11cc73f2926d4064, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, - {0x121bc483ac26f5f8, "SystemNative_GetGroupName", nullptr}, - {0x12d65f9f65b01497, "SystemNative_GetRawSockOpt", nullptr}, - {0x12eaf09505dc19fd, "SystemNative_FStat", nullptr}, - {0x13577369f5ec4b0a, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, - {0x1399413d8a7d9dd8, "SystemNative_GetAddressFamily", nullptr}, - {0x13a1c2de7fb2519f, "SystemNative_CloseSocketEventPort", nullptr}, - {0x146cd1dc4fb2ba58, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, - {0x14b7e3527b60e83f, "CryptoNative_ErrErrorStringN", nullptr}, - {0x15bd710d3a9b3b0c, "CryptoNative_EvpDigestFinalEx", nullptr}, - {0x176e22ea7c580dae, "SystemNative_ReadDirR", nullptr}, - {0x185f5d25252c3c72, "SystemNative_FAllocate", nullptr}, - {0x18f7da5f584b5b59, "SystemNative_PReadV", nullptr}, - {0x1948a0cf88329c2f, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, - {0x1ac95b02f23933cc, "SystemNative_CanGetHiddenFlag", nullptr}, - {0x1d1bb0528d517729, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, - {0x1d4dcbc06728e689, "SystemNative_Close", nullptr}, - {0x1d6d4278ffbbab77, "SystemNative_Pipe", nullptr}, - {0x1d8d6a688fc5bfb3, "SystemNative_SendFile", nullptr}, - {0x1e6228e955989698, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, - {0x1e8edcc515cd23f9, "CryptoNative_EvpDigestOneShot", nullptr}, - {0x1f1c61a157636aad, "SystemNative_Stat", nullptr}, - {0x1f45ac9d3c6b1554, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, - {0x1f7d2360a1cdcbff, "AndroidCryptoNative_SSLStreamCreate", nullptr}, - {0x1f849e45a3014a9f, "SystemNative_GetIPv6Address", nullptr}, - {0x1f9361fc7b624c1b, "SystemNative_LowLevelMonitor_Wait", nullptr}, - {0x205a31e661496019, "CryptoNative_ErrGetErrorAlloc", nullptr}, - {0x20784dcc7e9cee75, "BrotliGetTransforms", nullptr}, - {0x218fce505a140c55, "AndroidCryptoNative_EcDsaVerify", nullptr}, - {0x2291e0ba4e1b55b0, "SystemNative_LStat", nullptr}, - {0x23ac2a4c4d1c744e, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, - {0x24f840f903a26ded, "SystemNative_ConvertErrorPalToPlatform", nullptr}, - {0x24ff74e427d0626e, "SystemNative_GetErrNo", nullptr}, - {0x254905036a0061cf, "SystemNative_CreateSocketEventBuffer", nullptr}, - {0x255c4a2e297fd9f5, "SystemNative_INotifyAddWatch", nullptr}, - {0x267c94097a3bf1f3, "AndroidCryptoNative_CipherDestroy", nullptr}, - {0x27944922cd8283ca, "CryptoNative_EvpSha384", nullptr}, - {0x2795a01c2c64aea1, "CryptoNative_HmacReset", nullptr}, - {0x27f3d9266af2b315, "SystemNative_GetIPv4Address", nullptr}, - {0x2925953889c48cab, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, - {0x2a49948ae20571cb, "SystemNative_SchedGetAffinity", nullptr}, - {0x2c352dd7c367e438, "CryptoNative_EvpSha512", nullptr}, - {0x2c7e5e179cc917cb, "AndroidCryptoNative_DsaSizeSignature", nullptr}, - {0x2c8da1192c5d7d2b, "SystemNative_FLock", nullptr}, - {0x2d64b1ac218cf29e, "SystemNative_AlignedRealloc", nullptr}, - {0x2e1102c297588e10, "BrotliEncoderDestroyInstance", nullptr}, - {0x2e429d96a9fc92bd, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, - {0x2fdcf708ff792105, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, - {0x307db94ae9f929e5, "CryptoNative_GetMaxMdSize", nullptr}, - {0x31027564deeb71b0, "AndroidCryptoNative_Aes128Cbc", nullptr}, - {0x3319a5483b3cc1fc, "SystemNative_GetRLimit", nullptr}, - {0x3424ffcb69ecef57, "SystemNative_Unlink", nullptr}, - {0x346a9bb11364833c, "SystemNative_DrainAutoreleasePool", nullptr}, - {0x35169e67cc0f8529, "SystemNative_GetIPv6MulticastOption", nullptr}, - {0x359205b4a10fa780, "SystemNative_LowLevelMonitor_Destroy", nullptr}, - {0x35c1fa8dffcbbd8c, "CryptoNative_EvpDigestReset", nullptr}, - {0x36128eed665b1923, "SystemNative_ShmUnlink", nullptr}, - {0x364dcf65ae63adff, "SystemNative_GetSocketErrorOption", nullptr}, - {0x3757b327944abb54, "SystemNative_EnablePosixSignalHandling", nullptr}, - {0x38b4bd21127ceffd, "SystemNative_StrErrorR", nullptr}, - {0x38c7de719e8ae69d, "SystemNative_RmDir", nullptr}, - {0x391bbbb9bbde4455, "SystemNative_SetIPv4MulticastOption", nullptr}, - {0x3a7245f3ea476bf7, "SystemNative_SNPrintF", nullptr}, - {0x3ae92e4198427b0d, "SystemNative_ReadLink", nullptr}, - {0x3e0de839e6cfa6e5, "SystemNative_Accept", nullptr}, - {0x3e7cf9a4789a31c7, "SystemNative_FChflags", nullptr}, - {0x3f19a16a3230b551, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, - {0x3f49b6278f04ae84, "SystemNative_Disconnect", nullptr}, - {0x3fba15600bf0f229, "SystemNative_SetEUid", nullptr}, - {0x401935ffc3454bb1, "AndroidCryptoNative_X509PublicKey", nullptr}, - {0x403e1bc0b3baba84, "CompressionNative_Inflate", nullptr}, - {0x40bfa1211f5f6f9c, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, - {0x41b6e7f32da99fa9, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, - {0x41c169fb0e30a390, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, - {0x41c1f2c9153639af, "SystemNative_FUTimens", nullptr}, - {0x420718c398131a55, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, - {0x42339dd2717504d9, "SystemNative_GetLingerOption", nullptr}, - {0x42783107bf2935ec, "SystemNative_FreeHostEntry", nullptr}, - {0x42eb0578a9d62b78, "SystemNative_GetFormatInfoForMountPoint", nullptr}, - {0x43741165a5ba60d5, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, - {0x44ccb27979f980ce, "SystemNative_AlignedAlloc", nullptr}, - {0x44f1a5c46033eec2, "SystemNative_SysLog", nullptr}, - {0x469898c8d892af83, "BrotliEncoderCompress", nullptr}, - {0x483b434d7b089c7e, "SystemNative_Write", nullptr}, - {0x4845e1c76265acc9, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, - {0x484a3a445bdb14fc, "SystemNative_GetOSArchitecture", nullptr}, - {0x4909639a9d87bdb5, "SystemNative_AlignedFree", nullptr}, - {0x49e3ba95feb79c6c, "SystemNative_SetAddressFamily", nullptr}, - {0x4a7272ac9d117f2d, "AndroidCryptoNative_EcKeyDestroy", nullptr}, - {0x4b00795bbeea6f60, "SystemNative_SetIPv6Address", nullptr}, - {0x4be7ceca50f3298c, "SystemNative_LowLevelMonitor_Create", nullptr}, - {0x4bec4a1d7dfd4cf7, "SystemNative_GetUnixRelease", nullptr}, - {0x4bfff22801b209ca, "SystemNative_LChflags", nullptr}, - {0x4c22cc4f2b1dab26, "SystemNative_SetPriority", nullptr}, - {0x4c5d96426f92c29d, "CryptoNative_HmacUpdate", nullptr}, - {0x4d6361e5095cff36, "AndroidCryptoNative_DsaSign", nullptr}, - {0x4d74053b37e582fa, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, - {0x501daf7e3a890220, "AndroidCryptoNative_X509ChainBuild", nullptr}, - {0x523240c01d14ad50, "SystemNative_GetPeerID", nullptr}, - {0x52794f1118d32f08, "SystemNative_GetUnixVersion", nullptr}, - {0x52fc107ebdb6fcc7, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, - {0x5381564d2c06c0a3, "SystemNative_SysConf", nullptr}, - {0x556bc89d2d4dfc85, "SystemNative_GetDeviceIdentifiers", nullptr}, - {0x558250d199e906bb, "CryptoNative_ErrReasonErrorString", nullptr}, - {0x5592a052ceb4caf6, "SystemNative_GetProcessPath", nullptr}, - {0x55fe2620f63d83d8, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, - {0x574d77a68ec3e488, "SystemNative_GetEnv", nullptr}, - {0x5755d1cd0c158620, "BrotliDecoderSetParameter", nullptr}, - {0x580dda20ac9e83c6, "BrotliEncoderSetParameter", nullptr}, - {0x583db0344a1cd715, "SystemNative_GetActiveUdpListeners", nullptr}, - {0x5908581fe73717f0, "SystemNative_InterfaceNameToIndex", nullptr}, - {0x5916efc3e1e49137, "CryptoNative_ErrPeekError", nullptr}, - {0x5a114024ecd1162c, "CryptoNative_EvpDigestUpdate", nullptr}, - {0x5a305cf2a314d6a6, "SystemNative_FTruncate", nullptr}, - {0x5a337d9cc7d8bcfd, "CryptoNative_HmacCurrent", nullptr}, - {0x5d503db70d17dad2, "BrotliEncoderIsFinished", nullptr}, - {0x5dd1d1d024378765, "CryptoNative_EvpMdSize", nullptr}, - {0x5e53b688fede3216, "SystemNative_GetControlCharacters", nullptr}, - {0x5fa62856bdbba9c0, "SystemNative_GetPort", nullptr}, - {0x5fd29ac523ff6e3d, "AndroidCryptoNative_SSLStreamRelease", nullptr}, - {0x5ffae3c8023a80b8, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, - {0x600b4418896f7808, "SystemNative_Exit", nullptr}, - {0x6089f0c8112eb3d9, "SystemNative_InitializeConsoleBeforeRead", nullptr}, - {0x613307e537d462db, "SystemNative_GetReadDirRBufferSize", nullptr}, - {0x61bacd7170fd8c9b, "SystemNative_SchedSetAffinity", nullptr}, - {0x61f3ce1b18b20d6f, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, - {0x62351df42d842942, "SystemNative_GetSignalForBreak", nullptr}, - {0x6393d30aceaa6df2, "SystemNative_PWriteV", nullptr}, - {0x639e6e938ec8d9f2, "SystemNative_GetPeerUserName", nullptr}, - {0x6448f0806bd3a338, "SystemNative_FreeEnviron", nullptr}, - {0x648a9b317bc64fe0, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, - {0x650eddee76c6b8da, "SystemNative_GetHostName", nullptr}, - {0x652badfba5d61929, "SystemNative_FcntlSetFD", nullptr}, - {0x66e049fe27bf91ea, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, - {0x6792c0a7ea5d19c9, "BrotliEncoderTakeOutput", nullptr}, - {0x67a8868ef592a3fd, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, - {0x67a9b5bbce322f8c, "AndroidCryptoNative_Des3Cbc", nullptr}, - {0x67d2cd86792b1d0c, "SystemNative_Realloc", nullptr}, - {0x67e9d60481f4be06, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, - {0x68df81a8fb5bf442, "SystemNative_GetSockOpt", nullptr}, - {0x68f3fe6083c0355b, "SystemNative_GetLoadLibraryError", nullptr}, - {0x69ad99fac0467f64, "SystemNative_Link", nullptr}, - {0x6a59d9242cd31785, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, - {0x6b9097385aa77917, "SystemNative_FSync", nullptr}, - {0x6b9bce16ba8e845f, "SystemNative_Malloc", nullptr}, - {0x6d566e1f6e5a2d8f, "BrotliDefaultAllocFunc", nullptr}, - {0x6dbd90e9cc86310b, "AndroidCryptoNative_CipherFinalEx", nullptr}, - {0x6dfd40c2dd0d7382, "AndroidCryptoNative_RsaUpRef", nullptr}, - {0x6e2c1caff08e6e2d, "SystemNative_ReadStdin", nullptr}, - {0x6ee05d5e8650e56c, "SystemNative_DisablePosixSignalHandling", nullptr}, - {0x6f990f1f7bc80630, "AndroidCryptoNative_RsaCreate", nullptr}, - {0x70f907b97d3fe059, "AndroidCryptoNative_Aes192Ccm", nullptr}, - {0x7150f0eb40797bb3, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, - {0x724820d307055ed1, "CryptoNative_HmacFinal", nullptr}, - {0x729afe37cdb8ae8f, "SystemNative_Connect", nullptr}, - {0x730ae9a7469a7321, "SystemNative_GetAllMountPoints", nullptr}, - {0x7356b141407d261e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, - {0x742da00b2dbf435d, "SystemNative_LoadLibrary", nullptr}, - {0x74ec4a8d869776ad, "AndroidCryptoNative_Aes128Ccm", nullptr}, - {0x758dfbf057da0da0, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, - {0x7975d1d7029cf1a3, "AndroidCryptoNative_Aes128Gcm", nullptr}, - {0x79f5c24afbd04af1, "AndroidCryptoNative_Aes256Cbc", nullptr}, - {0x7a37e0d077f2dfe5, "AndroidCryptoNative_DsaGenerateKey", nullptr}, - {0x7af1f52a7a632e95, "BrotliDecoderTakeOutput", nullptr}, - {0x7d5273ad530e7298, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, - {0x7d7ee4bce74d4de9, "SystemNative_GetDomainSocketSizes", nullptr}, - {0x7e1766c6df3ad261, "SystemNative_MUnmap", nullptr}, - {0x7e4bdf46d4ff9f11, "SystemNative_MkNod", nullptr}, - {0x7ec328b6ba9eab8a, "SystemNative_WaitForSocketEvents", nullptr}, - {0x7fa96d0284954375, "AndroidCryptoNative_X509Decode", nullptr}, - {0x80ef5040fdcc248d, "BrotliEncoderMaxCompressedSize", nullptr}, - {0x813bedf08c3388d4, "AndroidCryptoNative_Aes128Cfb8", nullptr}, - {0x84b5542f0da03584, "SystemNative_GetIPSocketAddressSizes", nullptr}, - {0x84c8a7489b37fea0, "SystemNative_GetPlatformSignalNumber", nullptr}, - {0x84cc0301870c37ce, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, - {0x8502eeba98158e79, "SystemNative_FcntlSetIsNonBlocking", nullptr}, - {0x8530d37777969db6, "SystemNative_SetKeypadXmit", nullptr}, - {0x8537eeb56d41402b, "CompressionNative_DeflateReset", nullptr}, - {0x85d0033bc38bb4bb, "SystemNative_MAdvise", nullptr}, - {0x868e09dc7dfea364, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, - {0x870191ad244b8069, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, - {0x87019b7831c0c34c, "AndroidCryptoNative_Aes192Gcm", nullptr}, - {0x87c447e7f873cff0, "AndroidCryptoNative_X509ChainValidate", nullptr}, - {0x889350f209555ecb, "SystemNative_MkdTemp", nullptr}, - {0x88a08b60b80c70cc, "SystemNative_FChMod", nullptr}, - {0x88cfeefc903f9d60, "CryptoNative_EvpDigestCurrent", nullptr}, - {0x8bcabce135063bed, "SystemNative_OpenDir", nullptr}, - {0x8df448aee6e8fa5e, "SystemNative_WaitPidExitedNoHang", nullptr}, - {0x8e96cb02418947cc, "SystemNative_FcntlGetPipeSz", nullptr}, - {0x8fb6ed14ee0256bc, "SystemNative_GetTimestamp", nullptr}, - {0x8ffe2d950d138c01, "SystemNative_SchedGetCpu", nullptr}, - {0x9039632237d70ae7, "AndroidCryptoNative_NewGlobalReference", nullptr}, - {0x9161ade1206fd86e, "AndroidCryptoNative_Aes256Cfb128", nullptr}, - {0x9167a072639a7c95, "AndroidCryptoNative_Aes256Ccm", nullptr}, - {0x91f065ec0d3aec55, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, - {0x93a8bec488055608, "SystemNative_GetPwNamR", nullptr}, - {0x95a0e2fc5c0cb49e, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, - {0x95a4cb8563cc6b14, "SystemNative_ShmOpen", nullptr}, - {0x9856fa59ed936b73, "SystemNative_GetSid", nullptr}, - {0x996ada1c038aabba, "SystemNative_MksTemps", nullptr}, - {0x9991a277809ef205, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, - {0x99a840c495204202, "SystemNative_GetBytesAvailable", nullptr}, - {0x99e3660fc483d7be, "CryptoNative_GetRandomBytes", nullptr}, - {0x9aa9eaee3dd8b23b, "SystemNative_GetIPv4MulticastOption", nullptr}, - {0x9aaaad33b28af82f, "SystemNative_SetSignalForBreak", nullptr}, - {0x9aab07f824659d3e, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, - {0x9c3e8b890033819a, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, - {0x9c832cd7fcbf2de0, "SystemNative_MkFifo", nullptr}, - {0x9d2cb31282abd3d9, "SystemNative_GetNetworkInterfaces", nullptr}, - {0x9e25ebf4f61cc299, "SystemNative_ChDir", nullptr}, - {0x9e79166979634030, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, - {0x9edddf30d660eff4, "AndroidCryptoNative_Aes192Ecb", nullptr}, - {0x9fb01da1222e905a, "SystemNative_IsATty", nullptr}, - {0xa1e881a63614507e, "SystemNative_INotifyRemoveWatch", nullptr}, - {0xa2254fea4d8b6909, "SystemNative_MMap", nullptr}, - {0xa272b5349013d9ef, "CryptoNative_EvpSha256", nullptr}, - {0xa2d7790a850024c0, "SystemNative_GetNumRoutes", nullptr}, - {0xa302613a430248b8, "SystemNative_GetGroups", nullptr}, - {0xa308025a784497df, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, - {0xa56532a23755cd87, "SystemNative_StdinReady", nullptr}, - {0xa56954e28eb9a9c9, "AndroidCryptoNative_Des3Cfb8", nullptr}, - {0xa57e18f82abd5958, "BrotliDecoderDestroyInstance", nullptr}, - {0xa5eda72b95fe78c3, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, - {0xa89b70c38d3ba079, "CryptoNative_HmacCreate", nullptr}, - {0xa89ec9958d999483, "SystemNative_GetCwd", nullptr}, - {0xa8bdc3e7ee898dfc, "SystemNative_Shutdown", nullptr}, - {0xa93eb533acf7564d, "AndroidCryptoNative_DesEcb", nullptr}, - {0xa961e8db31830e16, "AndroidCryptoNative_Aes192Cfb8", nullptr}, - {0xabdcf2f74d210f35, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, - {0xac11eab9d9c31b01, "SystemNative_UTimensat", nullptr}, - {0xac7725c652a5fb5b, "SystemNative_CopyFile", nullptr}, - {0xad1a2d6575cdd4e3, "AndroidCryptoNative_SSLStreamWrite", nullptr}, - {0xad228cdc4edb11d6, "SystemNative_CloseDir", nullptr}, - {0xadc6889903a2d6f4, "SystemNative_Rename", nullptr}, - {0xae320903718eb45d, "SystemNative_MapTcpState", nullptr}, - {0xaf72b94c4acee897, "BrotliDecoderHasMoreOutput", nullptr}, - {0xaf9706efc72c3904, "SystemNative_SetIPv6MulticastOption", nullptr}, - {0xafd9f6338cdbadd4, "SystemNative_GetHostEntryForName", nullptr}, - {0xafe3d21bbaa71464, "CompressionNative_DeflateEnd", nullptr}, - {0xb0b66a7145de350d, "SystemNative_Access", nullptr}, - {0xb0df46ff09c57741, "AndroidCryptoNative_GetRsaParameters", nullptr}, - {0xb0e18377ed603e0b, "SystemNative_GetGroupList", nullptr}, - {0xb1c394b9992bd67d, "AndroidCryptoNative_EcDsaSign", nullptr}, - {0xb1ff12f3bd735982, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, - {0xb361006446f560e8, "SystemNative_LogError", nullptr}, - {0xb3e1e5e50cde576e, "BrotliEncoderVersion", nullptr}, - {0xb41fa43cc5c261cb, "BrotliDecoderGetErrorCode", nullptr}, - {0xb4996dd1aba38200, "AndroidCryptoNative_EcDsaSize", nullptr}, - {0xb516027cb59e6541, "BrotliDecoderIsFinished", nullptr}, - {0xb575ec01a7a79f8f, "AndroidCryptoNative_DesCfb8", nullptr}, - {0xb600c44028c1743d, "SystemNative_Socket", nullptr}, - {0xb632e9bc6f7be0a9, "SystemNative_GetSockName", nullptr}, - {0xb6540b73eff28747, "SystemNative_SetRawSockOpt", nullptr}, - {0xb66be1550d27bfb4, "AndroidCryptoNative_GetECCurveParameters", nullptr}, - {0xb69c3cc8b9f6a724, "BrotliDecoderIsUsed", nullptr}, - {0xb6ab9abf7887911f, "SystemNative_ReadEvents", nullptr}, - {0xb73c597de01bc0b2, "SystemNative_GetPwUidR", nullptr}, - {0xb78af5975603cd20, "SystemNative_Sync", nullptr}, - {0xb7bbbe2c16a565c6, "SystemNative_Calloc", nullptr}, - {0xb828d9e7df5437a5, "BrotliDecoderErrorString", nullptr}, - {0xba2f6d298f3be8bc, "CryptoNative_EvpMd5", nullptr}, - {0xbb3343826d504870, "SystemNative_GetBootTimeTicks", nullptr}, - {0xbb5e970ecb6745da, "SystemNative_SymLink", nullptr}, - {0xbbd20cce92ec2c12, "SystemNative_FcntlGetFD", nullptr}, - {0xbcd9e53d2d288094, "SystemNative_GetNameInfo", nullptr}, - {0xbd5a0be2f7904089, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, - {0xbd89ef4df5486744, "SystemNative_Send", nullptr}, - {0xbdbbd2898347c0d1, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, - {0xbdd3128e77381b01, "SystemNative_EnumerateInterfaceAddresses", nullptr}, - {0xbe8df478de07c6d8, "BrotliDefaultFreeFunc", nullptr}, - {0xc00ebc097b776c1f, "SystemNative_GetPriority", nullptr}, - {0xc036b23d88fad91b, "SystemNative_iOSSupportVersion", nullptr}, - {0xc0bb2dd0c5b74436, "CryptoNative_EnsureOpenSslInitialized", nullptr}, - {0xc10e411c989a9314, "CompressionNative_Deflate", nullptr}, - {0xc11cd661db8be230, "AndroidCryptoNative_Des3Cfb64", nullptr}, - {0xc183a0550feea0d6, "BrotliEncoderCompressStream", nullptr}, - {0xc19b94823ea1d39e, "CryptoNative_HmacOneShot", nullptr}, - {0xc1b8a5f1c799e4bb, "BrotliGetDictionary", nullptr}, - {0xc1c679eefc134d31, "SystemNative_LowLevelMonitor_Release", nullptr}, - {0xc2d5e1c465b2f5b6, "AndroidCryptoNative_DsaSizeP", nullptr}, - {0xc3145e336c38379b, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, - {0xc3c10021b10ba455, "SystemNative_GetEGid", nullptr}, - {0xc3fe9394fe1f3f02, "SystemNative_GetSocketType", nullptr}, - {0xc560d9947ab2a34d, "SystemNative_RegisterForSigChld", nullptr}, - {0xc5bed971846027de, "SystemNative_GetCpuUtilization", nullptr}, - {0xc69433678dd341ca, "SystemNative_ForkAndExecProcess", nullptr}, - {0xc7815e0476511544, "AndroidCryptoNative_X509Encode", nullptr}, - {0xc7ae1b8d93af5d73, "SystemNative_ChMod", nullptr}, - {0xc7d536c0e7eb3fe2, "SystemNative_FreeSocketEventBuffer", nullptr}, - {0xc7f81d5b58b65ac0, "BrotliEncoderCreateInstance", nullptr}, - {0xc87a5ee4869035c6, "SystemNative_UninitializeConsoleAfterRead", nullptr}, - {0xc8a52a8b6d96b32b, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, - {0xc93df58ae5457bfd, "SystemNative_GetControlMessageBufferSize", nullptr}, - {0xc956e528f995739c, "SystemNative_ReceiveMessage", nullptr}, - {0xca001af79c0d7a8b, "CompressionNative_InflateEnd", nullptr}, - {0xca48c3927c202794, "AndroidCryptoNative_GetECKeyParameters", nullptr}, - {0xcaae6d345ba32c7b, "SystemNative_Kill", nullptr}, - {0xcaec08aa13779f7f, "SystemNative_GetEnviron", nullptr}, - {0xcaf599a20538b10b, "SystemNative_SetWindowSize", nullptr}, - {0xcb4bcdafdc81d116, "AndroidCryptoNative_CipherCreatePartial", nullptr}, - {0xcbbb90469d28cded, "SystemNative_SearchPath", nullptr}, - {0xcc433093c073719e, "AndroidCryptoNative_SSLStreamRead", nullptr}, - {0xcc43d880192dd6ff, "SystemNative_ConvertErrorPlatformToPal", nullptr}, - {0xcc788c0474c3e178, "SystemNative_LSeek", nullptr}, - {0xcd5d8a63493f5e38, "CompressionNative_InflateInit2_", nullptr}, - {0xcdcb014df9a6eae2, "SystemNative_SetPort", nullptr}, - {0xce36e2e1a139a020, "SystemNative_GetDefaultTimeZone", nullptr}, - {0xce6ddfe40fed99d9, "SystemNative_PRead", nullptr}, - {0xce9f8a6ac705faa5, "AndroidCryptoNative_X509DecodeCollection", nullptr}, - {0xceba527295694651, "BrotliDecoderCreateInstance", nullptr}, - {0xd392d6ed5dcc111c, "SystemNative_GetDomainName", nullptr}, - {0xd55437b16dc84f3b, "SystemNative_GetIPv4GlobalStatistics", nullptr}, - {0xd5c063a90ae882c1, "AndroidCryptoNative_CipherIsSupported", nullptr}, - {0xd7d818c7640598dc, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, - {0xd7f1a8f616897ace, "AndroidCryptoNative_Aes256Cfb8", nullptr}, - {0xd88be8f9e9f28e90, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, - {0xd8976692c4c68818, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, - {0xd8a9e47b6ca78448, "CryptoNative_ErrPeekLastError", nullptr}, - {0xd9bd0b370726ce34, "AndroidCryptoNative_CipherReset", nullptr}, - {0xda05c57c78aa6706, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, - {0xda38bffa1d16cdd6, "SystemNative_SetLingerOption", nullptr}, - {0xda4898a26933f73d, "AndroidCryptoNative_DsaVerify", nullptr}, - {0xda6b3192974ca60e, "SystemNative_Open", nullptr}, - {0xdab5eb45815daabc, "SystemNative_GetAtOutOfBandMark", nullptr}, - {0xdae32aac0c0d305c, "SystemNative_ReadProcessStatusInfo", nullptr}, - {0xdbb4752ed23670f0, "AndroidCryptoNative_DesCbc", nullptr}, - {0xdbee22594fa8c585, "SystemNative_CreateAutoreleasePool", nullptr}, - {0xdc51159ffe70b0e0, "BrotliDecoderVersion", nullptr}, - {0xdd4c03f06ce96e04, "AndroidCryptoNative_RsaDestroy", nullptr}, - {0xdde06993f87d6ffc, "AndroidCryptoNative_Aes128Cfb128", nullptr}, - {0xde1e22dd097f799c, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, - {0xde259001bf54e6f1, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, - {0xdec5c7544d2c8cb1, "AndroidCryptoNative_GetDsaParameters", nullptr}, - {0xdf650444c8af0763, "SystemNative_FcntlGetIsNonBlocking", nullptr}, - {0xdfede2defd776f7e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, - {0xe059239741e0011a, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, - {0xe0a170d2b947a8fc, "SystemNative_SendMessage", nullptr}, - {0xe0a601fd89d9b279, "SystemNative_SetErrNo", nullptr}, - {0xe0f34ce89fd38aef, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, - {0xe20c29fb8b19da7b, "SystemNative_Listen", nullptr}, - {0xe36a157177b2db08, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, - {0xe44f737a5bebdd90, "SystemNative_SetIPv4Address", nullptr}, - {0xe582a4a60bb74c35, "SystemNative_GetProcAddress", nullptr}, - {0xe604fca300068c0c, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, - {0xe6838f2add787bfe, "SystemNative_FreeLibrary", nullptr}, - {0xe73aeaf9e3a10343, "SystemNative_PWrite", nullptr}, - {0xe78ff100d1d73d99, "SystemNative_SetReceiveTimeout", nullptr}, - {0xe853ecfe4d402ed0, "SystemNative_Poll", nullptr}, - {0xea5e6653389b924a, "CompressionNative_DeflateInit2_", nullptr}, - {0xea61d6c040267b2d, "BrotliSetDictionaryData", nullptr}, - {0xeaafb7963ceb9bf4, "SystemNative_GetTcpGlobalStatistics", nullptr}, - {0xeab45239fb3f138d, "AndroidCryptoNative_GetBigNumBytes", nullptr}, - {0xead798b3c60b390e, "CompressionNative_InflateReset", nullptr}, - {0xec67e4076662c2de, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, - {0xef71ee101b3ece96, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, - {0xeff5d014640ae969, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, - {0xf0045895a9043221, "SystemNative_SearchPath_TempDirectory", nullptr}, - {0xf0ec052da6c5fa70, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, - {0xf1577384f409ea85, "AndroidCryptoNative_BigNumToBinary", nullptr}, - {0xf2c7fa39bf166188, "SystemNative_Free", nullptr}, - {0xf38b47e43f352491, "SystemNative_GetUdpGlobalStatistics", nullptr}, - {0xf432f105a045b088, "CryptoNative_ErrClearError", nullptr}, - {0xf4dea312f71c5ff2, "AndroidCryptoNative_Aes128Ecb", nullptr}, - {0xf4f5526ddc32beac, "CryptoNative_HmacDestroy", nullptr}, - {0xf57f81262f07542c, "AndroidCryptoNative_Des3Ecb", nullptr}, - {0xf6ede5d5d8729315, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, - {0xf75d4fdd6e749a84, "BrotliTransformDictionaryWord", nullptr}, - {0xf7b334768844b502, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, - {0xf85b8ffeba9b06c1, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, - {0xf870179a8d8d1872, "SystemNative_PosixFAdvise", nullptr}, - {0xf8c983dd21ef9fe6, "SystemNative_GetPid", nullptr}, - {0xf96bc1e7e15e69f2, "AndroidCryptoNative_CipherUpdate", nullptr}, - {0xf970881d4fa83e07, "AndroidCryptoNative_CipherCreate", nullptr}, - {0xf9c3d216226b3355, "AndroidCryptoNative_CipherSetTagLength", nullptr}, - {0xf9dea6e72f1fffc9, "CryptoNative_EvpMdCtxCreate", nullptr}, - {0xfa26b86cedf66721, "SystemNative_Sysctl", nullptr}, - {0xfaa7766eaa2c54a5, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, - {0xfb3e394cc613f202, "SystemNative_GetPeerName", nullptr}, - {0xfbb57319454b1074, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, - {0xfc0bad2b1528000f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, - {0xfcdeea476953780c, "AndroidCryptoNative_Aes192Cfb128", nullptr}, - {0xfd2cdd99f11de76c, "AndroidCryptoNative_EcKeyGetSize", nullptr}, - {0xfd4f2784ec1c98aa, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, - {0xfe3dd06281f7cd1f, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, - {0xff28b3bec4f32a2c, "SystemNative_GetFileSystemType", nullptr}, - {0xff9b8d95b0e209fb, "BrotliEncoderHasMoreOutput", nullptr}, - {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, -}; ->>>>>>> 13ba4b152 (Let's see what breaks) -======= - //64-bit internal p/invoke table - std::array internal_pinvokes {{ - {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, - {0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, - {0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, - {0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, - {0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, - {0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, - {0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, - {0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, - {0x3c5532ecdab53f89, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, - {0x423c8f539a2c56d2, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, - {0x4b1956138764939a, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, - {0x4d5b5b488f736058, "path_combine", reinterpret_cast(&path_combine)}, - {0x5a2614d15e2fdc2e, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, - {0x5f0b4e426eff086b, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, - {0x709af13cbfbe2e75, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, - {0x70ae32c9a4f1ad2c, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, - {0x70fc9bab8d56666d, "create_public_directory", reinterpret_cast(&create_public_directory)}, - {0x78514771a67ad724, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, - {0x9099a4b95e3c3a89, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, - {0x958cdb6fd9d1b67b, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, - {0xa6ec846592d99536, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, - {0xa7f58f3ee428cc6b, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, - {0xae3df96dda0143bd, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, - {0xb6222d90af401865, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, - {0xb8306f71b963cd3d, "monodroid_log", reinterpret_cast(&monodroid_log)}, - {0xbc90bafd5ff9c99e, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, - {0xbe5a300beec69c35, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, - {0xbfbb924fbe190616, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, - {0xc2a21d3f6c8ccc24, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, - {0xc5b4690e13898fa3, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, - {0xcc873ea8493d1dd5, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, - {0xce439cfbe29dec11, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, - {0xd1e121b94ea63f2e, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, - {0xd5151b00eb33d85e, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, - {0xda517ef392b6a888, "java_interop_free", reinterpret_cast(&java_interop_free)}, - {0xe27b9849b7e982cb, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0xe370a0d91cd63bc0, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, - {0xe78f1161604ae672, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, - {0xe86307aac9a2631a, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, - {0xebc2c68e10075cc9, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, - {0xee83e38e479aeff1, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, - {0xf3048baf83034541, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, - {0xf41c48df6f9be476, "monodroid_free", reinterpret_cast(&monodroid_free)}, - {0xf5a918ef520db207, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, - {0xf5ed87b004005892, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, - {0xf8798f762db15bba, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, - {0xfa90326712e7e7c4, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, - {0xfdc17c4ea8335ffd, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0xff010b3140f54d3f, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, - }}; - - //64-bit DotNet p/invoke table - std::array dotnet_pinvokes {{ - {0x99f2ee02463000, "CompressionNative_Crc32", nullptr}, - {0xb38afc8bfe830b, "SystemNative_Bind", nullptr}, - {0x190fe65d8736dcb, "SystemNative_TryGetIPPacketInformation", nullptr}, - {0x1c8b86562ad5772, "SystemNative_Receive", nullptr}, - {0x202543f28ecaf06, "SystemNative_Abort", nullptr}, - {0x25abeafa88904a2, "SystemNative_SetPosixSignalHandler", nullptr}, - {0x33158212a812caf, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, - {0x3511e36d0a6c1b5, "SystemNative_LockFileRegion", nullptr}, - {0x375a0e90c77ca35, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, - {0x37b9dd562235e42, "SystemNative_MSync", nullptr}, - {0x3a5df4793dd3230, "SystemNative_INotifyInit", nullptr}, - {0x3d24547fa4fc31b, "SystemNative_GetUInt64OSThreadId", nullptr}, - {0x410f8526b1edfc3, "GlobalizationNative_GetLocaleInfoInt", nullptr}, - {0x47302bd7e277183, "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", nullptr}, - {0x581df5b0a00c422, "SystemNative_SetRLimit", nullptr}, - {0x598db66ca39c41f, "AndroidCryptoNative_EcKeyUpRef", nullptr}, - {0x5b5ab451ff38f8e, "SystemNative_GetMaximumAddressSize", nullptr}, - {0x656cac62ccc9e3c, "AndroidCryptoNative_X509GetContentType", nullptr}, - {0x6861b5336291d12, "SystemNative_PathConf", nullptr}, - {0x690c4347972024f, "AndroidCryptoNative_Aes256Gcm", nullptr}, - {0x6a1f4deffa02c30, "SystemNative_LowLevelMonitor_Acquire", nullptr}, - {0x7b5579ab0499b1f, "AndroidCryptoNative_RsaSize", nullptr}, - {0x7ce8a9b967dd269, "SystemNative_Read", nullptr}, - {0x7f0e1227c9c0225, "CryptoNative_EvpMdCtxDestroy", nullptr}, - {0x8352ae4bba2b83b, "SystemNative_SetSendTimeout", nullptr}, - {0x98bd27a7461321d, "SystemNative_Dup", nullptr}, - {0x9a39fbf59eed9f9, "CryptoNative_EvpSha1", nullptr}, - {0xa4aeeaff9ca2d10, "BrotliDecoderDecompressStream", nullptr}, - {0xa906c14ca5834bc, "SystemNative_GetEUid", nullptr}, - {0xac9f9c1abb62a92, "SystemNative_Log", nullptr}, - {0xadb2441bcfcdfe9, "SystemNative_CreateThread", nullptr}, - {0xafbf5c69d1badc0, "SystemNative_SetTerminalInvalidationHandler", nullptr}, - {0xba897b7abe67b16, "SystemNative_FcntlSetPipeSz", nullptr}, - {0xc305c22ce7ab8a0, "SystemNative_SetSockOpt", nullptr}, - {0xc79e924361c15ca, "SystemNative_RealPath", nullptr}, - {0xcaba893801c6a6f, "AndroidCryptoNative_Aes256Ecb", nullptr}, - {0xcbe6d3d22131194, "AndroidCryptoNative_SetRsaParameters", nullptr}, - {0xe7e93cf9237e1f2, "GlobalizationNative_ToAscii", nullptr}, - {0xef8dd67e25bac53, "SystemNative_GetWindowSize", nullptr}, - {0xfa0899cf8d00a87, "SystemNative_MkDir", nullptr}, - {0xfe7079441ac127e, "SystemNative_CreateSocketEventPort", nullptr}, - {0x1027786cdd9a3e9c, "AndroidCryptoNative_Aes192Cbc", nullptr}, - {0x10d733abd1fd94bb, "SystemNative_TryChangeSocketEventRegistration", nullptr}, - {0x114b8384553f5418, "SystemNative_GetSystemTimeAsTicks", nullptr}, - {0x119a38c3e288a233, "SystemNative_SNPrintF_1S", nullptr}, - {0x11b6f4f0aafeda95, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, - {0x11cc73f2926d4064, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, - {0x121bc483ac26f5f8, "SystemNative_GetGroupName", nullptr}, - {0x12d65f9f65b01497, "SystemNative_GetRawSockOpt", nullptr}, - {0x12eaf09505dc19fd, "SystemNative_FStat", nullptr}, - {0x13577369f5ec4b0a, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, - {0x1399413d8a7d9dd8, "SystemNative_GetAddressFamily", nullptr}, - {0x13a1c2de7fb2519f, "SystemNative_CloseSocketEventPort", nullptr}, - {0x146cd1dc4fb2ba58, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, - {0x14b7e3527b60e83f, "CryptoNative_ErrErrorStringN", nullptr}, - {0x15bd710d3a9b3b0c, "CryptoNative_EvpDigestFinalEx", nullptr}, - {0x176e22ea7c580dae, "SystemNative_ReadDirR", nullptr}, - {0x18580a4592ed1ea6, "GlobalizationNative_GetSortKey", nullptr}, - {0x185f5d25252c3c72, "SystemNative_FAllocate", nullptr}, - {0x18d6b5e9fec9b0dc, "SystemNative_Connectx", nullptr}, - {0x18f7da5f584b5b59, "SystemNative_PReadV", nullptr}, - {0x1948a0cf88329c2f, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, - {0x1ac95b02f23933cc, "SystemNative_CanGetHiddenFlag", nullptr}, - {0x1d1bb0528d517729, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, - {0x1d4dcbc06728e689, "SystemNative_Close", nullptr}, - {0x1d6d4278ffbbab77, "SystemNative_Pipe", nullptr}, - {0x1d8d6a688fc5bfb3, "SystemNative_SendFile", nullptr}, - {0x1e6228e955989698, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, - {0x1e8edcc515cd23f9, "CryptoNative_EvpDigestOneShot", nullptr}, - {0x1f1c61a157636aad, "SystemNative_Stat", nullptr}, - {0x1f45ac9d3c6b1554, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, - {0x1f72f52873ced9c9, "GlobalizationNative_InitOrdinalCasingPage", nullptr}, - {0x1f7d2360a1cdcbff, "AndroidCryptoNative_SSLStreamCreate", nullptr}, - {0x1f849e45a3014a9f, "SystemNative_GetIPv6Address", nullptr}, - {0x1f9361fc7b624c1b, "SystemNative_LowLevelMonitor_Wait", nullptr}, - {0x205a31e661496019, "CryptoNative_ErrGetErrorAlloc", nullptr}, - {0x20784dcc7e9cee75, "BrotliGetTransforms", nullptr}, - {0x2178ba302d0c5f1c, "GlobalizationNative_GetCalendars", nullptr}, - {0x218fce505a140c55, "AndroidCryptoNative_EcDsaVerify", nullptr}, - {0x2291e0ba4e1b55b0, "SystemNative_LStat", nullptr}, - {0x23ac2a4c4d1c744e, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, - {0x24f840f903a26ded, "SystemNative_ConvertErrorPalToPlatform", nullptr}, - {0x24ff74e427d0626e, "SystemNative_GetErrNo", nullptr}, - {0x254905036a0061cf, "SystemNative_CreateSocketEventBuffer", nullptr}, - {0x255c4a2e297fd9f5, "SystemNative_INotifyAddWatch", nullptr}, - {0x267c94097a3bf1f3, "AndroidCryptoNative_CipherDestroy", nullptr}, - {0x27944922cd8283ca, "CryptoNative_EvpSha384", nullptr}, - {0x2795a01c2c64aea1, "CryptoNative_HmacReset", nullptr}, - {0x27f3d9266af2b315, "SystemNative_GetIPv4Address", nullptr}, - {0x2925953889c48cab, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, - {0x2a49948ae20571cb, "SystemNative_SchedGetAffinity", nullptr}, - {0x2b45d7cdf6e8e0c7, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, - {0x2c352dd7c367e438, "CryptoNative_EvpSha512", nullptr}, - {0x2c7e5e179cc917cb, "AndroidCryptoNative_DsaSizeSignature", nullptr}, - {0x2c8da1192c5d7d2b, "SystemNative_FLock", nullptr}, - {0x2d64b1ac218cf29e, "SystemNative_AlignedRealloc", nullptr}, - {0x2e1102c297588e10, "BrotliEncoderDestroyInstance", nullptr}, - {0x2e429d96a9fc92bd, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, - {0x2fdcf708ff792105, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, - {0x301c465c1ac0adf9, "SystemNative_MProtect", nullptr}, - {0x307db94ae9f929e5, "CryptoNative_GetMaxMdSize", nullptr}, - {0x31027564deeb71b0, "AndroidCryptoNative_Aes128Cbc", nullptr}, - {0x32e594690358a960, "GlobalizationNative_GetLocaleInfoString", nullptr}, - {0x3319a5483b3cc1fc, "SystemNative_GetRLimit", nullptr}, - {0x3424ffcb69ecef57, "SystemNative_Unlink", nullptr}, - {0x346a9bb11364833c, "SystemNative_DrainAutoreleasePool", nullptr}, - {0x35169e67cc0f8529, "SystemNative_GetIPv6MulticastOption", nullptr}, - {0x359205b4a10fa780, "SystemNative_LowLevelMonitor_Destroy", nullptr}, - {0x35c1fa8dffcbbd8c, "CryptoNative_EvpDigestReset", nullptr}, - {0x36128eed665b1923, "SystemNative_ShmUnlink", nullptr}, - {0x364dcf65ae63adff, "SystemNative_GetSocketErrorOption", nullptr}, - {0x3757b327944abb54, "SystemNative_EnablePosixSignalHandling", nullptr}, - {0x38b4bd21127ceffd, "SystemNative_StrErrorR", nullptr}, - {0x38c7de719e8ae69d, "SystemNative_RmDir", nullptr}, - {0x391bbbb9bbde4455, "SystemNative_SetIPv4MulticastOption", nullptr}, - {0x3a7245f3ea476bf7, "SystemNative_SNPrintF", nullptr}, - {0x3ae92e4198427b0d, "SystemNative_ReadLink", nullptr}, - {0x3e0de839e6cfa6e5, "SystemNative_Accept", nullptr}, - {0x3e7cf9a4789a31c7, "SystemNative_FChflags", nullptr}, - {0x3f19a16a3230b551, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, - {0x3f49b6278f04ae84, "SystemNative_Disconnect", nullptr}, - {0x3fba15600bf0f229, "SystemNative_SetEUid", nullptr}, - {0x401935ffc3454bb1, "AndroidCryptoNative_X509PublicKey", nullptr}, - {0x403e1bc0b3baba84, "CompressionNative_Inflate", nullptr}, - {0x40bfa1211f5f6f9c, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, - {0x40d61d78487edb08, "GlobalizationNative_GetICUVersion", nullptr}, - {0x41b6e7f32da99fa9, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, - {0x41c169fb0e30a390, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, - {0x41c1f2c9153639af, "SystemNative_FUTimens", nullptr}, - {0x420718c398131a55, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, - {0x42339dd2717504d9, "SystemNative_GetLingerOption", nullptr}, - {0x42783107bf2935ec, "SystemNative_FreeHostEntry", nullptr}, - {0x42eb0578a9d62b78, "SystemNative_GetFormatInfoForMountPoint", nullptr}, - {0x4360eb8a25122eee, "GlobalizationNative_StartsWith", nullptr}, - {0x43741165a5ba60d5, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, - {0x44ccb27979f980ce, "SystemNative_AlignedAlloc", nullptr}, - {0x44f1a5c46033eec2, "SystemNative_SysLog", nullptr}, - {0x469898c8d892af83, "BrotliEncoderCompress", nullptr}, - {0x483b434d7b089c7e, "SystemNative_Write", nullptr}, - {0x4845e1c76265acc9, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, - {0x484a3a445bdb14fc, "SystemNative_GetOSArchitecture", nullptr}, - {0x4909639a9d87bdb5, "SystemNative_AlignedFree", nullptr}, - {0x49e3ba95feb79c6c, "SystemNative_SetAddressFamily", nullptr}, - {0x4a7272ac9d117f2d, "AndroidCryptoNative_EcKeyDestroy", nullptr}, - {0x4b00795bbeea6f60, "SystemNative_SetIPv6Address", nullptr}, - {0x4bd4b1c0803c8c55, "GlobalizationNative_GetLocaleName", nullptr}, - {0x4be7ceca50f3298c, "SystemNative_LowLevelMonitor_Create", nullptr}, - {0x4bec4a1d7dfd4cf7, "SystemNative_GetUnixRelease", nullptr}, - {0x4bfff22801b209ca, "SystemNative_LChflags", nullptr}, - {0x4c22cc4f2b1dab26, "SystemNative_SetPriority", nullptr}, - {0x4c5d96426f92c29d, "CryptoNative_HmacUpdate", nullptr}, - {0x4d6361e5095cff36, "AndroidCryptoNative_DsaSign", nullptr}, - {0x4d74053b37e582fa, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, - {0x4f22643b9509cc12, "GlobalizationNative_IsNormalized", nullptr}, - {0x501daf7e3a890220, "AndroidCryptoNative_X509ChainBuild", nullptr}, - {0x507983f11ffec7a8, "GlobalizationNative_GetTimeZoneDisplayName", nullptr}, - {0x509ff12da4e77259, "SystemNative_GetSocketAddressSizes", nullptr}, - {0x523240c01d14ad50, "SystemNative_GetPeerID", nullptr}, - {0x52794f1118d32f08, "SystemNative_GetUnixVersion", nullptr}, - {0x52fc107ebdb6fcc7, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, - {0x5381564d2c06c0a3, "SystemNative_SysConf", nullptr}, - {0x54ec3421ab70a40a, "Java_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate", nullptr}, - {0x556bc89d2d4dfc85, "SystemNative_GetDeviceIdentifiers", nullptr}, - {0x558250d199e906bb, "CryptoNative_ErrReasonErrorString", nullptr}, - {0x5592a052ceb4caf6, "SystemNative_GetProcessPath", nullptr}, - {0x55fe2620f63d83d8, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, - {0x56e982948d00f10d, "GlobalizationNative_IndexOf", nullptr}, - {0x574d77a68ec3e488, "SystemNative_GetEnv", nullptr}, - {0x5755d1cd0c158620, "BrotliDecoderSetParameter", nullptr}, - {0x580dda20ac9e83c6, "BrotliEncoderSetParameter", nullptr}, - {0x583db0344a1cd715, "SystemNative_GetActiveUdpListeners", nullptr}, - {0x5908581fe73717f0, "SystemNative_InterfaceNameToIndex", nullptr}, - {0x5916efc3e1e49137, "CryptoNative_ErrPeekError", nullptr}, - {0x5a114024ecd1162c, "CryptoNative_EvpDigestUpdate", nullptr}, - {0x5a305cf2a314d6a6, "SystemNative_FTruncate", nullptr}, - {0x5a337d9cc7d8bcfd, "CryptoNative_HmacCurrent", nullptr}, - {0x5d503db70d17dad2, "BrotliEncoderIsFinished", nullptr}, - {0x5dd1d1d024378765, "CryptoNative_EvpMdSize", nullptr}, - {0x5e53b688fede3216, "SystemNative_GetControlCharacters", nullptr}, - {0x5fa62856bdbba9c0, "SystemNative_GetPort", nullptr}, - {0x5fd29ac523ff6e3d, "AndroidCryptoNative_SSLStreamRelease", nullptr}, - {0x5ffae3c8023a80b8, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, - {0x600b4418896f7808, "SystemNative_Exit", nullptr}, - {0x6089f0c8112eb3d9, "SystemNative_InitializeConsoleBeforeRead", nullptr}, - {0x613307e537d462db, "SystemNative_GetReadDirRBufferSize", nullptr}, - {0x61bacd7170fd8c9b, "SystemNative_SchedSetAffinity", nullptr}, - {0x61f3ce1b18b20d6f, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, - {0x62351df42d842942, "SystemNative_GetSignalForBreak", nullptr}, - {0x635327a9b09a910d, "GlobalizationNative_NormalizeString", nullptr}, - {0x6393d30aceaa6df2, "SystemNative_PWriteV", nullptr}, - {0x6448f0806bd3a338, "SystemNative_FreeEnviron", nullptr}, - {0x648a9b317bc64fe0, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, - {0x650eddee76c6b8da, "SystemNative_GetHostName", nullptr}, - {0x652badfba5d61929, "SystemNative_FcntlSetFD", nullptr}, - {0x66e049fe27bf91ea, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, - {0x6792c0a7ea5d19c9, "BrotliEncoderTakeOutput", nullptr}, - {0x67a8868ef592a3fd, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, - {0x67a9b5bbce322f8c, "AndroidCryptoNative_Des3Cbc", nullptr}, - {0x67d2cd86792b1d0c, "SystemNative_Realloc", nullptr}, - {0x67e9d60481f4be06, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, - {0x68df81a8fb5bf442, "SystemNative_GetSockOpt", nullptr}, - {0x68f3fe6083c0355b, "SystemNative_GetLoadLibraryError", nullptr}, - {0x69ad99fac0467f64, "SystemNative_Link", nullptr}, - {0x6a59d9242cd31785, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, - {0x6ac3aeecfc75bfad, "GlobalizationNative_GetSortVersion", nullptr}, - {0x6b9097385aa77917, "SystemNative_FSync", nullptr}, - {0x6b9bce16ba8e845f, "SystemNative_Malloc", nullptr}, - {0x6bc18fbbbf267e2a, "SystemNative_ReceiveSocketError", nullptr}, - {0x6d566e1f6e5a2d8f, "BrotliDefaultAllocFunc", nullptr}, - {0x6dbd90e9cc86310b, "AndroidCryptoNative_CipherFinalEx", nullptr}, - {0x6dfd40c2dd0d7382, "AndroidCryptoNative_RsaUpRef", nullptr}, - {0x6e2c1caff08e6e2d, "SystemNative_ReadStdin", nullptr}, - {0x6ee05d5e8650e56c, "SystemNative_DisablePosixSignalHandling", nullptr}, - {0x6f990f1f7bc80630, "AndroidCryptoNative_RsaCreate", nullptr}, - {0x70f907b97d3fe059, "AndroidCryptoNative_Aes192Ccm", nullptr}, - {0x7150f0eb40797bb3, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, - {0x724820d307055ed1, "CryptoNative_HmacFinal", nullptr}, - {0x729afe37cdb8ae8f, "SystemNative_Connect", nullptr}, - {0x730ae9a7469a7321, "SystemNative_GetAllMountPoints", nullptr}, - {0x7356b141407d261e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, - {0x742da00b2dbf435d, "SystemNative_LoadLibrary", nullptr}, - {0x74ec4a8d869776ad, "AndroidCryptoNative_Aes128Ccm", nullptr}, - {0x7559feb379d38da5, "SystemNative_GetTimeZoneData", nullptr}, - {0x758dfbf057da0da0, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, - {0x77ca6a148e5a51d9, "GlobalizationNative_IanaIdToWindowsId", nullptr}, - {0x7975d1d7029cf1a3, "AndroidCryptoNative_Aes128Gcm", nullptr}, - {0x79f5c24afbd04af1, "AndroidCryptoNative_Aes256Cbc", nullptr}, - {0x7a37e0d077f2dfe5, "AndroidCryptoNative_DsaGenerateKey", nullptr}, - {0x7a4d912694906c9c, "GlobalizationNative_ToUnicode", nullptr}, - {0x7af1f52a7a632e95, "BrotliDecoderTakeOutput", nullptr}, - {0x7d5273ad530e7298, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, - {0x7d7ee4bce74d4de9, "SystemNative_GetDomainSocketSizes", nullptr}, - {0x7e1766c6df3ad261, "SystemNative_MUnmap", nullptr}, - {0x7e4bdf46d4ff9f11, "SystemNative_MkNod", nullptr}, - {0x7e5fa2f70891c7fe, "GlobalizationNative_ChangeCaseTurkish", nullptr}, - {0x7ec328b6ba9eab8a, "SystemNative_WaitForSocketEvents", nullptr}, - {0x7fa96d0284954375, "AndroidCryptoNative_X509Decode", nullptr}, - {0x80ef5040fdcc248d, "BrotliEncoderMaxCompressedSize", nullptr}, - {0x813bedf08c3388d4, "AndroidCryptoNative_Aes128Cfb8", nullptr}, - {0x84c8a7489b37fea0, "SystemNative_GetPlatformSignalNumber", nullptr}, - {0x84cc0301870c37ce, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, - {0x8502eeba98158e79, "SystemNative_FcntlSetIsNonBlocking", nullptr}, - {0x8530d37777969db6, "SystemNative_SetKeypadXmit", nullptr}, - {0x85d0033bc38bb4bb, "SystemNative_MAdvise", nullptr}, - {0x868e09dc7dfea364, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, - {0x870191ad244b8069, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, - {0x87019b7831c0c34c, "AndroidCryptoNative_Aes192Gcm", nullptr}, - {0x87c447e7f873cff0, "AndroidCryptoNative_X509ChainValidate", nullptr}, - {0x889350f209555ecb, "SystemNative_MkdTemp", nullptr}, - {0x88a08b60b80c70cc, "SystemNative_FChMod", nullptr}, - {0x88cfeefc903f9d60, "CryptoNative_EvpDigestCurrent", nullptr}, - {0x8bcabce135063bed, "SystemNative_OpenDir", nullptr}, - {0x8df448aee6e8fa5e, "SystemNative_WaitPidExitedNoHang", nullptr}, - {0x8e96cb02418947cc, "SystemNative_FcntlGetPipeSz", nullptr}, - {0x8fb6ed14ee0256bc, "SystemNative_GetTimestamp", nullptr}, - {0x8ffe2d950d138c01, "SystemNative_SchedGetCpu", nullptr}, - {0x9039632237d70ae7, "AndroidCryptoNative_NewGlobalReference", nullptr}, - {0x9161ade1206fd86e, "AndroidCryptoNative_Aes256Cfb128", nullptr}, - {0x9167a072639a7c95, "AndroidCryptoNative_Aes256Ccm", nullptr}, - {0x91f065ec0d3aec55, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, - {0x93a8bec488055608, "SystemNative_GetPwNamR", nullptr}, - {0x95a0e2fc5c0cb49e, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, - {0x95a4cb8563cc6b14, "SystemNative_ShmOpen", nullptr}, - {0x9856fa59ed936b73, "SystemNative_GetSid", nullptr}, - {0x996ada1c038aabba, "SystemNative_MksTemps", nullptr}, - {0x9991a277809ef205, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, - {0x99a840c495204202, "SystemNative_GetBytesAvailable", nullptr}, - {0x99e3660fc483d7be, "CryptoNative_GetRandomBytes", nullptr}, - {0x9aa9eaee3dd8b23b, "SystemNative_GetIPv4MulticastOption", nullptr}, - {0x9aaaad33b28af82f, "SystemNative_SetSignalForBreak", nullptr}, - {0x9aab07f824659d3e, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, - {0x9c3e8b890033819a, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, - {0x9c832cd7fcbf2de0, "SystemNative_MkFifo", nullptr}, - {0x9d2cb31282abd3d9, "SystemNative_GetNetworkInterfaces", nullptr}, - {0x9e25ebf4f61cc299, "SystemNative_ChDir", nullptr}, - {0x9e79166979634030, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, - {0x9edddf30d660eff4, "AndroidCryptoNative_Aes192Ecb", nullptr}, - {0x9fb01da1222e905a, "SystemNative_IsATty", nullptr}, - {0xa193402ff5140ac1, "GlobalizationNative_GetCalendarInfo", nullptr}, - {0xa1e881a63614507e, "SystemNative_INotifyRemoveWatch", nullptr}, - {0xa2254fea4d8b6909, "SystemNative_MMap", nullptr}, - {0xa272b5349013d9ef, "CryptoNative_EvpSha256", nullptr}, - {0xa2d7790a850024c0, "SystemNative_GetNumRoutes", nullptr}, - {0xa302613a430248b8, "SystemNative_GetGroups", nullptr}, - {0xa308025a784497df, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, - {0xa56532a23755cd87, "SystemNative_StdinReady", nullptr}, - {0xa56954e28eb9a9c9, "AndroidCryptoNative_Des3Cfb8", nullptr}, - {0xa57e18f82abd5958, "BrotliDecoderDestroyInstance", nullptr}, - {0xa5eda72b95fe78c3, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, - {0xa831a683f743e417, "GlobalizationNative_WindowsIdToIanaId", nullptr}, - {0xa89b70c38d3ba079, "CryptoNative_HmacCreate", nullptr}, - {0xa89ec9958d999483, "SystemNative_GetCwd", nullptr}, - {0xa8bdc3e7ee898dfc, "SystemNative_Shutdown", nullptr}, - {0xa93eb533acf7564d, "AndroidCryptoNative_DesEcb", nullptr}, - {0xa94b1cf083978da9, "CryptoNative_EvpMdCtxCopyEx", nullptr}, - {0xa961e8db31830e16, "AndroidCryptoNative_Aes192Cfb8", nullptr}, - {0xaa8f0f87ae474ffe, "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", nullptr}, - {0xabdcf2f74d210f35, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, - {0xac11eab9d9c31b01, "SystemNative_UTimensat", nullptr}, - {0xac5c6a70d140a4bf, "GlobalizationNative_GetLocaleTimeFormat", nullptr}, - {0xac7725c652a5fb5b, "SystemNative_CopyFile", nullptr}, - {0xad1a2d6575cdd4e3, "AndroidCryptoNative_SSLStreamWrite", nullptr}, - {0xad228cdc4edb11d6, "SystemNative_CloseDir", nullptr}, - {0xadc6889903a2d6f4, "SystemNative_Rename", nullptr}, - {0xae320903718eb45d, "SystemNative_MapTcpState", nullptr}, - {0xae82e9ceae24192d, "AndroidCryptoNative_Pbkdf2", nullptr}, - {0xaf72b94c4acee897, "BrotliDecoderHasMoreOutput", nullptr}, - {0xaf9706efc72c3904, "SystemNative_SetIPv6MulticastOption", nullptr}, - {0xafd9f6338cdbadd4, "SystemNative_GetHostEntryForName", nullptr}, - {0xafe3d21bbaa71464, "CompressionNative_DeflateEnd", nullptr}, - {0xb0b66a7145de350d, "SystemNative_Access", nullptr}, - {0xb0df46ff09c57741, "AndroidCryptoNative_GetRsaParameters", nullptr}, - {0xb0e18377ed603e0b, "SystemNative_GetGroupList", nullptr}, - {0xb1c394b9992bd67d, "AndroidCryptoNative_EcDsaSign", nullptr}, - {0xb1ff12f3bd735982, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, - {0xb361006446f560e8, "SystemNative_LogError", nullptr}, - {0xb3e1e5e50cde576e, "BrotliEncoderVersion", nullptr}, - {0xb41fa43cc5c261cb, "BrotliDecoderGetErrorCode", nullptr}, - {0xb4996dd1aba38200, "AndroidCryptoNative_EcDsaSize", nullptr}, - {0xb516027cb59e6541, "BrotliDecoderIsFinished", nullptr}, - {0xb575ec01a7a79f8f, "AndroidCryptoNative_DesCfb8", nullptr}, - {0xb600c44028c1743d, "SystemNative_Socket", nullptr}, - {0xb632e9bc6f7be0a9, "SystemNative_GetSockName", nullptr}, - {0xb6540b73eff28747, "SystemNative_SetRawSockOpt", nullptr}, - {0xb66be1550d27bfb4, "AndroidCryptoNative_GetECCurveParameters", nullptr}, - {0xb69c3cc8b9f6a724, "BrotliDecoderIsUsed", nullptr}, - {0xb6ab9abf7887911f, "SystemNative_ReadEvents", nullptr}, - {0xb73c597de01bc0b2, "SystemNative_GetPwUidR", nullptr}, - {0xb78af5975603cd20, "SystemNative_Sync", nullptr}, - {0xb7bbbe2c16a565c6, "SystemNative_Calloc", nullptr}, - {0xb81236cd1fe85cc9, "GlobalizationNative_GetLatestJapaneseEra", nullptr}, - {0xb828d9e7df5437a5, "BrotliDecoderErrorString", nullptr}, - {0xb95350c7ec77bc72, "GlobalizationNative_ChangeCase", nullptr}, - {0xba2f6d298f3be8bc, "CryptoNative_EvpMd5", nullptr}, - {0xbb3343826d504870, "SystemNative_GetBootTimeTicks", nullptr}, - {0xbb5e970ecb6745da, "SystemNative_SymLink", nullptr}, - {0xbbd20cce92ec2c12, "SystemNative_FcntlGetFD", nullptr}, - {0xbcd9e53d2d288094, "SystemNative_GetNameInfo", nullptr}, - {0xbd5a0be2f7904089, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, - {0xbd89ef4df5486744, "SystemNative_Send", nullptr}, - {0xbdbbd2898347c0d1, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, - {0xbdd3128e77381b01, "SystemNative_EnumerateInterfaceAddresses", nullptr}, - {0xbe8df478de07c6d8, "BrotliDefaultFreeFunc", nullptr}, - {0xc00ebc097b776c1f, "SystemNative_GetPriority", nullptr}, - {0xc036b23d88fad91b, "SystemNative_iOSSupportVersion", nullptr}, - {0xc0bb2dd0c5b74436, "CryptoNative_EnsureOpenSslInitialized", nullptr}, - {0xc10e411c989a9314, "CompressionNative_Deflate", nullptr}, - {0xc11cd661db8be230, "AndroidCryptoNative_Des3Cfb64", nullptr}, - {0xc183a0550feea0d6, "BrotliEncoderCompressStream", nullptr}, - {0xc19b94823ea1d39e, "CryptoNative_HmacOneShot", nullptr}, - {0xc1b8a5f1c799e4bb, "BrotliGetDictionary", nullptr}, - {0xc1c679eefc134d31, "SystemNative_LowLevelMonitor_Release", nullptr}, - {0xc287daf58054a21d, "GlobalizationNative_EndsWith", nullptr}, - {0xc2d5e1c465b2f5b6, "AndroidCryptoNative_DsaSizeP", nullptr}, - {0xc3145e336c38379b, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, - {0xc3c10021b10ba455, "SystemNative_GetEGid", nullptr}, - {0xc3fe9394fe1f3f02, "SystemNative_GetSocketType", nullptr}, - {0xc560d9947ab2a34d, "SystemNative_RegisterForSigChld", nullptr}, - {0xc5bed971846027de, "SystemNative_GetCpuUtilization", nullptr}, - {0xc69433678dd341ca, "SystemNative_ForkAndExecProcess", nullptr}, - {0xc7815e0476511544, "AndroidCryptoNative_X509Encode", nullptr}, - {0xc7ae1b8d93af5d73, "SystemNative_ChMod", nullptr}, - {0xc7d536c0e7eb3fe2, "SystemNative_FreeSocketEventBuffer", nullptr}, - {0xc7f81d5b58b65ac0, "BrotliEncoderCreateInstance", nullptr}, - {0xc87a5ee4869035c6, "SystemNative_UninitializeConsoleAfterRead", nullptr}, - {0xc8a52a8b6d96b32b, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, - {0xc8b772178f955d87, "GlobalizationNative_GetSortHandle", nullptr}, - {0xc93df58ae5457bfd, "SystemNative_GetControlMessageBufferSize", nullptr}, - {0xc956e528f995739c, "SystemNative_ReceiveMessage", nullptr}, - {0xca001af79c0d7a8b, "CompressionNative_InflateEnd", nullptr}, - {0xca48c3927c202794, "AndroidCryptoNative_GetECKeyParameters", nullptr}, - {0xcaae6d345ba32c7b, "SystemNative_Kill", nullptr}, - {0xcaec08aa13779f7f, "SystemNative_GetEnviron", nullptr}, - {0xcaf599a20538b10b, "SystemNative_SetWindowSize", nullptr}, - {0xcb4bcdafdc81d116, "AndroidCryptoNative_CipherCreatePartial", nullptr}, - {0xcbbb90469d28cded, "SystemNative_SearchPath", nullptr}, - {0xcc433093c073719e, "AndroidCryptoNative_SSLStreamRead", nullptr}, - {0xcc43d880192dd6ff, "SystemNative_ConvertErrorPlatformToPal", nullptr}, - {0xcc788c0474c3e178, "SystemNative_LSeek", nullptr}, - {0xcd5d8a63493f5e38, "CompressionNative_InflateInit2_", nullptr}, - {0xcdcb014df9a6eae2, "SystemNative_SetPort", nullptr}, - {0xce36e2e1a139a020, "SystemNative_GetDefaultTimeZone", nullptr}, - {0xce6ddfe40fed99d9, "SystemNative_PRead", nullptr}, - {0xce9f8a6ac705faa5, "AndroidCryptoNative_X509DecodeCollection", nullptr}, - {0xceba527295694651, "BrotliDecoderCreateInstance", nullptr}, - {0xd0899515dfe85287, "GlobalizationNative_LoadICU", nullptr}, - {0xd185dfe303ab91dd, "GlobalizationNative_CompareString", nullptr}, - {0xd392d6ed5dcc111c, "SystemNative_GetDomainName", nullptr}, - {0xd5264d57a926edfb, "GlobalizationNative_InitICUFunctions", nullptr}, - {0xd55437b16dc84f3b, "SystemNative_GetIPv4GlobalStatistics", nullptr}, - {0xd5c063a90ae882c1, "AndroidCryptoNative_CipherIsSupported", nullptr}, - {0xd7d818c7640598dc, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, - {0xd7f1a8f616897ace, "AndroidCryptoNative_Aes256Cfb8", nullptr}, - {0xd88be8f9e9f28e90, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, - {0xd8976692c4c68818, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, - {0xd8a9e47b6ca78448, "CryptoNative_ErrPeekLastError", nullptr}, - {0xd995e71361e6ed2e, "GlobalizationNative_IsPredefinedLocale", nullptr}, - {0xd9bd0b370726ce34, "AndroidCryptoNative_CipherReset", nullptr}, - {0xda05c57c78aa6706, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, - {0xda38bffa1d16cdd6, "SystemNative_SetLingerOption", nullptr}, - {0xda4898a26933f73d, "AndroidCryptoNative_DsaVerify", nullptr}, - {0xda6b3192974ca60e, "SystemNative_Open", nullptr}, - {0xdab5eb45815daabc, "SystemNative_GetAtOutOfBandMark", nullptr}, - {0xdae32aac0c0d305c, "SystemNative_ReadProcessStatusInfo", nullptr}, - {0xdbb4752ed23670f0, "AndroidCryptoNative_DesCbc", nullptr}, - {0xdbee22594fa8c585, "SystemNative_CreateAutoreleasePool", nullptr}, - {0xdc51159ffe70b0e0, "BrotliDecoderVersion", nullptr}, - {0xdc780005b0d39711, "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", nullptr}, - {0xdd4c03f06ce96e04, "AndroidCryptoNative_RsaDestroy", nullptr}, - {0xdde06993f87d6ffc, "AndroidCryptoNative_Aes128Cfb128", nullptr}, - {0xde1e22dd097f799c, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, - {0xde259001bf54e6f1, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, - {0xdec5c7544d2c8cb1, "AndroidCryptoNative_GetDsaParameters", nullptr}, - {0xdf650444c8af0763, "SystemNative_FcntlGetIsNonBlocking", nullptr}, - {0xdfede2defd776f7e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, - {0xe059239741e0011a, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, - {0xe072da8f2d921f53, "GlobalizationNative_GetDefaultLocaleName", nullptr}, - {0xe0a170d2b947a8fc, "SystemNative_SendMessage", nullptr}, - {0xe0a601fd89d9b279, "SystemNative_SetErrNo", nullptr}, - {0xe0f34ce89fd38aef, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, - {0xe1930d112ce74c9e, "SystemNative_TryGetUInt32OSThreadId", nullptr}, - {0xe20c29fb8b19da7b, "SystemNative_Listen", nullptr}, - {0xe36a157177b2db08, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, - {0xe44f737a5bebdd90, "SystemNative_SetIPv4Address", nullptr}, - {0xe582a4a60bb74c35, "SystemNative_GetProcAddress", nullptr}, - {0xe604fca300068c0c, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, - {0xe6838f2add787bfe, "SystemNative_FreeLibrary", nullptr}, - {0xe73aeaf9e3a10343, "SystemNative_PWrite", nullptr}, - {0xe78ff100d1d73d99, "SystemNative_SetReceiveTimeout", nullptr}, - {0xe853ecfe4d402ed0, "SystemNative_Poll", nullptr}, - {0xea21aa1f2b2a671c, "GlobalizationNative_LastIndexOf", nullptr}, - {0xea5e6653389b924a, "CompressionNative_DeflateInit2_", nullptr}, - {0xea61d6c040267b2d, "BrotliSetDictionaryData", nullptr}, - {0xeaafb7963ceb9bf4, "SystemNative_GetTcpGlobalStatistics", nullptr}, - {0xeab45239fb3f138d, "AndroidCryptoNative_GetBigNumBytes", nullptr}, - {0xec67e4076662c2de, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, - {0xee4dd111dc8d98f3, "GlobalizationNative_GetJapaneseEraStartDate", nullptr}, - {0xef71ee101b3ece96, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, - {0xeff5d014640ae969, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, - {0xf0045895a9043221, "SystemNative_SearchPath_TempDirectory", nullptr}, - {0xf0658a22dd5ede19, "SystemNative_SNPrintF_1I", nullptr}, - {0xf0ec052da6c5fa70, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, - {0xf1577384f409ea85, "AndroidCryptoNative_BigNumToBinary", nullptr}, - {0xf2c7fa39bf166188, "SystemNative_Free", nullptr}, - {0xf2d074e0aeca51ce, "GlobalizationNative_GetLocales", nullptr}, - {0xf3693f3cadb9b6f4, "GlobalizationNative_EnumCalendarInfo", nullptr}, - {0xf38b47e43f352491, "SystemNative_GetUdpGlobalStatistics", nullptr}, - {0xf432f105a045b088, "CryptoNative_ErrClearError", nullptr}, - {0xf4dea312f71c5ff2, "AndroidCryptoNative_Aes128Ecb", nullptr}, - {0xf4f5526ddc32beac, "CryptoNative_HmacDestroy", nullptr}, - {0xf57f81262f07542c, "AndroidCryptoNative_Des3Ecb", nullptr}, - {0xf63fa2bfce5c4f80, "GlobalizationNative_GetLocaleInfoGroupingSizes", nullptr}, - {0xf6ede5d5d8729315, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, - {0xf75d4fdd6e749a84, "BrotliTransformDictionaryWord", nullptr}, - {0xf7b334768844b502, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, - {0xf85b8ffeba9b06c1, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, - {0xf870179a8d8d1872, "SystemNative_PosixFAdvise", nullptr}, - {0xf8c983dd21ef9fe6, "SystemNative_GetPid", nullptr}, - {0xf96bc1e7e15e69f2, "AndroidCryptoNative_CipherUpdate", nullptr}, - {0xf970881d4fa83e07, "AndroidCryptoNative_CipherCreate", nullptr}, - {0xf9c3d216226b3355, "AndroidCryptoNative_CipherSetTagLength", nullptr}, - {0xf9dea6e72f1fffc9, "CryptoNative_EvpMdCtxCreate", nullptr}, - {0xfa21f0a127c9dce9, "GlobalizationNative_ChangeCaseInvariant", nullptr}, - {0xfa2669c25616a8ff, "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", nullptr}, - {0xfa26b86cedf66721, "SystemNative_Sysctl", nullptr}, - {0xfaa7766eaa2c54a5, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, - {0xfacf02f439426705, "GlobalizationNative_CloseSortHandle", nullptr}, - {0xfb3e394cc613f202, "SystemNative_GetPeerName", nullptr}, - {0xfbb57319454b1074, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, - {0xfc0bad2b1528000f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, - {0xfcdeea476953780c, "AndroidCryptoNative_Aes192Cfb128", nullptr}, - {0xfd2cdd99f11de76c, "AndroidCryptoNative_EcKeyGetSize", nullptr}, - {0xfd4f2784ec1c98aa, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, - {0xfe3dd06281f7cd1f, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, - {0xff28b3bec4f32a2c, "SystemNative_GetFileSystemType", nullptr}, - {0xff9b8d95b0e209fb, "BrotliEncoderHasMoreOutput", nullptr}, - {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, - }}; - ->>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) - -constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; -constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; -constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; -constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; -constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; -<<<<<<< HEAD -<<<<<<< HEAD -constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; -#else - //32-bit internal p/invoke table - std::array internal_pinvokes {{ - {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, - {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, - {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, - {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, - {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, - {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, - {0x395808e5, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, - {0x42b41fe4, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, - {0x434ad3e4, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, - {0x4b58e0da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, - {0x501befde, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, - {0x501ebdc2, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, - {0x7a6909a0, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, - {0x7c94dbf5, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, - {0x8f6837ec, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, - {0x9070e02c, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, - {0x910452d0, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, - {0x934790b1, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, - {0x9a734f16, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, - {0x9b7b9290, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, - {0x9c5b24a8, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, - {0xa04e5d1c, "monodroid_free", reinterpret_cast(&monodroid_free)}, - {0xa11d71da, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, - {0xa7ea4a5f, "path_combine", reinterpret_cast(&path_combine)}, - {0xad511c82, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, - {0xb02468aa, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, - {0xbe8d7701, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, - {0xc0d097a7, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, - {0xc439b5d7, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, - {0xc5146c54, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, - {0xc58eafa5, "java_interop_free", reinterpret_cast(&java_interop_free)}, - {0xd3b5d2c1, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, - {0xd78c749d, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, - {0xd91f3619, "create_public_directory", reinterpret_cast(&create_public_directory)}, - {0xe215a17c, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, - {0xe4c3ee19, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, - {0xe7e77ca5, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, - {0xea2184e3, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, - {0xf4079b4a, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, - {0xf5a0ac55, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, - {0xf61941c3, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, - {0xf6ca4b3b, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, - {0xfa1832a6, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, - {0xfa4e32ca, "monodroid_log", reinterpret_cast(&monodroid_log)}, - {0xfdc3ae2a, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, - }}; - - //32-bit DotNet p/invoke table - std::array dotnet_pinvokes {{ - {0xaf6b1c, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, - {0x1733089, "SystemNative_SetTerminalInvalidationHandler", nullptr}, - {0x1dd1f00, "AndroidCryptoNative_Aes192Cfb8", nullptr}, - {0x23a0578, "AndroidCryptoNative_NewGlobalReference", nullptr}, - {0x2f05496, "SystemNative_GetPeerName", nullptr}, - {0x3295077, "SystemNative_MapTcpState", nullptr}, - {0x3d9bc5f, "SystemNative_Unlink", nullptr}, - {0x3e12cb4, "SystemNative_INotifyInit", nullptr}, - {0x5b0fb1d, "SystemNative_InitializeConsoleBeforeRead", nullptr}, - {0x80f30b4, "BrotliDecoderTakeOutput", nullptr}, - {0x84ccf89, "SystemNative_MSync", nullptr}, - {0x8c636a2, "SystemNative_FcntlSetPipeSz", nullptr}, - {0x8de5b3d, "SystemNative_GetSid", nullptr}, - {0x92bf2d9, "AndroidCryptoNative_EcKeyGetSize", nullptr}, - {0xaa46d20, "SystemNative_SNPrintF", nullptr}, - {0xaa7c86e, "SystemNative_Exit", nullptr}, - {0xb6a80bd, "SystemNative_SetAddressFamily", nullptr}, - {0xbdd984d, "SystemNative_SetWindowSize", nullptr}, - {0xcc59904, "CryptoNative_HmacDestroy", nullptr}, - {0xd5ca844, "SystemNative_CreateSocketEventPort", nullptr}, - {0xd98d741, "SystemNative_Kill", nullptr}, - {0xdfe3e26, "SystemNative_Connectx", nullptr}, - {0xfc48476, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, - {0x10d108c9, "SystemNative_FreeHostEntry", nullptr}, - {0x1165644f, "SystemNative_GetOSArchitecture", nullptr}, - {0x11778651, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, - {0x1178ebdd, "CryptoNative_EvpDigestFinalEx", nullptr}, - {0x11a2796d, "SystemNative_GetTcpGlobalStatistics", nullptr}, - {0x11d9981e, "SystemNative_MProtect", nullptr}, - {0x12105897, "GlobalizationNative_NormalizeString", nullptr}, - {0x12b01cc9, "GlobalizationNative_IsNormalized", nullptr}, - {0x12fdf5c3, "SystemNative_ConvertErrorPlatformToPal", nullptr}, - {0x1348bf25, "AndroidCryptoNative_SSLStreamWrite", nullptr}, - {0x1376985b, "SystemNative_SetSockOpt", nullptr}, - {0x13925de2, "SystemNative_GetLingerOption", nullptr}, - {0x13f565a9, "SystemNative_GetControlMessageBufferSize", nullptr}, - {0x142a08a1, "SystemNative_PosixFAdvise", nullptr}, - {0x16d98313, "GlobalizationNative_IndexOf", nullptr}, - {0x17549123, "SystemNative_Connect", nullptr}, - {0x17a5d095, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, - {0x17b96c39, "SystemNative_FreeSocketEventBuffer", nullptr}, - {0x1904820d, "SystemNative_GetHostEntryForName", nullptr}, - {0x19b6a696, "AndroidCryptoNative_X509DecodeCollection", nullptr}, - {0x1a302b28, "SystemNative_SchedSetAffinity", nullptr}, - {0x1aa4105d, "GlobalizationNative_GetSortKey", nullptr}, - {0x1ab1248e, "SystemNative_GetHostName", nullptr}, - {0x1bf277c4, "SystemNative_WaitForSocketEvents", nullptr}, - {0x1c4778bf, "SystemNative_AlignedFree", nullptr}, - {0x1cb466df, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, - {0x1cf7b52c, "SystemNative_MAdvise", nullptr}, - {0x1eb6eaaa, "CryptoNative_GetRandomBytes", nullptr}, - {0x1ebc63c1, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, - {0x1f186646, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, - {0x1f1cd573, "AndroidCryptoNative_Des3Cfb64", nullptr}, - {0x1f998744, "AndroidCryptoNative_Aes128Cfb128", nullptr}, - {0x1fdcd1e0, "CryptoNative_ErrPeekError", nullptr}, - {0x212e38c4, "SystemNative_GetUdpGlobalStatistics", nullptr}, - {0x218fa94a, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, - {0x22011e2b, "SystemNative_SetLingerOption", nullptr}, - {0x224ebd71, "SystemNative_Listen", nullptr}, - {0x2253b591, "BrotliGetTransforms", nullptr}, - {0x226eec4d, "SystemNative_Abort", nullptr}, - {0x229f73d4, "AndroidCryptoNative_RsaUpRef", nullptr}, - {0x22bbb587, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, - {0x2304e65b, "SystemNative_SetRLimit", nullptr}, - {0x23cfcfb0, "BrotliTransformDictionaryWord", nullptr}, - {0x260a3e8d, "CompressionNative_DeflateInit2_", nullptr}, - {0x289b5430, "SystemNative_Log", nullptr}, - {0x28d95a99, "SystemNative_CanGetHiddenFlag", nullptr}, - {0x28f3db4b, "SystemNative_ShmUnlink", nullptr}, - {0x2af6aa40, "SystemNative_Access", nullptr}, - {0x2b117055, "BrotliDecoderDecompress", nullptr}, - {0x2b7293c5, "SystemNative_GetTimestamp", nullptr}, - {0x2b747a9c, "SystemNative_MkNod", nullptr}, - {0x2bc9ff5e, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, - {0x2c4415fd, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, - {0x2c467430, "AndroidCryptoNative_GetECCurveParameters", nullptr}, - {0x2d21ad97, "SystemNative_GetReadDirRBufferSize", nullptr}, - {0x2d6e4a1c, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, - {0x2e66f31b, "BrotliDecoderDestroyInstance", nullptr}, - {0x2eb28fb6, "SystemNative_GetIPv4Address", nullptr}, - {0x2f7d80dd, "GlobalizationNative_WindowsIdToIanaId", nullptr}, - {0x2ff73621, "CryptoNative_ErrReasonErrorString", nullptr}, - {0x30af09b7, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, - {0x31120969, "SystemNative_Malloc", nullptr}, - {0x3374b950, "SystemNative_GetLoadLibraryError", nullptr}, - {0x34867c2f, "SystemNative_TryGetUInt32OSThreadId", nullptr}, - {0x349c5a8f, "SystemNative_GetNetworkInterfaces", nullptr}, - {0x354aa58f, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, - {0x363c0010, "CryptoNative_EvpDigestUpdate", nullptr}, - {0x367eee31, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, - {0x38406fa3, "GlobalizationNative_ChangeCaseInvariant", nullptr}, - {0x38575bc5, "SystemNative_GetUnixRelease", nullptr}, - {0x388a31d4, "SystemNative_PathConf", nullptr}, - {0x3a238b9f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, - {0x3a861d34, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, - {0x3af56a10, "AndroidCryptoNative_RsaSize", nullptr}, - {0x3b286185, "GlobalizationNative_ChangeCaseTurkish", nullptr}, - {0x3bf3d465, "SystemNative_GetIPv6MulticastOption", nullptr}, - {0x3cb49aae, "SystemNative_GetPwNamR", nullptr}, - {0x3d150bdf, "AndroidCryptoNative_Aes128Ecb", nullptr}, - {0x3d823979, "GlobalizationNative_ToUnicode", nullptr}, - {0x3da52690, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, - {0x3de52faf, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, - {0x3df8d649, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, - {0x3e175e7c, "AndroidCryptoNative_Aes256Cfb128", nullptr}, - {0x3e273961, "SystemNative_StrErrorR", nullptr}, - {0x3e48f022, "SystemNative_GetMaximumAddressSize", nullptr}, - {0x3e778b38, "BrotliDecoderVersion", nullptr}, - {0x3ea31c40, "SystemNative_GetAddressFamily", nullptr}, - {0x3efdb5a0, "SystemNative_SendMessage", nullptr}, - {0x3f47618f, "CryptoNative_EnsureOpenSslInitialized", nullptr}, - {0x3f793993, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, - {0x40b0026c, "CompressionNative_DeflateEnd", nullptr}, - {0x40e64bdd, "CryptoNative_ErrClearError", nullptr}, - {0x413b9801, "SystemNative_Read", nullptr}, - {0x41818c1d, "SystemNative_GetPriority", nullptr}, - {0x41cf0c16, "AndroidCryptoNative_CipherCreate", nullptr}, - {0x42955366, "SystemNative_Disconnect", nullptr}, - {0x42afcfbb, "AndroidCryptoNative_CipherCreatePartial", nullptr}, - {0x430352b3, "SystemNative_GetNameInfo", nullptr}, - {0x43f6cea1, "AndroidCryptoNative_DesCfb8", nullptr}, - {0x4543d533, "AndroidCryptoNative_EcDsaVerify", nullptr}, - {0x45a00971, "GlobalizationNative_CloseSortHandle", nullptr}, - {0x45f09dca, "AndroidCryptoNative_CipherSetTagLength", nullptr}, - {0x46268e76, "GlobalizationNative_GetCalendarInfo", nullptr}, - {0x477f60cf, "SystemNative_OpenDir", nullptr}, - {0x47a82b4e, "SystemNative_AlignedRealloc", nullptr}, - {0x48c17c9b, "SystemNative_Sysctl", nullptr}, - {0x493888ee, "CompressionNative_Crc32", nullptr}, - {0x494ef6d4, "SystemNative_GetIPv4MulticastOption", nullptr}, - {0x496f1885, "SystemNative_GetSocketErrorOption", nullptr}, - {0x49c2af32, "SystemNative_GetBootTimeTicks", nullptr}, - {0x49c81782, "SystemNative_MkDir", nullptr}, - {0x49f60a0f, "GlobalizationNative_GetLocales", nullptr}, - {0x4a4ef46f, "SystemNative_FcntlGetFD", nullptr}, - {0x4a98a396, "GlobalizationNative_GetLocaleInfoInt", nullptr}, - {0x4b78d330, "CryptoNative_HmacCurrent", nullptr}, - {0x4c2eae6c, "GlobalizationNative_EnumCalendarInfo", nullptr}, - {0x4c6d50ba, "SystemNative_GetIPv4GlobalStatistics", nullptr}, - {0x4ca38207, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, - {0x4cb997ae, "BrotliEncoderCompress", nullptr}, - {0x4d1a35d1, "SystemNative_LowLevelMonitor_Release", nullptr}, - {0x4d75bb15, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, - {0x4dbf0c74, "SystemNative_CreateSocketEventBuffer", nullptr}, - {0x4e4d4f2a, "SystemNative_SetIPv6Address", nullptr}, - {0x4f6011da, "SystemNative_GetPort", nullptr}, - {0x4f6c3726, "SystemNative_FcntlGetIsNonBlocking", nullptr}, - {0x50e88639, "CryptoNative_HmacUpdate", nullptr}, - {0x514e739b, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, - {0x52590509, "AndroidCryptoNative_Aes128Cbc", nullptr}, - {0x526c9f90, "SystemNative_GetNumRoutes", nullptr}, - {0x52896a81, "SystemNative_ChMod", nullptr}, - {0x538521c9, "GlobalizationNative_IanaIdToWindowsId", nullptr}, - {0x54d6c29d, "GlobalizationNative_GetJapaneseEraStartDate", nullptr}, - {0x5600bd0d, "AndroidCryptoNative_SSLStreamCreate", nullptr}, - {0x561fb6ff, "SystemNative_FStat", nullptr}, - {0x564f6794, "AndroidCryptoNative_Pbkdf2", nullptr}, - {0x56993aa9, "SystemNative_SetKeypadXmit", nullptr}, - {0x57bdcc46, "SystemNative_Open", nullptr}, - {0x581adfc6, "SystemNative_GetSignalForBreak", nullptr}, - {0x5906e1ba, "SystemNative_Close", nullptr}, - {0x591c5746, "AndroidCryptoNative_EcKeyUpRef", nullptr}, - {0x59840533, "AndroidCryptoNative_X509Decode", nullptr}, - {0x5989ad17, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, - {0x599921d3, "SystemNative_SysConf", nullptr}, - {0x59b67f4d, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, - {0x59e712d5, "SystemNative_MkdTemp", nullptr}, - {0x5a492732, "SystemNative_FcntlSetFD", nullptr}, - {0x5ccc38dd, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, - {0x5e9ef1a2, "SystemNative_GetAtOutOfBandMark", nullptr}, - {0x5eb4f827, "SystemNative_LockFileRegion", nullptr}, - {0x5ed67634, "SystemNative_GetPwUidR", nullptr}, - {0x5efc6409, "SystemNative_ReceiveSocketError", nullptr}, - {0x5f706f52, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, - {0x5fc58bed, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, - {0x60571eb9, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, - {0x6068baa0, "AndroidCryptoNative_GetRsaParameters", nullptr}, - {0x608ee1a5, "SystemNative_Calloc", nullptr}, - {0x60c353e5, "SystemNative_SetPosixSignalHandler", nullptr}, - {0x613c0080, "AndroidCryptoNative_Aes192Ccm", nullptr}, - {0x626db703, "SystemNative_LStat", nullptr}, - {0x6288dd9a, "SystemNative_SetSignalForBreak", nullptr}, - {0x62a36e75, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, - {0x639b2b1d, "AndroidCryptoNative_DsaVerify", nullptr}, - {0x6436999d, "AndroidCryptoNative_SSLStreamRead", nullptr}, - {0x6441bc65, "CryptoNative_EvpSha256", nullptr}, - {0x64f12e5b, "BrotliDecoderIsFinished", nullptr}, - {0x661c5218, "SystemNative_GetDomainName", nullptr}, - {0x6661a841, "BrotliDecoderDecompressStream", nullptr}, - {0x66b5bf9d, "GlobalizationNative_IsPredefinedLocale", nullptr}, - {0x674bdf7f, "SystemNative_DisablePosixSignalHandling", nullptr}, - {0x679dd832, "SystemNative_SetPort", nullptr}, - {0x679f9b4e, "SystemNative_FcntlGetPipeSz", nullptr}, - {0x67de0842, "SystemNative_Dup", nullptr}, - {0x687726ff, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, - {0x68bdc398, "SystemNative_INotifyAddWatch", nullptr}, - {0x68c949a0, "AndroidCryptoNative_X509GetContentType", nullptr}, - {0x68f9f52f, "AndroidCryptoNative_CipherIsSupported", nullptr}, - {0x6907c8eb, "BrotliEncoderSetParameter", nullptr}, - {0x6adb646e, "SystemNative_ReadDirR", nullptr}, - {0x6b5343a0, "SystemNative_SetErrNo", nullptr}, - {0x6bbd3d10, "SystemNative_GetRLimit", nullptr}, - {0x6be1e33d, "SystemNative_EnumerateInterfaceAddresses", nullptr}, - {0x6cda2cf8, "SystemNative_SetSendTimeout", nullptr}, - {0x6d48392a, "SystemNative_Stat", nullptr}, - {0x6ece5fe6, "SystemNative_GetPid", nullptr}, - {0x6ef4e421, "AndroidCryptoNative_CipherDestroy", nullptr}, - {0x6f18d737, "GlobalizationNative_InitICUFunctions", nullptr}, - {0x6f695cb8, "SystemNative_RmDir", nullptr}, - {0x6fa886b1, "SystemNative_GetSockName", nullptr}, - {0x6fc36e5f, "GlobalizationNative_StartsWith", nullptr}, - {0x708e7911, "SystemNative_SetIPv4Address", nullptr}, - {0x70d4f7e6, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, - {0x70e91ddd, "SystemNative_FChMod", nullptr}, - {0x71698a7f, "SystemNative_GetDomainSocketSizes", nullptr}, - {0x7243c4b4, "AndroidCryptoNative_Des3Cfb8", nullptr}, - {0x758dd6aa, "SystemNative_GetTimeZoneData", nullptr}, - {0x759f5b1e, "AndroidCryptoNative_Aes256Cfb8", nullptr}, - {0x75b11f61, "BrotliDecoderGetErrorCode", nullptr}, - {0x76e97b2e, "SystemNative_Rename", nullptr}, - {0x78c1eb52, "AndroidCryptoNative_Des3Ecb", nullptr}, - {0x7a0529c1, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, - {0x7a4012d2, "GlobalizationNative_GetICUVersion", nullptr}, - {0x7aa30494, "Java_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate", nullptr}, - {0x7ad3b820, "AndroidCryptoNative_Aes192Cfb128", nullptr}, - {0x7cb19137, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, - {0x7d0c477d, "CryptoNative_ErrPeekLastError", nullptr}, - {0x7d2bb98a, "SystemNative_MksTemps", nullptr}, - {0x7de70253, "SystemNative_ConvertErrorPalToPlatform", nullptr}, - {0x7e882ae5, "BrotliEncoderIsFinished", nullptr}, - {0x7e9a677b, "GlobalizationNative_GetSortVersion", nullptr}, - {0x7f5d9e25, "SystemNative_MUnmap", nullptr}, - {0x80d5027e, "CryptoNative_EvpMdCtxCopyEx", nullptr}, - {0x80deced4, "SystemNative_CreateAutoreleasePool", nullptr}, - {0x81a5efac, "SystemNative_SetEUid", nullptr}, - {0x82484cbf, "CryptoNative_EvpDigestOneShot", nullptr}, - {0x8289a6f7, "BrotliDefaultFreeFunc", nullptr}, - {0x83dad9bf, "SystemNative_Pipe", nullptr}, - {0x83db1b72, "CryptoNative_EvpDigestCurrent", nullptr}, - {0x84662605, "CompressionNative_Deflate", nullptr}, - {0x8526c9e8, "SystemNative_SetRawSockOpt", nullptr}, - {0x8574b133, "AndroidCryptoNative_Aes192Ecb", nullptr}, - {0x85abed93, "GlobalizationNative_GetCalendars", nullptr}, - {0x8808879d, "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", nullptr}, - {0x88a7558d, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, - {0x8ba80ef4, "GlobalizationNative_InitOrdinalCasingPage", nullptr}, - {0x8bdaf06c, "SystemNative_GetWindowSize", nullptr}, - {0x8bfcd7ba, "CompressionNative_Inflate", nullptr}, - {0x8d38b733, "SystemNative_LSeek", nullptr}, - {0x8f4e59f1, "SystemNative_ReadStdin", nullptr}, - {0x8f628a8d, "GlobalizationNative_CompareString", nullptr}, - {0x909e12ee, "SystemNative_SearchPath", nullptr}, - {0x910b7740, "SystemNative_GetFormatInfoForMountPoint", nullptr}, - {0x913a3d68, "SystemNative_GetDeviceIdentifiers", nullptr}, - {0x9216d936, "SystemNative_GetGroupName", nullptr}, - {0x94477030, "AndroidCryptoNative_Aes256Ccm", nullptr}, - {0x95e99740, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, - {0x960d4fc0, "SystemNative_GetDefaultTimeZone", nullptr}, - {0x966f54af, "CryptoNative_EvpSha384", nullptr}, - {0x96912459, "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", nullptr}, - {0x9787b4b4, "CryptoNative_EvpMdSize", nullptr}, - {0x98105435, "SystemNative_GetIPv6Address", nullptr}, - {0x984edaf1, "AndroidCryptoNative_RsaDestroy", nullptr}, - {0x9852b0fa, "SystemNative_INotifyRemoveWatch", nullptr}, - {0x98954db8, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, - {0x98ca7f1c, "SystemNative_ChDir", nullptr}, - {0x990163b4, "SystemNative_Receive", nullptr}, - {0x996952b3, "AndroidCryptoNative_CipherFinalEx", nullptr}, - {0x9a005080, "SystemNative_Bind", nullptr}, - {0x9a84ffd3, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, - {0x9abfce84, "SystemNative_GetEnviron", nullptr}, - {0x9bda7eb1, "SystemNative_ReadProcessStatusInfo", nullptr}, - {0x9cd6cae8, "AndroidCryptoNative_SSLStreamRelease", nullptr}, - {0x9d102d58, "CompressionNative_InflateEnd", nullptr}, - {0x9d2f90cf, "GlobalizationNative_GetLatestJapaneseEra", nullptr}, - {0x9d7f4af6, "SystemNative_ReceiveMessage", nullptr}, - {0x9dc3baed, "SystemNative_LowLevelMonitor_Destroy", nullptr}, - {0x9e366e9c, "SystemNative_InterfaceNameToIndex", nullptr}, - {0x9e717f20, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, - {0x9f47b32d, "SystemNative_ShmOpen", nullptr}, - {0x9feb81cb, "SystemNative_SNPrintF_1I", nullptr}, - {0xa0db1858, "SystemNative_GetEnv", nullptr}, - {0xa1295a9f, "SystemNative_MkFifo", nullptr}, - {0xa1bec9da, "SystemNative_LogError", nullptr}, - {0xa1d774fc, "BrotliEncoderHasMoreOutput", nullptr}, - {0xa2430b33, "SystemNative_SearchPath_TempDirectory", nullptr}, - {0xa25daa0e, "BrotliSetDictionaryData", nullptr}, - {0xa2d2f390, "SystemNative_TryChangeSocketEventRegistration", nullptr}, - {0xa39be756, "GlobalizationNative_LoadICU", nullptr}, - {0xa4636764, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, - {0xa477c74e, "SystemNative_TryGetIPPacketInformation", nullptr}, - {0xa635da0f, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, - {0xa691d151, "AndroidCryptoNative_Aes192Cbc", nullptr}, - {0xa72ce322, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, - {0xa8074d4c, "GlobalizationNative_GetSortHandle", nullptr}, - {0xa826eabe, "SystemNative_FcntlSetIsNonBlocking", nullptr}, - {0xa829138a, "SystemNative_GetProcessPath", nullptr}, - {0xa8701bcf, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, - {0xa8da7ba1, "BrotliEncoderVersion", nullptr}, - {0xa936bc40, "AndroidCryptoNative_EcDsaSize", nullptr}, - {0xa9c29be5, "SystemNative_SetIPv6MulticastOption", nullptr}, - {0xa9c84a4a, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, - {0xaa13ec2b, "GlobalizationNative_GetLocaleInfoGroupingSizes", nullptr}, - {0xaa2f32ad, "SystemNative_FTruncate", nullptr}, - {0xab37a684, "CryptoNative_HmacCreate", nullptr}, - {0xab3d1641, "AndroidCryptoNative_DesEcb", nullptr}, - {0xabe6739f, "BrotliGetDictionary", nullptr}, - {0xacc26fa4, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, - {0xacc28460, "SystemNative_GetProcAddress", nullptr}, - {0xad7fbde5, "SystemNative_FUTimens", nullptr}, - {0xae443204, "SystemNative_GetSockOpt", nullptr}, - {0xae449ad1, "BrotliDecoderIsUsed", nullptr}, - {0xae8752e4, "GlobalizationNative_ToAscii", nullptr}, - {0xafb02e71, "BrotliEncoderMaxCompressedSize", nullptr}, - {0xb01e9c27, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, - {0xb030a893, "SystemNative_LowLevelMonitor_Acquire", nullptr}, - {0xb0e270a0, "BrotliEncoderDestroyInstance", nullptr}, - {0xb22a12be, "BrotliEncoderCreateInstance", nullptr}, - {0xb26f05b6, "SystemNative_PWrite", nullptr}, - {0xb2965ccd, "CryptoNative_GetMaxMdSize", nullptr}, - {0xb2985645, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, - {0xb4110b14, "AndroidCryptoNative_DsaGenerateKey", nullptr}, - {0xb427959c, "SystemNative_FLock", nullptr}, - {0xb439ebdb, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, - {0xb444f04a, "SystemNative_Accept", nullptr}, - {0xb448a24a, "SystemNative_SymLink", nullptr}, - {0xb4e5c37d, "SystemNative_UTimensat", nullptr}, - {0xb584e8fb, "GlobalizationNative_GetTimeZoneDisplayName", nullptr}, - {0xb5a5754a, "SystemNative_UninitializeConsoleAfterRead", nullptr}, - {0xb5db6a51, "SystemNative_PWriteV", nullptr}, - {0xb628f475, "SystemNative_GetBytesAvailable", nullptr}, - {0xb7041ffa, "SystemNative_GetControlCharacters", nullptr}, - {0xb7cc3cd1, "AndroidCryptoNative_DesCbc", nullptr}, - {0xb7ebdf2c, "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", nullptr}, - {0xb80f233c, "SystemNative_FSync", nullptr}, - {0xb84914f1, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, - {0xb862b34e, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, - {0xb884b933, "SystemNative_StdinReady", nullptr}, - {0xb96c2133, "SystemNative_GetErrNo", nullptr}, - {0xb97add7d, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, - {0xb9e6cb2c, "SystemNative_RealPath", nullptr}, - {0xba284ef4, "CryptoNative_EvpSha1", nullptr}, - {0xbb06f5e1, "AndroidCryptoNative_Aes192Gcm", nullptr}, - {0xbb25ff40, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, - {0xbb2ca4f3, "SystemNative_Link", nullptr}, - {0xbb92466f, "SystemNative_AlignedAlloc", nullptr}, - {0xbd658356, "CryptoNative_ErrErrorStringN", nullptr}, - {0xbdbf2140, "SystemNative_SchedGetAffinity", nullptr}, - {0xbec8a3f2, "SystemNative_FChflags", nullptr}, - {0xbf4eeb78, "AndroidCryptoNative_GetBigNumBytes", nullptr}, - {0xbf9766c3, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, - {0xbfa0ce53, "SystemNative_GetPlatformSignalNumber", nullptr}, - {0xbfaad12d, "BrotliDecoderSetParameter", nullptr}, - {0xc090b1d3, "CryptoNative_EvpSha512", nullptr}, - {0xc0d66913, "SystemNative_GetUnixVersion", nullptr}, - {0xc11dec94, "SystemNative_FAllocate", nullptr}, - {0xc1243135, "AndroidCryptoNative_Aes128Gcm", nullptr}, - {0xc1e4e6f6, "AndroidCryptoNative_BigNumToBinary", nullptr}, - {0xc25ffc33, "BrotliEncoderCompressStream", nullptr}, - {0xc3812682, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, - {0xc3dcc3a0, "AndroidCryptoNative_SetRsaParameters", nullptr}, - {0xc3e6ff56, "SystemNative_LowLevelMonitor_Create", nullptr}, - {0xc475f41c, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, - {0xc4ac1723, "AndroidCryptoNative_Aes256Cbc", nullptr}, - {0xc55548f2, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, - {0xc57b40fa, "SystemNative_LoadLibrary", nullptr}, - {0xc5a83c28, "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", nullptr}, - {0xc6d5929c, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, - {0xc6f2fb9e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, - {0xc717b16e, "CryptoNative_EvpMdCtxDestroy", nullptr}, - {0xc746b70c, "AndroidCryptoNative_DsaSign", nullptr}, - {0xc83527e0, "CryptoNative_HmacReset", nullptr}, - {0xc89ccd22, "SystemNative_SchedGetCpu", nullptr}, - {0xc8cce896, "SystemNative_GetSocketType", nullptr}, - {0xc8e06b20, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, - {0xc9b017c8, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, - {0xca4dad90, "GlobalizationNative_ChangeCase", nullptr}, - {0xca5aab33, "SystemNative_Sync", nullptr}, - {0xcb458400, "CryptoNative_ErrGetErrorAlloc", nullptr}, - {0xcb746e5c, "SystemNative_SetIPv4MulticastOption", nullptr}, - {0xcb85cd8e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, - {0xccc0dd15, "SystemNative_RegisterForSigChld", nullptr}, - {0xcdfb627d, "SystemNative_FreeLibrary", nullptr}, - {0xce91e293, "SystemNative_GetGroupList", nullptr}, - {0xcf0912c8, "GlobalizationNative_GetLocaleTimeFormat", nullptr}, - {0xcf9bcc75, "AndroidCryptoNative_Aes256Gcm", nullptr}, - {0xcfa9e6f1, "AndroidCryptoNative_GetDsaParameters", nullptr}, - {0xcff9b341, "SystemNative_GetSystemTimeAsTicks", nullptr}, - {0xd199e841, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, - {0xd24d4849, "SystemNative_Socket", nullptr}, - {0xd298c3b3, "SystemNative_Write", nullptr}, - {0xd378ba49, "CryptoNative_EvpMd5", nullptr}, - {0xd473c64c, "SystemNative_SetReceiveTimeout", nullptr}, - {0xd4b91180, "SystemNative_ForkAndExecProcess", nullptr}, - {0xd6d7b4fb, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, - {0xd71d8c66, "AndroidCryptoNative_Aes256Ecb", nullptr}, - {0xd7ee326b, "AndroidCryptoNative_EcKeyDestroy", nullptr}, - {0xd818a523, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, - {0xd9458396, "BrotliDecoderCreateInstance", nullptr}, - {0xda040de4, "GlobalizationNative_EndsWith", nullptr}, - {0xdaaa19b2, "SystemNative_GetAllMountPoints", nullptr}, - {0xdac67152, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, - {0xdad29aeb, "AndroidCryptoNative_CipherUpdate", nullptr}, - {0xdaf0460a, "SystemNative_SendFile", nullptr}, - {0xdbbf4917, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, - {0xdbdce4ef, "BrotliDefaultAllocFunc", nullptr}, - {0xdbe13a57, "SystemNative_GetCpuUtilization", nullptr}, - {0xdc3cbeec, "CryptoNative_HmacOneShot", nullptr}, - {0xdcaddb21, "AndroidCryptoNative_GetECKeyParameters", nullptr}, - {0xdd274c15, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, - {0xdd445632, "AndroidCryptoNative_X509ChainValidate", nullptr}, - {0xddd58443, "SystemNative_PReadV", nullptr}, - {0xdea9b9dc, "SystemNative_EnablePosixSignalHandling", nullptr}, - {0xdf0260d8, "GlobalizationNative_GetLocaleInfoString", nullptr}, - {0xdf4f1977, "AndroidCryptoNative_X509PublicKey", nullptr}, - {0xdf5d3dc8, "GlobalizationNative_GetDefaultLocaleName", nullptr}, - {0xdf80df75, "SystemNative_iOSSupportVersion", nullptr}, - {0xe121bac7, "SystemNative_GetPeerID", nullptr}, - {0xe169faa6, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, - {0xe1b8b44f, "SystemNative_Send", nullptr}, - {0xe2a0d0de, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, - {0xe4a78efb, "SystemNative_SetPriority", nullptr}, - {0xe4dba4f6, "SystemNative_GetCwd", nullptr}, - {0xe4f87d25, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, - {0xe50c82b4, "SystemNative_CreateThread", nullptr}, - {0xe58ed8fe, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, - {0xe5ef37b3, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, - {0xe70a3634, "GlobalizationNative_GetLocaleName", nullptr}, - {0xe770cb3f, "SystemNative_CopyFile", nullptr}, - {0xe7a9a106, "CompressionNative_InflateInit2_", nullptr}, - {0xe7bd8dd1, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, - {0xe890cf58, "AndroidCryptoNative_EcDsaSign", nullptr}, - {0xe8b2ec8d, "BrotliDecoderErrorString", nullptr}, - {0xe972fbd9, "SystemNative_GetEGid", nullptr}, - {0xe9bc4e53, "SystemNative_SNPrintF_1S", nullptr}, - {0xea86f52f, "BrotliEncoderTakeOutput", nullptr}, - {0xeb0d0522, "SystemNative_LowLevelMonitor_Wait", nullptr}, - {0xebacbf92, "AndroidCryptoNative_Aes128Cfb8", nullptr}, - {0xec31140d, "BrotliDecoderHasMoreOutput", nullptr}, - {0xec51a1b4, "SystemNative_LChflags", nullptr}, - {0xed6cc182, "CryptoNative_EvpMdCtxCreate", nullptr}, - {0xee74a5ad, "AndroidCryptoNative_DsaSizeP", nullptr}, - {0xef48c2eb, "CryptoNative_EvpDigestReset", nullptr}, - {0xef5890c7, "AndroidCryptoNative_Des3Cbc", nullptr}, - {0xefb38c9f, "SystemNative_Poll", nullptr}, - {0xefd277f7, "CryptoNative_HmacFinal", nullptr}, - {0xf06b440b, "AndroidCryptoNative_DsaSizeSignature", nullptr}, - {0xf0919525, "AndroidCryptoNative_CipherReset", nullptr}, - {0xf0e499c4, "SystemNative_PRead", nullptr}, - {0xf1bb5b47, "SystemNative_ReadLink", nullptr}, - {0xf23e6314, "AndroidCryptoNative_RsaCreate", nullptr}, - {0xf2a49cf0, "SystemNative_CloseSocketEventPort", nullptr}, - {0xf39b1c3a, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, - {0xf3b9c879, "AndroidCryptoNative_X509Encode", nullptr}, - {0xf432ab33, "SystemNative_CloseDir", nullptr}, - {0xf4a5a1c8, "SystemNative_SysLog", nullptr}, - {0xf500c9d3, "SystemNative_GetActiveUdpListeners", nullptr}, - {0xf57828fb, "SystemNative_IsATty", nullptr}, - {0xf5918f53, "SystemNative_GetSocketAddressSizes", nullptr}, - {0xf6141499, "AndroidCryptoNative_X509ChainBuild", nullptr}, - {0xf629d20f, "SystemNative_Shutdown", nullptr}, - {0xf6b01c6b, "SystemNative_FreeEnviron", nullptr}, - {0xf6bfedad, "SystemNative_ReadEvents", nullptr}, - {0xf91cf365, "AndroidCryptoNative_Aes128Ccm", nullptr}, - {0xf94a4828, "SystemNative_GetEUid", nullptr}, - {0xf993f426, "SystemNative_Free", nullptr}, - {0xfa97914b, "SystemNative_MMap", nullptr}, - {0xfad61722, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, - {0xfae25aa7, "GlobalizationNative_LastIndexOf", nullptr}, - {0xfb89157f, "SystemNative_GetGroups", nullptr}, - {0xfc83423c, "SystemNative_GetRawSockOpt", nullptr}, - {0xfd9099cc, "SystemNative_GetUInt64OSThreadId", nullptr}, - {0xfe2f2c47, "SystemNative_DrainAutoreleasePool", nullptr}, - {0xfeb6c5c7, "SystemNative_WaitPidExitedNoHang", nullptr}, - {0xff3b4cfa, "SystemNative_GetFileSystemType", nullptr}, - {0xff975200, "SystemNative_Realloc", nullptr}, - }}; -======= -#else -//32-bit internal p/invoke table -static PinvokeEntry internal_pinvokes[] = { - {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, - {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, - {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, - {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0x2a0e1744, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, - {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0x2f7d0f53, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, - {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, - {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, - {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, - {0x395808e5, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, - {0x42b41fe4, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, - {0x434ad3e4, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, - {0x4b58e0da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, - {0x501befde, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, - {0x501ebdc2, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, - {0x7a6909a0, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, - {0x7c94dbf5, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, - {0x8f6837ec, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, - {0x9070e02c, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, - {0x910452d0, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, - {0x934790b1, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, - {0x9a734f16, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, - {0x9b7b9290, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, - {0x9c5b24a8, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, - {0xa04e5d1c, "monodroid_free", reinterpret_cast(&monodroid_free)}, - {0xa11d71da, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, - {0xa7ea4a5f, "path_combine", reinterpret_cast(&path_combine)}, - {0xad511c82, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, - {0xb02468aa, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, - {0xbe8d7701, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, - {0xc0d097a7, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, - {0xc439b5d7, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, - {0xc5146c54, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, - {0xc58eafa5, "java_interop_free", reinterpret_cast(&java_interop_free)}, - {0xd3b5d2c1, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, - {0xd78c749d, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, - {0xd91f3619, "create_public_directory", reinterpret_cast(&create_public_directory)}, - {0xe215a17c, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, - {0xe4c3ee19, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, - {0xe7e77ca5, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, - {0xea2184e3, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, - {0xf4079b4a, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, - {0xf5a0ac55, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, - {0xf61941c3, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, - {0xf6ca4b3b, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, - {0xfa1832a6, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, - {0xfa4e32ca, "monodroid_log", reinterpret_cast(&monodroid_log)}, - {0xfdc3ae2a, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, -}; -//32-bit DotNet p/invoke table -static PinvokeEntry dotnet_pinvokes[] = { - {0xaf6b1c, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, - {0xc89820, "CompressionNative_InflateReset", nullptr}, - {0x1733089, "SystemNative_SetTerminalInvalidationHandler", nullptr}, - {0x1dd1f00, "AndroidCryptoNative_Aes192Cfb8", nullptr}, - {0x23a0578, "AndroidCryptoNative_NewGlobalReference", nullptr}, - {0x2f05496, "SystemNative_GetPeerName", nullptr}, - {0x3295077, "SystemNative_MapTcpState", nullptr}, - {0x3d9bc5f, "SystemNative_Unlink", nullptr}, - {0x3e12cb4, "SystemNative_INotifyInit", nullptr}, - {0x5b0fb1d, "SystemNative_InitializeConsoleBeforeRead", nullptr}, - {0x80f30b4, "BrotliDecoderTakeOutput", nullptr}, - {0x84ccf89, "SystemNative_MSync", nullptr}, - {0x8c636a2, "SystemNative_FcntlSetPipeSz", nullptr}, - {0x8de5b3d, "SystemNative_GetSid", nullptr}, - {0x92bf2d9, "AndroidCryptoNative_EcKeyGetSize", nullptr}, - {0xaa46d20, "SystemNative_SNPrintF", nullptr}, - {0xaa7c86e, "SystemNative_Exit", nullptr}, - {0xb6a80bd, "SystemNative_SetAddressFamily", nullptr}, - {0xbdd984d, "SystemNative_SetWindowSize", nullptr}, - {0xcc59904, "CryptoNative_HmacDestroy", nullptr}, - {0xd5ca844, "SystemNative_CreateSocketEventPort", nullptr}, - {0xd98d741, "SystemNative_Kill", nullptr}, - {0xfc48476, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, - {0x10d108c9, "SystemNative_FreeHostEntry", nullptr}, - {0x1165644f, "SystemNative_GetOSArchitecture", nullptr}, - {0x11778651, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, - {0x1178ebdd, "CryptoNative_EvpDigestFinalEx", nullptr}, - {0x11a2796d, "SystemNative_GetTcpGlobalStatistics", nullptr}, - {0x12fdf5c3, "SystemNative_ConvertErrorPlatformToPal", nullptr}, - {0x1348bf25, "AndroidCryptoNative_SSLStreamWrite", nullptr}, - {0x1376985b, "SystemNative_SetSockOpt", nullptr}, - {0x13925de2, "SystemNative_GetLingerOption", nullptr}, - {0x13f565a9, "SystemNative_GetControlMessageBufferSize", nullptr}, - {0x142a08a1, "SystemNative_PosixFAdvise", nullptr}, - {0x17549123, "SystemNative_Connect", nullptr}, - {0x17a5d095, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, - {0x17b96c39, "SystemNative_FreeSocketEventBuffer", nullptr}, - {0x1904820d, "SystemNative_GetHostEntryForName", nullptr}, - {0x19b6a696, "AndroidCryptoNative_X509DecodeCollection", nullptr}, - {0x1a302b28, "SystemNative_SchedSetAffinity", nullptr}, - {0x1ab1248e, "SystemNative_GetHostName", nullptr}, - {0x1bf277c4, "SystemNative_WaitForSocketEvents", nullptr}, - {0x1c4778bf, "SystemNative_AlignedFree", nullptr}, - {0x1cb466df, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, - {0x1cf7b52c, "SystemNative_MAdvise", nullptr}, - {0x1eb6eaaa, "CryptoNative_GetRandomBytes", nullptr}, - {0x1ebc63c1, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, - {0x1f186646, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, - {0x1f1cd573, "AndroidCryptoNative_Des3Cfb64", nullptr}, - {0x1f998744, "AndroidCryptoNative_Aes128Cfb128", nullptr}, - {0x1fdcd1e0, "CryptoNative_ErrPeekError", nullptr}, - {0x212e38c4, "SystemNative_GetUdpGlobalStatistics", nullptr}, - {0x22011e2b, "SystemNative_SetLingerOption", nullptr}, - {0x224ebd71, "SystemNative_Listen", nullptr}, - {0x2253b591, "BrotliGetTransforms", nullptr}, - {0x226eec4d, "SystemNative_Abort", nullptr}, - {0x229f73d4, "AndroidCryptoNative_RsaUpRef", nullptr}, - {0x22bbb587, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, - {0x2304e65b, "SystemNative_SetRLimit", nullptr}, - {0x23cfcfb0, "BrotliTransformDictionaryWord", nullptr}, - {0x260a3e8d, "CompressionNative_DeflateInit2_", nullptr}, - {0x289b5430, "SystemNative_Log", nullptr}, - {0x28d95a99, "SystemNative_CanGetHiddenFlag", nullptr}, - {0x28f3db4b, "SystemNative_ShmUnlink", nullptr}, - {0x2af6aa40, "SystemNative_Access", nullptr}, - {0x2b117055, "BrotliDecoderDecompress", nullptr}, - {0x2b7293c5, "SystemNative_GetTimestamp", nullptr}, - {0x2b747a9c, "SystemNative_MkNod", nullptr}, - {0x2bc9ff5e, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, - {0x2c4415fd, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, - {0x2c467430, "AndroidCryptoNative_GetECCurveParameters", nullptr}, - {0x2d21ad97, "SystemNative_GetReadDirRBufferSize", nullptr}, - {0x2d6e4a1c, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, - {0x2e66f31b, "BrotliDecoderDestroyInstance", nullptr}, - {0x2eb28fb6, "SystemNative_GetIPv4Address", nullptr}, - {0x2ff73621, "CryptoNative_ErrReasonErrorString", nullptr}, - {0x30af09b7, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, - {0x31120969, "SystemNative_Malloc", nullptr}, - {0x3374b950, "SystemNative_GetLoadLibraryError", nullptr}, - {0x349c5a8f, "SystemNative_GetNetworkInterfaces", nullptr}, - {0x354aa58f, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, - {0x363c0010, "CryptoNative_EvpDigestUpdate", nullptr}, - {0x367eee31, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, - {0x38575bc5, "SystemNative_GetUnixRelease", nullptr}, - {0x388a31d4, "SystemNative_PathConf", nullptr}, - {0x3a238b9f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, - {0x3a861d34, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, - {0x3af56a10, "AndroidCryptoNative_RsaSize", nullptr}, - {0x3bf3d465, "SystemNative_GetIPv6MulticastOption", nullptr}, - {0x3cb49aae, "SystemNative_GetPwNamR", nullptr}, - {0x3d150bdf, "AndroidCryptoNative_Aes128Ecb", nullptr}, - {0x3da52690, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, - {0x3de52faf, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, - {0x3df8d649, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, - {0x3e175e7c, "AndroidCryptoNative_Aes256Cfb128", nullptr}, - {0x3e273961, "SystemNative_StrErrorR", nullptr}, - {0x3e48f022, "SystemNative_GetMaximumAddressSize", nullptr}, - {0x3e778b38, "BrotliDecoderVersion", nullptr}, - {0x3ea31c40, "SystemNative_GetAddressFamily", nullptr}, - {0x3efdb5a0, "SystemNative_SendMessage", nullptr}, - {0x3f47618f, "CryptoNative_EnsureOpenSslInitialized", nullptr}, - {0x3f793993, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, - {0x40b0026c, "CompressionNative_DeflateEnd", nullptr}, - {0x40e64bdd, "CryptoNative_ErrClearError", nullptr}, - {0x413b9801, "SystemNative_Read", nullptr}, - {0x41818c1d, "SystemNative_GetPriority", nullptr}, - {0x41cf0c16, "AndroidCryptoNative_CipherCreate", nullptr}, - {0x42955366, "SystemNative_Disconnect", nullptr}, - {0x42afcfbb, "AndroidCryptoNative_CipherCreatePartial", nullptr}, - {0x430352b3, "SystemNative_GetNameInfo", nullptr}, - {0x43f6cea1, "AndroidCryptoNative_DesCfb8", nullptr}, - {0x4543d533, "AndroidCryptoNative_EcDsaVerify", nullptr}, - {0x45f09dca, "AndroidCryptoNative_CipherSetTagLength", nullptr}, - {0x477f60cf, "SystemNative_OpenDir", nullptr}, - {0x47a82b4e, "SystemNative_AlignedRealloc", nullptr}, - {0x48c17c9b, "SystemNative_Sysctl", nullptr}, - {0x493888ee, "CompressionNative_Crc32", nullptr}, - {0x494ef6d4, "SystemNative_GetIPv4MulticastOption", nullptr}, - {0x496f1885, "SystemNative_GetSocketErrorOption", nullptr}, - {0x49c2af32, "SystemNative_GetBootTimeTicks", nullptr}, - {0x49c81782, "SystemNative_MkDir", nullptr}, - {0x4a4ef46f, "SystemNative_FcntlGetFD", nullptr}, - {0x4b78d330, "CryptoNative_HmacCurrent", nullptr}, - {0x4c6d50ba, "SystemNative_GetIPv4GlobalStatistics", nullptr}, - {0x4ca38207, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, - {0x4cb997ae, "BrotliEncoderCompress", nullptr}, - {0x4d1a35d1, "SystemNative_LowLevelMonitor_Release", nullptr}, - {0x4d75bb15, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, - {0x4dbf0c74, "SystemNative_CreateSocketEventBuffer", nullptr}, - {0x4e4d4f2a, "SystemNative_SetIPv6Address", nullptr}, - {0x4f6011da, "SystemNative_GetPort", nullptr}, - {0x4f6c3726, "SystemNative_FcntlGetIsNonBlocking", nullptr}, - {0x50309413, "SystemNative_GetPeerUserName", nullptr}, - {0x50e88639, "CryptoNative_HmacUpdate", nullptr}, - {0x514e739b, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, - {0x52590509, "AndroidCryptoNative_Aes128Cbc", nullptr}, - {0x526c9f90, "SystemNative_GetNumRoutes", nullptr}, - {0x52896a81, "SystemNative_ChMod", nullptr}, - {0x5600bd0d, "AndroidCryptoNative_SSLStreamCreate", nullptr}, - {0x561fb6ff, "SystemNative_FStat", nullptr}, - {0x56993aa9, "SystemNative_SetKeypadXmit", nullptr}, - {0x57bdcc46, "SystemNative_Open", nullptr}, - {0x581adfc6, "SystemNative_GetSignalForBreak", nullptr}, - {0x5906e1ba, "SystemNative_Close", nullptr}, - {0x591c5746, "AndroidCryptoNative_EcKeyUpRef", nullptr}, - {0x59840533, "AndroidCryptoNative_X509Decode", nullptr}, - {0x5989ad17, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, - {0x599921d3, "SystemNative_SysConf", nullptr}, - {0x59b67f4d, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, - {0x59e712d5, "SystemNative_MkdTemp", nullptr}, - {0x5a492732, "SystemNative_FcntlSetFD", nullptr}, - {0x5ccc38dd, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, - {0x5e9ef1a2, "SystemNative_GetAtOutOfBandMark", nullptr}, - {0x5eb4f827, "SystemNative_LockFileRegion", nullptr}, - {0x5ed67634, "SystemNative_GetPwUidR", nullptr}, - {0x5f706f52, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, - {0x5fc58bed, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, - {0x60571eb9, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, - {0x6068baa0, "AndroidCryptoNative_GetRsaParameters", nullptr}, - {0x608ee1a5, "SystemNative_Calloc", nullptr}, - {0x60c353e5, "SystemNative_SetPosixSignalHandler", nullptr}, - {0x613c0080, "AndroidCryptoNative_Aes192Ccm", nullptr}, - {0x626db703, "SystemNative_LStat", nullptr}, - {0x6288dd9a, "SystemNative_SetSignalForBreak", nullptr}, - {0x62a36e75, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, - {0x639b2b1d, "AndroidCryptoNative_DsaVerify", nullptr}, - {0x6436999d, "AndroidCryptoNative_SSLStreamRead", nullptr}, - {0x6441bc65, "CryptoNative_EvpSha256", nullptr}, - {0x64f12e5b, "BrotliDecoderIsFinished", nullptr}, - {0x661c5218, "SystemNative_GetDomainName", nullptr}, - {0x6661a841, "BrotliDecoderDecompressStream", nullptr}, - {0x674bdf7f, "SystemNative_DisablePosixSignalHandling", nullptr}, - {0x679dd832, "SystemNative_SetPort", nullptr}, - {0x679f9b4e, "SystemNative_FcntlGetPipeSz", nullptr}, - {0x67de0842, "SystemNative_Dup", nullptr}, - {0x687726ff, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, - {0x68bdc398, "SystemNative_INotifyAddWatch", nullptr}, - {0x68c949a0, "AndroidCryptoNative_X509GetContentType", nullptr}, - {0x68f9f52f, "AndroidCryptoNative_CipherIsSupported", nullptr}, - {0x6907c8eb, "BrotliEncoderSetParameter", nullptr}, - {0x6adb646e, "SystemNative_ReadDirR", nullptr}, - {0x6b5343a0, "SystemNative_SetErrNo", nullptr}, - {0x6bbd3d10, "SystemNative_GetRLimit", nullptr}, - {0x6be1e33d, "SystemNative_EnumerateInterfaceAddresses", nullptr}, - {0x6cda2cf8, "SystemNative_SetSendTimeout", nullptr}, - {0x6d48392a, "SystemNative_Stat", nullptr}, - {0x6ece5fe6, "SystemNative_GetPid", nullptr}, - {0x6ef4e421, "AndroidCryptoNative_CipherDestroy", nullptr}, - {0x6f695cb8, "SystemNative_RmDir", nullptr}, - {0x6fa886b1, "SystemNative_GetSockName", nullptr}, - {0x708e7911, "SystemNative_SetIPv4Address", nullptr}, - {0x70d4f7e6, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, - {0x70e91ddd, "SystemNative_FChMod", nullptr}, - {0x71698a7f, "SystemNative_GetDomainSocketSizes", nullptr}, - {0x7243c4b4, "AndroidCryptoNative_Des3Cfb8", nullptr}, - {0x759f5b1e, "AndroidCryptoNative_Aes256Cfb8", nullptr}, - {0x75b11f61, "BrotliDecoderGetErrorCode", nullptr}, - {0x76e97b2e, "SystemNative_Rename", nullptr}, - {0x77cb373b, "SystemNative_GetIPSocketAddressSizes", nullptr}, - {0x78c1eb52, "AndroidCryptoNative_Des3Ecb", nullptr}, - {0x7a0529c1, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, - {0x7ad3b820, "AndroidCryptoNative_Aes192Cfb128", nullptr}, - {0x7cb19137, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, - {0x7d0c477d, "CryptoNative_ErrPeekLastError", nullptr}, - {0x7d2bb98a, "SystemNative_MksTemps", nullptr}, - {0x7de70253, "SystemNative_ConvertErrorPalToPlatform", nullptr}, - {0x7e882ae5, "BrotliEncoderIsFinished", nullptr}, - {0x7f5d9e25, "SystemNative_MUnmap", nullptr}, - {0x80deced4, "SystemNative_CreateAutoreleasePool", nullptr}, - {0x81a5efac, "SystemNative_SetEUid", nullptr}, - {0x82484cbf, "CryptoNative_EvpDigestOneShot", nullptr}, - {0x8289a6f7, "BrotliDefaultFreeFunc", nullptr}, - {0x83dad9bf, "SystemNative_Pipe", nullptr}, - {0x83db1b72, "CryptoNative_EvpDigestCurrent", nullptr}, - {0x84662605, "CompressionNative_Deflate", nullptr}, - {0x8526c9e8, "SystemNative_SetRawSockOpt", nullptr}, - {0x8574b133, "AndroidCryptoNative_Aes192Ecb", nullptr}, - {0x88a7558d, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, - {0x8bdaf06c, "SystemNative_GetWindowSize", nullptr}, - {0x8bfcd7ba, "CompressionNative_Inflate", nullptr}, - {0x8d38b733, "SystemNative_LSeek", nullptr}, - {0x8f4e59f1, "SystemNative_ReadStdin", nullptr}, - {0x909e12ee, "SystemNative_SearchPath", nullptr}, - {0x910b7740, "SystemNative_GetFormatInfoForMountPoint", nullptr}, - {0x913a3d68, "SystemNative_GetDeviceIdentifiers", nullptr}, - {0x9216d936, "SystemNative_GetGroupName", nullptr}, - {0x94477030, "AndroidCryptoNative_Aes256Ccm", nullptr}, - {0x95e99740, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, - {0x960d4fc0, "SystemNative_GetDefaultTimeZone", nullptr}, - {0x966f54af, "CryptoNative_EvpSha384", nullptr}, - {0x9787b4b4, "CryptoNative_EvpMdSize", nullptr}, - {0x98105435, "SystemNative_GetIPv6Address", nullptr}, - {0x984edaf1, "AndroidCryptoNative_RsaDestroy", nullptr}, - {0x9852b0fa, "SystemNative_INotifyRemoveWatch", nullptr}, - {0x98954db8, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, - {0x98ca7f1c, "SystemNative_ChDir", nullptr}, - {0x990163b4, "SystemNative_Receive", nullptr}, - {0x996952b3, "AndroidCryptoNative_CipherFinalEx", nullptr}, - {0x9a005080, "SystemNative_Bind", nullptr}, - {0x9a84ffd3, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, - {0x9abfce84, "SystemNative_GetEnviron", nullptr}, - {0x9bda7eb1, "SystemNative_ReadProcessStatusInfo", nullptr}, - {0x9cd6cae8, "AndroidCryptoNative_SSLStreamRelease", nullptr}, - {0x9d102d58, "CompressionNative_InflateEnd", nullptr}, - {0x9d7f4af6, "SystemNative_ReceiveMessage", nullptr}, - {0x9dc3baed, "SystemNative_LowLevelMonitor_Destroy", nullptr}, - {0x9e366e9c, "SystemNative_InterfaceNameToIndex", nullptr}, - {0x9e717f20, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, - {0x9f47b32d, "SystemNative_ShmOpen", nullptr}, - {0xa0db1858, "SystemNative_GetEnv", nullptr}, - {0xa1295a9f, "SystemNative_MkFifo", nullptr}, - {0xa1bec9da, "SystemNative_LogError", nullptr}, - {0xa1d774fc, "BrotliEncoderHasMoreOutput", nullptr}, - {0xa2430b33, "SystemNative_SearchPath_TempDirectory", nullptr}, - {0xa25daa0e, "BrotliSetDictionaryData", nullptr}, - {0xa2d2f390, "SystemNative_TryChangeSocketEventRegistration", nullptr}, - {0xa4636764, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, - {0xa477c74e, "SystemNative_TryGetIPPacketInformation", nullptr}, - {0xa635da0f, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, - {0xa691d151, "AndroidCryptoNative_Aes192Cbc", nullptr}, - {0xa72ce322, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, - {0xa826eabe, "SystemNative_FcntlSetIsNonBlocking", nullptr}, - {0xa829138a, "SystemNative_GetProcessPath", nullptr}, - {0xa8701bcf, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, - {0xa8da7ba1, "BrotliEncoderVersion", nullptr}, - {0xa936bc40, "AndroidCryptoNative_EcDsaSize", nullptr}, - {0xa9c29be5, "SystemNative_SetIPv6MulticastOption", nullptr}, - {0xa9c84a4a, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, - {0xaa2f32ad, "SystemNative_FTruncate", nullptr}, - {0xab37a684, "CryptoNative_HmacCreate", nullptr}, - {0xab3d1641, "AndroidCryptoNative_DesEcb", nullptr}, - {0xabe6739f, "BrotliGetDictionary", nullptr}, - {0xacc26fa4, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, - {0xacc28460, "SystemNative_GetProcAddress", nullptr}, - {0xad7fbde5, "SystemNative_FUTimens", nullptr}, - {0xae443204, "SystemNative_GetSockOpt", nullptr}, - {0xae449ad1, "BrotliDecoderIsUsed", nullptr}, - {0xafb02e71, "BrotliEncoderMaxCompressedSize", nullptr}, - {0xb01e9c27, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, - {0xb030a893, "SystemNative_LowLevelMonitor_Acquire", nullptr}, - {0xb0e270a0, "BrotliEncoderDestroyInstance", nullptr}, - {0xb22a12be, "BrotliEncoderCreateInstance", nullptr}, - {0xb26f05b6, "SystemNative_PWrite", nullptr}, - {0xb2965ccd, "CryptoNative_GetMaxMdSize", nullptr}, - {0xb2985645, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, - {0xb4110b14, "AndroidCryptoNative_DsaGenerateKey", nullptr}, - {0xb427959c, "SystemNative_FLock", nullptr}, - {0xb439ebdb, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, - {0xb444f04a, "SystemNative_Accept", nullptr}, - {0xb448a24a, "SystemNative_SymLink", nullptr}, - {0xb4e5c37d, "SystemNative_UTimensat", nullptr}, - {0xb5a5754a, "SystemNative_UninitializeConsoleAfterRead", nullptr}, - {0xb5db6a51, "SystemNative_PWriteV", nullptr}, - {0xb628f475, "SystemNative_GetBytesAvailable", nullptr}, - {0xb7041ffa, "SystemNative_GetControlCharacters", nullptr}, - {0xb7cc3cd1, "AndroidCryptoNative_DesCbc", nullptr}, - {0xb80f233c, "SystemNative_FSync", nullptr}, - {0xb84914f1, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, - {0xb862b34e, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, - {0xb884b933, "SystemNative_StdinReady", nullptr}, - {0xb96c2133, "SystemNative_GetErrNo", nullptr}, - {0xb97add7d, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, - {0xb9e6cb2c, "SystemNative_RealPath", nullptr}, - {0xba284ef4, "CryptoNative_EvpSha1", nullptr}, - {0xbb06f5e1, "AndroidCryptoNative_Aes192Gcm", nullptr}, - {0xbb25ff40, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, - {0xbb2ca4f3, "SystemNative_Link", nullptr}, - {0xbb92466f, "SystemNative_AlignedAlloc", nullptr}, - {0xbd658356, "CryptoNative_ErrErrorStringN", nullptr}, - {0xbdbf2140, "SystemNative_SchedGetAffinity", nullptr}, - {0xbec8a3f2, "SystemNative_FChflags", nullptr}, - {0xbf4eeb78, "AndroidCryptoNative_GetBigNumBytes", nullptr}, - {0xbf9766c3, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, - {0xbfa0ce53, "SystemNative_GetPlatformSignalNumber", nullptr}, - {0xbfaad12d, "BrotliDecoderSetParameter", nullptr}, - {0xc090b1d3, "CryptoNative_EvpSha512", nullptr}, - {0xc0d66913, "SystemNative_GetUnixVersion", nullptr}, - {0xc11dec94, "SystemNative_FAllocate", nullptr}, - {0xc1243135, "AndroidCryptoNative_Aes128Gcm", nullptr}, - {0xc1e4e6f6, "AndroidCryptoNative_BigNumToBinary", nullptr}, - {0xc25ffc33, "BrotliEncoderCompressStream", nullptr}, - {0xc3812682, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, - {0xc3dcc3a0, "AndroidCryptoNative_SetRsaParameters", nullptr}, - {0xc3e6ff56, "SystemNative_LowLevelMonitor_Create", nullptr}, - {0xc475f41c, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, - {0xc4ac1723, "AndroidCryptoNative_Aes256Cbc", nullptr}, - {0xc55548f2, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, - {0xc57b40fa, "SystemNative_LoadLibrary", nullptr}, - {0xc6d5929c, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, - {0xc6f2fb9e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, - {0xc717b16e, "CryptoNative_EvpMdCtxDestroy", nullptr}, - {0xc746b70c, "AndroidCryptoNative_DsaSign", nullptr}, - {0xc7f0668d, "CompressionNative_DeflateReset", nullptr}, - {0xc83527e0, "CryptoNative_HmacReset", nullptr}, - {0xc89ccd22, "SystemNative_SchedGetCpu", nullptr}, - {0xc8cce896, "SystemNative_GetSocketType", nullptr}, - {0xc8e06b20, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, - {0xc9b017c8, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, - {0xca5aab33, "SystemNative_Sync", nullptr}, - {0xcb458400, "CryptoNative_ErrGetErrorAlloc", nullptr}, - {0xcb746e5c, "SystemNative_SetIPv4MulticastOption", nullptr}, - {0xcb85cd8e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, - {0xccc0dd15, "SystemNative_RegisterForSigChld", nullptr}, - {0xcdfb627d, "SystemNative_FreeLibrary", nullptr}, - {0xce91e293, "SystemNative_GetGroupList", nullptr}, - {0xcf9bcc75, "AndroidCryptoNative_Aes256Gcm", nullptr}, - {0xcfa9e6f1, "AndroidCryptoNative_GetDsaParameters", nullptr}, - {0xcff9b341, "SystemNative_GetSystemTimeAsTicks", nullptr}, - {0xd199e841, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, - {0xd24d4849, "SystemNative_Socket", nullptr}, - {0xd298c3b3, "SystemNative_Write", nullptr}, - {0xd378ba49, "CryptoNative_EvpMd5", nullptr}, - {0xd473c64c, "SystemNative_SetReceiveTimeout", nullptr}, - {0xd4b91180, "SystemNative_ForkAndExecProcess", nullptr}, - {0xd6d7b4fb, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, - {0xd71d8c66, "AndroidCryptoNative_Aes256Ecb", nullptr}, - {0xd7ee326b, "AndroidCryptoNative_EcKeyDestroy", nullptr}, - {0xd818a523, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, - {0xd9458396, "BrotliDecoderCreateInstance", nullptr}, - {0xdaaa19b2, "SystemNative_GetAllMountPoints", nullptr}, - {0xdac67152, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, - {0xdad29aeb, "AndroidCryptoNative_CipherUpdate", nullptr}, - {0xdaf0460a, "SystemNative_SendFile", nullptr}, - {0xdbbf4917, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, - {0xdbdce4ef, "BrotliDefaultAllocFunc", nullptr}, - {0xdbe13a57, "SystemNative_GetCpuUtilization", nullptr}, - {0xdc3cbeec, "CryptoNative_HmacOneShot", nullptr}, - {0xdcaddb21, "AndroidCryptoNative_GetECKeyParameters", nullptr}, - {0xdd274c15, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, - {0xdd445632, "AndroidCryptoNative_X509ChainValidate", nullptr}, - {0xddd58443, "SystemNative_PReadV", nullptr}, - {0xdea9b9dc, "SystemNative_EnablePosixSignalHandling", nullptr}, - {0xdf4f1977, "AndroidCryptoNative_X509PublicKey", nullptr}, - {0xdf80df75, "SystemNative_iOSSupportVersion", nullptr}, - {0xe121bac7, "SystemNative_GetPeerID", nullptr}, - {0xe169faa6, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, - {0xe1b8b44f, "SystemNative_Send", nullptr}, - {0xe2a0d0de, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, - {0xe4a78efb, "SystemNative_SetPriority", nullptr}, - {0xe4dba4f6, "SystemNative_GetCwd", nullptr}, - {0xe4f87d25, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, - {0xe50c82b4, "SystemNative_CreateThread", nullptr}, - {0xe58ed8fe, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, - {0xe5ef37b3, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, - {0xe770cb3f, "SystemNative_CopyFile", nullptr}, - {0xe7a9a106, "CompressionNative_InflateInit2_", nullptr}, - {0xe7bd8dd1, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, - {0xe890cf58, "AndroidCryptoNative_EcDsaSign", nullptr}, - {0xe8b2ec8d, "BrotliDecoderErrorString", nullptr}, - {0xe972fbd9, "SystemNative_GetEGid", nullptr}, - {0xea86f52f, "BrotliEncoderTakeOutput", nullptr}, - {0xeb0d0522, "SystemNative_LowLevelMonitor_Wait", nullptr}, - {0xebacbf92, "AndroidCryptoNative_Aes128Cfb8", nullptr}, - {0xec31140d, "BrotliDecoderHasMoreOutput", nullptr}, - {0xec51a1b4, "SystemNative_LChflags", nullptr}, - {0xed6cc182, "CryptoNative_EvpMdCtxCreate", nullptr}, - {0xee74a5ad, "AndroidCryptoNative_DsaSizeP", nullptr}, - {0xef48c2eb, "CryptoNative_EvpDigestReset", nullptr}, - {0xef5890c7, "AndroidCryptoNative_Des3Cbc", nullptr}, - {0xefb38c9f, "SystemNative_Poll", nullptr}, - {0xefd277f7, "CryptoNative_HmacFinal", nullptr}, - {0xf06b440b, "AndroidCryptoNative_DsaSizeSignature", nullptr}, - {0xf0919525, "AndroidCryptoNative_CipherReset", nullptr}, - {0xf0e499c4, "SystemNative_PRead", nullptr}, - {0xf1bb5b47, "SystemNative_ReadLink", nullptr}, - {0xf23e6314, "AndroidCryptoNative_RsaCreate", nullptr}, - {0xf2a49cf0, "SystemNative_CloseSocketEventPort", nullptr}, - {0xf39b1c3a, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, - {0xf3b9c879, "AndroidCryptoNative_X509Encode", nullptr}, - {0xf432ab33, "SystemNative_CloseDir", nullptr}, - {0xf4a5a1c8, "SystemNative_SysLog", nullptr}, - {0xf500c9d3, "SystemNative_GetActiveUdpListeners", nullptr}, - {0xf57828fb, "SystemNative_IsATty", nullptr}, - {0xf6141499, "AndroidCryptoNative_X509ChainBuild", nullptr}, - {0xf629d20f, "SystemNative_Shutdown", nullptr}, - {0xf6b01c6b, "SystemNative_FreeEnviron", nullptr}, - {0xf6bfedad, "SystemNative_ReadEvents", nullptr}, - {0xf91cf365, "AndroidCryptoNative_Aes128Ccm", nullptr}, - {0xf94a4828, "SystemNative_GetEUid", nullptr}, - {0xf993f426, "SystemNative_Free", nullptr}, - {0xfa97914b, "SystemNative_MMap", nullptr}, - {0xfad61722, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, - {0xfb89157f, "SystemNative_GetGroups", nullptr}, - {0xfc83423c, "SystemNative_GetRawSockOpt", nullptr}, - {0xfe2f2c47, "SystemNative_DrainAutoreleasePool", nullptr}, - {0xfeb6c5c7, "SystemNative_WaitPidExitedNoHang", nullptr}, - {0xff3b4cfa, "SystemNative_GetFileSystemType", nullptr}, - {0xff975200, "SystemNative_Realloc", nullptr}, -}; ->>>>>>> 13ba4b152 (Let's see what breaks) -======= +constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; +constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; +constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; +constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; +constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; #else //32-bit internal p/invoke table - std::array internal_pinvokes {{ + std::array internal_pinvokes {{ {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0x2a0e1744, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0x2f7d0f53, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, @@ -3138,32 +1082,15 @@ constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; {0xff975200, "SystemNative_Realloc", nullptr}, }}; ->>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) constexpr hash_t java_interop_library_hash = 0x6e36e350; constexpr hash_t xa_internal_api_library_hash = 0x13c9bd62; constexpr hash_t system_native_library_hash = 0x5b9ade60; constexpr hash_t system_io_compression_native_library_hash = 0xafe3142c; constexpr hash_t system_security_cryptography_native_android_library_hash = 0x93625cd; -<<<<<<< HEAD -<<<<<<< HEAD constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a; #endif constexpr size_t internal_pinvokes_count = 47; constexpr size_t dotnet_pinvokes_count = 477; } // end of anonymous namespace -======= -#endif - -constexpr size_t internal_pinvokes_count = 49; -constexpr size_t dotnet_pinvokes_count = 428; ->>>>>>> 13ba4b152 (Let's see what breaks) -======= -constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a; -#endif - -constexpr size_t internal_pinvokes_count = 49; -constexpr size_t dotnet_pinvokes_count = 477; -} // end of anonymous namespace ->>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) diff --git a/src/native/pinvoke-override/precompiled.cc b/src/native/pinvoke-override/precompiled.cc index db6691815d8..1c84095080a 100644 --- a/src/native/pinvoke-override/precompiled.cc +++ b/src/native/pinvoke-override/precompiled.cc @@ -19,15 +19,7 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); if (library_name_hash == java_interop_library_hash || library_name_hash == xa_internal_api_library_hash) { -<<<<<<< HEAD -<<<<<<< HEAD PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes.data (), internal_pinvokes_count); -======= - PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes, internal_pinvokes_count); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= - PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes.data (), internal_pinvokes_count); ->>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) if (entry == nullptr) [[unlikely]] { log_fatal (LOG_ASSEMBLY, "Internal p/invoke symbol '%s @ %s' (hash: 0x%zx) not found in compile-time map.", library_name, entrypoint_name, entrypoint_hash); @@ -60,30 +52,14 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha dotnet_dso_handle = &system_security_cryptography_native_android_library_handle; } else if (library_name_hash == system_io_compression_native_library_hash) { dotnet_dso_handle = &system_io_compression_native_library_handle; -<<<<<<< HEAD -<<<<<<< HEAD - } else if (library_name_hash == system_globalization_native_library_hash) { - dotnet_dso_handle = &system_globalization_native_library_handle; -======= ->>>>>>> 13ba4b152 (Let's see what breaks) -======= } else if (library_name_hash == system_globalization_native_library_hash) { dotnet_dso_handle = &system_globalization_native_library_handle; ->>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) } else { dotnet_dso_handle = nullptr; } if (dotnet_dso_handle != nullptr) { -<<<<<<< HEAD -<<<<<<< HEAD - PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes.data (), dotnet_pinvokes_count); -======= - PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes, dotnet_pinvokes_count); ->>>>>>> 13ba4b152 (Let's see what breaks) -======= PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes.data (), dotnet_pinvokes_count); ->>>>>>> a67d780fc (Update the list of p/invokes, slight generated code changes) if (entry != nullptr) { if (entry->func != nullptr) { return entry->func; From ab1bb21e604a35b5ec69330e103cfae5866c07ff Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 27 Aug 2024 16:22:45 +0200 Subject: [PATCH 19/53] Some post-rebase fixups --- .../create-packs/Microsoft.Android.Runtime.proj | 16 +++++++++------- src/native/libunwind/CMakeLists.txt | 1 + src/native/lz4/CMakeLists.txt | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index c087be4b75d..62eccc467fb 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -42,13 +42,15 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-debug-app-helper.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-native-tracing.so" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libunwind_xamarin.a" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libruntime-base.a" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-java-interop.a" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-lz4.a" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-shared-bits.a" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release-static.a" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libpinvoke-override-dynamic.a" /> + + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libarchive-dso-stub.so" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libunwind_xamarin-release.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libruntime-base-release.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-java-interop-release.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-lz4-release.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-shared-bits-release.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release-static-release.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libpinvoke-override-dynamic-release.a" /> diff --git a/src/native/libunwind/CMakeLists.txt b/src/native/libunwind/CMakeLists.txt index 3de53d23d34..b4696b32af3 100644 --- a/src/native/libunwind/CMakeLists.txt +++ b/src/native/libunwind/CMakeLists.txt @@ -324,6 +324,7 @@ add_library( ) add_library(${LIB_ALIAS} ALIAS ${LIB_NAME}) +set_static_library_suffix(${LIB_NAME}) list(APPEND LIBUNWIND_INCLUDE_DIRS ${LIBUNWIND_SOURCE_DIR}/include/tdep diff --git a/src/native/lz4/CMakeLists.txt b/src/native/lz4/CMakeLists.txt index 75552bd5828..c549f753edf 100644 --- a/src/native/lz4/CMakeLists.txt +++ b/src/native/lz4/CMakeLists.txt @@ -15,6 +15,7 @@ add_library( ) add_library(${LIB_ALIAS} ALIAS ${LIB_NAME}) +set_static_library_suffix(${LIB_NAME}) target_compile_definitions( ${LIB_NAME} From 03abff988214d7c580d563964a3bbaec5adaff9b Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Thu, 29 Aug 2024 21:13:05 +0200 Subject: [PATCH 20/53] Try to make it work at run time --- ...oft.Android.Sdk.AssemblyResolution.targets | 1 + ...icrosoft.Android.Sdk.NativeRuntime.targets | 2 ++ .../Tasks/BuildApk.cs | 7 ++++- .../Tasks/ProcessNativeLibraries.cs | 6 ++++ .../Utilities/NativeRuntimeComponents.cs | 31 ++++++++++--------- .../java/mono/android/MonoPackageManager.java | 8 ++--- src/native/pinvoke-override/dynamic.cc | 10 ++++++ 7 files changed, 46 insertions(+), 19 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets index 512f3210821..c6496b1f95a 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets @@ -240,6 +240,7 @@ _ResolveAssemblies MSBuild target. <_ExcludedNativeLibraries Condition=" '$(_AndroidEnableNativeStackTracing)' != 'true' " Include="libxamarin-native-tracing" /> <_UnifiedNativeRuntime Include="$(_AndroidApplicationSharedLibraryPath)%(_BuildTargetAbis.Identity)\libmonodroid-unified.so"> %(_BuildTargetAbis.Identity) + libmonodroid.so <_ResolvedNativeArchive Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.a' " /> + <_ApplicationSharedLibrary Include="@(_UnifiedNativeRuntime)" /> Date: Fri, 30 Aug 2024 21:06:58 +0200 Subject: [PATCH 21/53] Moar linking ahead --- .../Microsoft.Android.Runtime.proj | 3 + .../xaprepare/ConfigAndData/Configurables.cs | 33 ++++++++++ .../xaprepare/Steps/Step_Android_SDK_NDK.cs | 61 +++++++++++++++++++ ...icrosoft.Android.Sdk.NativeRuntime.targets | 2 + .../Tasks/GetNativeRuntimeComponents.cs | 4 ++ .../Utilities/NativeLinker.cs | 12 +++- .../Utilities/NativeRuntimeComponents.cs | 3 + 7 files changed, 115 insertions(+), 3 deletions(-) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index 62eccc467fb..b6515f43e23 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -51,6 +51,9 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-shared-bits-release.a" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release-static-release.a" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libpinvoke-override-dynamic-release.a" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\crtbegin_so.o" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\crtend_so.o" /> + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libclang_rt.builtins-*-android.a" /> diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs index 0790eb28afd..3e97615f823 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs @@ -145,6 +145,37 @@ public static partial class Defaults { "x86_64", "x86_64-linux-android" }, }; + public static readonly Dictionary AbiToRID = new (StringComparer.Ordinal) { + { "armeabi-v7a", "android-arm" }, + { "arm64-v8a", "android-arm64" }, + { "x86", "android-x86" }, + { "x86_64", "android-x64" }, + }; + + public static readonly Dictionary AbiToClangArch = new (StringComparer.Ordinal) { + { "armeabi-v7a", "arm" }, + { "arm64-v8a", "aarch64" }, + { "x86", "i686" }, + { "x86_64", "x86_64" }, + }; + + /// + /// Used in rules.mk generator. Files to include in the XA bundle archives. + /// + public static readonly List BundleZipsInclude = new List { + "$(ZIP_OUTPUT_BASENAME)/THIRD-PARTY-NOTICES.TXT", + "$(ZIP_OUTPUT_BASENAME)/bin/Debug", + "$(ZIP_OUTPUT_BASENAME)/bin/Release", + }; + + /// + /// Used in rules.mk generator. Files to exclude from the XA bundle archives. Must be syntactically + /// correct for GNU Make. + /// + public static readonly List BundleZipsExclude = new List { + "$(ZIP_OUTPUT_BASENAME)/bin/*/bundle-*.zip" + }; + public static readonly List NDKTools = new List { // Tools prefixed with architecture triple new NDKTool (name: "as", prefixed: true), @@ -219,6 +250,7 @@ public static partial class Paths // Other public static string AndroidNdkDirectory => ctx.Properties.GetRequiredValue (KnownProperties.AndroidNdkDirectory); public static string AndroidToolchainRootDirectory => GetCachedPath (ref androidToolchainRootDirectory, () => Path.Combine (AndroidNdkDirectory, "toolchains", "llvm", "prebuilt", NdkToolchainOSTag)); + public static string AndroidClangRootDirectory => GetCachedPath (ref androidClangRootDirectory, () => Path.Combine (AndroidToolchainRootDirectory, "lib", "clang")); public static string AndroidToolchainBinDirectory => GetCachedPath (ref androidToolchainBinDirectory, () => Path.Combine (AndroidToolchainRootDirectory, "bin")); public static string AndroidToolchainSysrootLibDirectory => GetCachedPath (ref androidToolchainSysrootLibDirectory, () => Path.Combine (AndroidToolchainRootDirectory, "sysroot", "usr", "lib")); public static string WindowsBinutilsInstallDir => GetCachedPath (ref windowsBinutilsInstallDir, () => Path.Combine (InstallMSBuildDir, "binutils")); @@ -263,6 +295,7 @@ static string GetCachedPath (ref string? variable, Func creator) static string? buildBinDir; static string? binDir; static string? androidToolchainRootDirectory; + static string? androidClangRootDirectory; static string? androidToolchainBinDirectory; static string? androidToolchainSysrootLibDirectory; static string? installMSBuildDir; diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs b/build-tools/xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs index 5879fcbc703..832127fdb85 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -151,6 +152,10 @@ bool AcceptLicenses (Context context, string sdkRoot) bool GatherNDKInfo (Context context) { + if (!CopyRedistributableFiles (context)) { + return false; + } + // Ignore NDK property setting if not installing the NDK if (!DependencyTypeToInstall.HasFlag (AndroidToolchainComponentType.BuildDependency)) return true; @@ -158,6 +163,62 @@ bool GatherNDKInfo (Context context) return context.BuildInfo.GatherNDKInfo (context); } + bool CopyRedistributableFiles (Context context) + { + string androidVersionPath = Path.Combine (Configurables.Paths.AndroidToolchainRootDirectory, "AndroidVersion.txt"); + if (!File.Exists (androidVersionPath)) { + throw new InvalidOperationException ($"Android version file '{androidVersionPath}' not found"); + } + + string[]? lines = File.ReadAllLines (androidVersionPath); + if (lines == null || lines.Length < 1) { + throw new InvalidOperationException ($"Unknown format of Android version file '{androidVersionPath}'"); + } + + // First line is (should be) the LLVM version, we need just the main release number + string[] llvmVersion = lines[0].Split ('.'); + if (llvmVersion.Length < 3) { + throw new InvalidOperationException ($"Unknown LLVM version format for '{lines[0]}'"); + } + + string clangLibPath = Path.Combine ( + Configurables.Paths.AndroidClangRootDirectory, + llvmVersion[0], + "lib", + "linux" + ); + + foreach (var kvp in Configurables.Defaults.AndroidToolchainPrefixes) { + string abi = kvp.Key; + + string crtFilesPath = Path.Combine ( + Configurables.Paths.AndroidToolchainSysrootLibDirectory, + kvp.Value, + BuildAndroidPlatforms.NdkMinimumAPI.ToString (CultureInfo.InvariantCulture) + ); + + CopyFile (abi, crtFilesPath, "crtbegin_so.o"); + CopyFile (abi, crtFilesPath, "crtend_so.o"); + CopyFile (abi, clangLibPath, $"libclang_rt.builtins-{Configurables.Defaults.AbiToClangArch[abi]}-android.a"); + } + + return true; + + void CopyFile (string abi, string sourceDir, string fileName) + { + Log.StatusLine ($" {context.Characters.Bullet} Copying NDK redistributable: ", $"{fileName} ({abi})", tailColor: ConsoleColor.White); + string rid = Configurables.Defaults.AbiToRID [abi]; + string outputDir = Path.Combine ( + context.Properties.GetRequiredValue (KnownProperties.MicrosoftAndroidSdkOutDir), + "lib", + rid + ); + + string sourceFile = Path.Combine (sourceDir, fileName); + Utilities.CopyFileToDir (sourceFile, outputDir); + } + } + void CheckPackageStatus (Context context, string packageCacheDir, AndroidPackage pkg, List toDownload) { Log.StatusLine ($" {context.Characters.Bullet} Installing ", pkg.Component.Name, tailColor: ConsoleColor.White); diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets index 2578dcfd605..9a470bb58a0 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets @@ -20,11 +20,13 @@ Contains code to build and link the native runtime at application build time. <_ResolvedNativeArchive Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.a' " /> + <_ResolvedNativeObjectFile Include="@(ResolvedFileToPublish)" Condition=" '%(ResolvedFileToPublish.Extension)' == '.o' " /> <_ApplicationSharedLibrary Include="@(_UnifiedNativeRuntime)" /> diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs index f15fd015255..bbaf3a8c4cf 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs @@ -17,6 +17,9 @@ public class GetNativeRuntimeComponents : AndroidTask [Required] public ITaskItem[] ResolvedNativeArchives { get; set; } + [Required] + public ITaskItem[] ResolvedNativeObjectFiles { get; set; } + [Output] public ITaskItem[] NativeArchives { get; set; } @@ -28,6 +31,7 @@ public override bool RunTask () var components = new NativeRuntimeComponents (MonoComponents); var uniqueAbis = new HashSet (StringComparer.OrdinalIgnoreCase); var archives = new List (); + foreach (NativeRuntimeComponents.Archive archiveItem in components.KnownArchives) { if (!archiveItem.Include) { continue; diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index 6f1ee95d0e2..5e4e3c228c1 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -19,16 +19,18 @@ class NativeLinker // TODO: need to enable zstd in binutils build // "--compress-debug-sections=zstd", // TODO: test the commented-out flags - // "--gc-sections", + "--gc-sections", // "--icf=safe", // "--lto=full|thin", "--export-dynamic", "-z relro", "-z noexecstack", + "-z max-page-size=16384", "--enable-new-dtags", - "--build-id", + "--build-id=sha1", "--warn-shared-textrel", - "--fatal-warnings" + "--fatal-warnings", + "--no-rosegment" }; readonly List extraArgs = new (); @@ -160,6 +162,10 @@ void WriteFilesToResponseFile (StreamWriter sw, List files) sw.Write ("--whole-archive "); } sw.Write (MonoAndroidHelper.QuoteFileNameArgument (file.ItemSpec)); + string abi = file.GetMetadata ("Abi") ?? String.Empty; + string destDir = Path.Combine ("/tmp/t", abi); + Directory.CreateDirectory (destDir); + File.Copy (file.ItemSpec, Path.Combine (destDir, Path.GetFileName (file.ItemSpec))); if (wholeArchive) { sw.Write (" --no-whole-archive"); } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index 07534bb6259..f07aaf15c30 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -91,6 +91,9 @@ public NativeRuntimeComponents (ITaskItem[] monoComponents) "m", "z", "log", + + // Atomic is a static library in clang, need to investigate if it's really needed +// "atomic", }; } From 342e927ddb1afb114f1e3eff2a231fc006b0b9e8 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 2 Sep 2024 15:29:08 +0200 Subject: [PATCH 22/53] Unified runtime is properly linked now There are not unresolved symbols, the library loads. Application won't run, as we still don't have changes to our C++ runtime which make it ready to resolve p/invokes, and other symbols, properly in the new unified shared library. --- ...icrosoft.Android.Sdk.NativeRuntime.targets | 4 ++ .../Tasks/GetNativeRuntimeComponents.cs | 65 ++++++++++++++----- .../Tasks/LinkNativeRuntime.cs | 10 ++- .../Utilities/KnownMetadata.cs | 1 + .../Utilities/NativeLinker.cs | 15 +++-- .../Utilities/NativeRuntimeComponents.cs | 27 +++++++- 6 files changed, 98 insertions(+), 24 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets index 9a470bb58a0..1fb3f06d397 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets @@ -30,6 +30,8 @@ Contains code to build and link the native runtime at application build time. ResolvedNativeArchives="@(_ResolvedNativeArchive)"> + + @@ -44,6 +46,8 @@ Contains code to build and link the native runtime at application build time. IntermediateOutputPath="$(IntermediateOutputPath)" NativeArchives="@(_SelectedNativeArchive)" NativeObjectFiles="@(_NativeAssemblyTarget)" + NativeLinkStartFiles="@(_NativeLinkStartFiles)" + NativeLinkEndFiles="@(_NativeLinkEndFiles)" LinkLibraries="@(_RequiredLinkLibraries)" OutputRuntimes="@(_UnifiedNativeRuntime)" SupportedAbis="@(_BuildTargetAbis)" diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs index bbaf3a8c4cf..e33e8ebc4de 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs @@ -26,6 +26,12 @@ public class GetNativeRuntimeComponents : AndroidTask [Output] public ITaskItem[] RequiredLibraries { get; set; } + [Output] + public ITaskItem[] LinkStartFiles { get; set; } + + [Output] + public ITaskItem[] LinkEndFiles { get; set; } + public override bool RunTask () { var components = new NativeRuntimeComponents (MonoComponents); @@ -36,20 +42,32 @@ public override bool RunTask () if (!archiveItem.Include) { continue; } - MakeItems (archiveItem, archives, uniqueAbis); + MakeArchiveItem (archiveItem, archives, uniqueAbis); } NativeArchives = archives.ToArray (); - var libraries = new List (); + var items = new List (); foreach (string lib in components.NativeLibraries) { - MakeLibraryItems (lib, libraries, uniqueAbis); + MakeLibItem (lib, items, uniqueAbis); } - RequiredLibraries = libraries.ToArray (); + RequiredLibraries = items.ToArray (); + + items = new List (); + foreach (string startFile in components.LinkStartFiles) { + MakeFileItem ("_NativeLinkStartFiles", startFile, ResolvedNativeObjectFiles, items, uniqueAbis); + } + LinkStartFiles = items.ToArray (); + + items = new List (); + foreach (string endFile in components.LinkEndFiles) { + MakeFileItem ("_NativeLinkEndFiles", endFile, ResolvedNativeObjectFiles, items, uniqueAbis); + } + LinkEndFiles = items.ToArray (); return !Log.HasLoggedErrors; } - void MakeLibraryItems (string libName, List libraries, HashSet uniqueAbis) + void MakeLibItem (string libName, List libraries, HashSet uniqueAbis) { foreach (string abi in uniqueAbis) { var item = new TaskItem (libName); @@ -58,24 +76,37 @@ void MakeLibraryItems (string libName, List libraries, HashSet archives, HashSet uniqueAbis) + void MakeFileItem (string msbuildItemName, string fileName, ITaskItem[] inputItems, List outputItems, HashSet uniqueAbis) + { + foreach (ITaskItem item in inputItems) { + string name = Path.GetFileName (item.ItemSpec); + if (String.Compare (name, fileName, StringComparison.OrdinalIgnoreCase) == 0) { + outputItems.Add (DoMakeItem (msbuildItemName, item, uniqueAbis)); + } + } + } + + void MakeArchiveItem (NativeRuntimeComponents.Archive archive, List archives, HashSet uniqueAbis) { foreach (ITaskItem resolvedArchive in ResolvedNativeArchives) { string fileName = Path.GetFileName (resolvedArchive.ItemSpec); if (String.Compare (fileName, archive.Name, StringComparison.OrdinalIgnoreCase) == 0) { - archives.Add (DoMakeItem (resolvedArchive)); + ITaskItem newItem = DoMakeItem ("_ResolvedNativeArchive", resolvedArchive, uniqueAbis); + newItem.SetMetadata (KnownMetadata.LinkWholeArchive, archive.WholeArchive.ToString ()); + archives.Add (newItem); } } + } - ITaskItem DoMakeItem (ITaskItem resolved) - { - var ret = new TaskItem (resolved.ItemSpec); - string abi = MonoAndroidHelper.RidToAbi (resolved.GetRequiredMetadata ("_ResolvedNativeArchive", "RuntimeIdentifier", Log)); - uniqueAbis.Add (abi); - ret.SetMetadata (KnownMetadata.Abi, abi); - ret.SetMetadata (KnownMetadata.LinkWholeArchive, archive.WholeArchive.ToString ()); - - return ret; - } + ITaskItem DoMakeItem (string msbuildItemName, ITaskItem sourceItem, HashSet uniqueAbis) + { + var ret = new TaskItem (sourceItem.ItemSpec); + string rid = sourceItem.GetRequiredMetadata (msbuildItemName, KnownMetadata.RuntimeIdentifier, Log); + string abi = MonoAndroidHelper.RidToAbi (rid); + uniqueAbis.Add (abi); + ret.SetMetadata (KnownMetadata.Abi, abi); + ret.SetMetadata (KnownMetadata.RuntimeIdentifier, rid); + + return ret; } } diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs index 66043e2f5d0..d0092855d47 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs @@ -30,6 +30,12 @@ public class LinkNativeRuntime : AsyncTask [Required] public ITaskItem[] NativeObjectFiles { get; set; } + [Required] + public ITaskItem[] NativeLinkStartFiles { get; set; } + + [Required] + public ITaskItem[] NativeLinkEndFiles { get; set; } + [Required] public ITaskItem[] OutputRuntimes { get; set; } @@ -60,7 +66,9 @@ void LinkRuntime (ITaskItem abiItem) outputRuntime, GetAbiItems (NativeObjectFiles, "_NativeAssemblyTarget", abi), GetAbiItems (NativeArchives, "_SelectedNativeArchive", abi), - GetAbiItems (LinkLibraries, "_RequiredLinkLibraries", abi) + GetAbiItems (LinkLibraries, "_RequiredLinkLibraries", abi), + GetAbiItems (NativeLinkStartFiles, "_NativeLinkStartFiles", abi), + GetAbiItems (NativeLinkEndFiles, "_NativeLinkEndFiles", abi) ); } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs b/src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs index 82337104a66..014cd2cddd0 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs @@ -4,4 +4,5 @@ static class KnownMetadata { public const string Abi = "Abi"; public const string LinkWholeArchive = "LinkWholeArchive"; + public const string RuntimeIdentifier = "RuntimeIdentifier"; } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index 5e4e3c228c1..9c6ecc2de66 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -99,13 +99,16 @@ public NativeLinker (TaskLoggingHelper log, string abi, string soname, string bi extraArgs.Add ($"-L {MonoAndroidHelper.QuoteFileNameArgument (runtimeLibsDir)}"); } - public bool Link (ITaskItem outputLibraryPath, List objectFiles, List archives, List libraries) + public bool Link (ITaskItem outputLibraryPath, List objectFiles, List archives, List libraries, + List linkStartFiles, List linkEndFiles) { log.LogDebugMessage ($"Linking: {outputLibraryPath}"); EnsureCorrectAbi (outputLibraryPath); EnsureCorrectAbi (objectFiles); EnsureCorrectAbi (archives); EnsureCorrectAbi (libraries); + EnsureCorrectAbi (linkStartFiles); + EnsureCorrectAbi (linkEndFiles); Directory.CreateDirectory (Path.GetDirectoryName (outputLibraryPath.ItemSpec)); @@ -124,6 +127,7 @@ public bool Link (ITaskItem outputLibraryPath, List objectFiles, List sw.WriteLine ("-s"); } + WriteFilesToResponseFile (sw, linkStartFiles); WriteFilesToResponseFile (sw, objectFiles); WriteFilesToResponseFile (sw, archives); @@ -131,6 +135,7 @@ public bool Link (ITaskItem outputLibraryPath, List objectFiles, List sw.WriteLine ($"-l{libItem.ItemSpec}"); } + WriteFilesToResponseFile (sw, linkEndFiles); sw.Flush (); } @@ -162,10 +167,10 @@ void WriteFilesToResponseFile (StreamWriter sw, List files) sw.Write ("--whole-archive "); } sw.Write (MonoAndroidHelper.QuoteFileNameArgument (file.ItemSpec)); - string abi = file.GetMetadata ("Abi") ?? String.Empty; - string destDir = Path.Combine ("/tmp/t", abi); - Directory.CreateDirectory (destDir); - File.Copy (file.ItemSpec, Path.Combine (destDir, Path.GetFileName (file.ItemSpec))); + // string abi = file.GetMetadata ("Abi") ?? String.Empty; + // string destDir = Path.Combine ("/tmp/t", abi); + // Directory.CreateDirectory (destDir); + // File.Copy (file.ItemSpec, Path.Combine (destDir, Path.GetFileName (file.ItemSpec))); if (wholeArchive) { sw.Write (" --no-whole-archive"); } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index f07aaf15c30..70ee1d5133a 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -34,6 +34,13 @@ public MonoComponentArchive (string name, string componentName, Func KnownArchives; public readonly List NativeLibraries; + public readonly List LinkStartFiles; + public readonly List LinkEndFiles; public NativeRuntimeComponents (ITaskItem[] monoComponents) { @@ -81,6 +90,12 @@ public NativeRuntimeComponents (ITaskItem[] monoComponents) new AndroidArchive ("libxa-lz4-release.a"), new AndroidArchive ("libxa-shared-bits-release.a"), new AndroidArchive ("libmono-android.release-static-release.a"), + + // LLVM clang built-ins archives + new ClangBuiltinsArchive ("aarch64"), + new ClangBuiltinsArchive ("arm"), + new ClangBuiltinsArchive ("i686"), + new ClangBuiltinsArchive ("x86_64"), }; // Just the base names of libraries to link into the unified runtime. Must have all the dependencies of all the static archives we @@ -95,6 +110,16 @@ public NativeRuntimeComponents (ITaskItem[] monoComponents) // Atomic is a static library in clang, need to investigate if it's really needed // "atomic", }; + + // Files that will be linked before any other object/archive/library files + LinkStartFiles = new () { + "crtbegin_so.o", + }; + + // Files that will be linked after any other object/archive/library files + LinkEndFiles = new () { + "crtend_so.o", + }; } bool MonoComponentExists (Archive archive) From 571f1ce5a203b4331d6e7a6a48444792e7d2670f Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 2 Sep 2024 22:00:12 +0200 Subject: [PATCH 23/53] Stuff --- .../Tasks/GenerateJavaStubs.cs | 1 + src/native/pinvoke-override/dynamic.cc | 5 +++++ .../pinvoke-override/pinvoke-override-api-impl.hh | 10 +++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs index 5dabfab3009..65c8be862c7 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs @@ -218,6 +218,7 @@ void Run (bool useMarshalMethods) return; } state.PinvokeInfos = pinfos; + Log.LogDebugMessage ($"Number of unique p/invokes for architecture '{arch}': {pinfos.Count}"); } // If this is the first architecture, we need to store the state for later use diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc index 0f69f6f4847..c59ed9ce405 100644 --- a/src/native/pinvoke-override/dynamic.cc +++ b/src/native/pinvoke-override/dynamic.cc @@ -1,3 +1,5 @@ +#include "logger.hh" + #define PINVOKE_OVERRIDE_INLINE [[gnu::noinline]] #include "pinvoke-override-api.hh" @@ -7,6 +9,9 @@ using namespace xamarin::android; void* PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) { + log_info (LOG_ASSEMBLY, __PRETTY_FUNCTION__); + log_info (LOG_ASSEMBLY, "library_name == '%s'; entrypoint_name == '%s'", library_name, entrypoint_name); + // TODO: implement return nullptr; } diff --git a/src/native/pinvoke-override/pinvoke-override-api-impl.hh b/src/native/pinvoke-override/pinvoke-override-api-impl.hh index 36523f092a9..c48f2647c56 100644 --- a/src/native/pinvoke-override/pinvoke-override-api-impl.hh +++ b/src/native/pinvoke-override/pinvoke-override-api-impl.hh @@ -73,11 +73,11 @@ namespace xamarin::android { bool already_loaded = !__atomic_compare_exchange ( /* ptr */ &entry.func, - /* expected */ &expected_null, - /* desired */ &entry_handle, - /* weak */ false, - /* success_memorder */ __ATOMIC_ACQUIRE, - /* failure_memorder */ __ATOMIC_RELAXED + /* expected */ &expected_null, + /* desired */ &entry_handle, + /* weak */ false, + /* success_memorder */ __ATOMIC_ACQUIRE, + /* failure_memorder */ __ATOMIC_RELAXED ); if (already_loaded) { From b6e22984e4df412c119e019c551b1ff2afe9f04d Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 3 Sep 2024 21:24:14 +0200 Subject: [PATCH 24/53] XA hello world works Experimenting with p/invoke code to see what will be the best to generate --- src/native/pinvoke-override/dynamic.cc | 756 ++++++++++++++++++++++++- 1 file changed, 751 insertions(+), 5 deletions(-) diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc index c59ed9ce405..202eb93a35e 100644 --- a/src/native/pinvoke-override/dynamic.cc +++ b/src/native/pinvoke-override/dynamic.cc @@ -1,17 +1,763 @@ +#include + +#include "internal-pinvokes.hh" #include "logger.hh" #define PINVOKE_OVERRIDE_INLINE [[gnu::noinline]] -#include "pinvoke-override-api.hh" +#include "pinvoke-override-api-impl.hh" using namespace xamarin::android; +// TODO: these should be shared with the "static" dispatch code. They currently reside in `pinvoke-tables.include` +// which is not used by the "dynamic" dispatch +#if INTPTR_MAX == INT64_MAX +constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; +constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; +constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; +constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; +constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; +constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; +#else +constexpr hash_t java_interop_library_hash = 0x6e36e350; +constexpr hash_t xa_internal_api_library_hash = 0x13c9bd62; +constexpr hash_t system_native_library_hash = 0x5b9ade60; +constexpr hash_t system_io_compression_native_library_hash = 0xafe3142c; +constexpr hash_t system_security_cryptography_native_android_library_hash = 0x93625cd; +constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a; +#endif + +extern "C" { + // Fake prototypes, just to get symbol names + + void GlobalizationNative_GetLocaleInfoInt (); + void GlobalizationNative_ToAscii (); + void GlobalizationNative_GetSortKey (); + void GlobalizationNative_InitOrdinalCasingPage (); + void GlobalizationNative_GetCalendars (); + void GlobalizationNative_GetLocaleInfoString (); + void GlobalizationNative_GetICUVersion (); + void GlobalizationNative_StartsWith (); + void GlobalizationNative_GetLocaleName (); + void GlobalizationNative_IsNormalized (); + void GlobalizationNative_GetTimeZoneDisplayName (); + void GlobalizationNative_IndexOf (); + void GlobalizationNative_NormalizeString (); + void GlobalizationNative_GetSortVersion (); + void GlobalizationNative_IanaIdToWindowsId (); + void GlobalizationNative_ToUnicode (); + void GlobalizationNative_ChangeCaseTurkish (); + void GlobalizationNative_GetCalendarInfo (); + void GlobalizationNative_WindowsIdToIanaId (); + void GlobalizationNative_GetLocaleTimeFormat (); + void GlobalizationNative_GetLatestJapaneseEra (); + void GlobalizationNative_ChangeCase (); + void GlobalizationNative_EndsWith (); + void GlobalizationNative_GetSortHandle (); + void GlobalizationNative_LoadICU (); + void GlobalizationNative_CompareString (); + void GlobalizationNative_InitICUFunctions (); + void GlobalizationNative_IsPredefinedLocale (); + void GlobalizationNative_GetDefaultLocaleName (); + void GlobalizationNative_LastIndexOf (); + void GlobalizationNative_GetJapaneseEraStartDate (); + void GlobalizationNative_GetLocales (); + void GlobalizationNative_EnumCalendarInfo (); + void GlobalizationNative_GetLocaleInfoGroupingSizes(); + void GlobalizationNative_ChangeCaseInvariant (); + void GlobalizationNative_CloseSortHandle (); + + void SystemNative_Bind (); + void SystemNative_TryGetIPPacketInformation (); + void SystemNative_Receive (); + void SystemNative_Abort (); + void SystemNative_SetPosixSignalHandler (); + void SystemNative_GetEstimatedTcpConnectionCount (); + void SystemNative_LockFileRegion (); + void SystemNative_MSync (); + void SystemNative_INotifyInit (); + void SystemNative_GetUInt64OSThreadId (); + void SystemNative_SetRLimit (); + void SystemNative_GetMaximumAddressSize (); + void SystemNative_PathConf (); + void SystemNative_LowLevelMonitor_Acquire (); + void SystemNative_Read (); + void SystemNative_SetSendTimeout (); + void SystemNative_Dup (); + void SystemNative_GetEUid (); + void SystemNative_Log (); + void SystemNative_CreateThread (); + void SystemNative_SetTerminalInvalidationHandler (); + void SystemNative_FcntlSetPipeSz (); + void SystemNative_SetSockOpt (); + void SystemNative_RealPath (); + void SystemNative_GetWindowSize (); + void SystemNative_MkDir (); + void SystemNative_CreateSocketEventPort (); + void SystemNative_TryChangeSocketEventRegistration (); + void SystemNative_GetSystemTimeAsTicks (); + void SystemNative_SNPrintF_1S (); + void SystemNative_LowLevelMonitor_TimedWait (); + void SystemNative_ConfigureTerminalForChildProcess (); + void SystemNative_GetGroupName (); + void SystemNative_GetRawSockOpt (); + void SystemNative_FStat (); + void SystemNative_GetActiveTcpConnectionInfos (); + void SystemNative_GetAddressFamily (); + void SystemNative_CloseSocketEventPort (); + void SystemNative_LChflagsCanSetHiddenFlag (); + void SystemNative_ReadDirR (); + void SystemNative_FAllocate (); + void SystemNative_Connectx (); + void SystemNative_PReadV (); + void SystemNative_HandleNonCanceledPosixSignal (); + void SystemNative_CanGetHiddenFlag (); + void SystemNative_Close (); + void SystemNative_Pipe (); + void SystemNative_SendFile (); + void SystemNative_Stat (); + void SystemNative_GetIPv6Address (); + void SystemNative_LowLevelMonitor_Wait (); + void SystemNative_LStat (); + void SystemNative_ConvertErrorPalToPlatform (); + void SystemNative_GetErrNo (); + void SystemNative_CreateSocketEventBuffer (); + void SystemNative_INotifyAddWatch (); + void SystemNative_GetIPv4Address (); + void SystemNative_CreateNetworkChangeListenerSocket (); + void SystemNative_SchedGetAffinity (); + void SystemNative_FLock (); + void SystemNative_AlignedRealloc (); + void SystemNative_InitializeTerminalAndSignalHandling (); + void SystemNative_MProtect (); + void SystemNative_GetRLimit (); + void SystemNative_Unlink (); + void SystemNative_DrainAutoreleasePool (); + void SystemNative_GetIPv6MulticastOption (); + void SystemNative_LowLevelMonitor_Destroy (); + void SystemNative_ShmUnlink (); + void SystemNative_GetSocketErrorOption (); + void SystemNative_EnablePosixSignalHandling (); + void SystemNative_StrErrorR (); + void SystemNative_RmDir (); + void SystemNative_SetIPv4MulticastOption (); + void SystemNative_SNPrintF (); + void SystemNative_ReadLink (); + void SystemNative_Accept (); + void SystemNative_FChflags (); + void SystemNative_Disconnect (); + void SystemNative_SetEUid (); + void SystemNative_FUTimens (); + void SystemNative_GetLingerOption (); + void SystemNative_FreeHostEntry (); + void SystemNative_GetFormatInfoForMountPoint (); + void SystemNative_AlignedAlloc (); + void SystemNative_SysLog (); + void SystemNative_Write (); + void SystemNative_GetOSArchitecture (); + void SystemNative_AlignedFree (); + void SystemNative_SetAddressFamily (); + void SystemNative_SetIPv6Address (); + void SystemNative_LowLevelMonitor_Create (); + void SystemNative_GetUnixRelease (); + void SystemNative_LChflags (); + void SystemNative_SetPriority (); + void SystemNative_GetSocketAddressSizes (); + void SystemNative_GetPeerID (); + void SystemNative_GetUnixVersion (); + void SystemNative_SysConf (); + void SystemNative_GetDeviceIdentifiers (); + void SystemNative_GetProcessPath (); + void SystemNative_SetDelayedSigChildConsoleConfigurationHandler (); + void SystemNative_GetEnv (); + void SystemNative_GetActiveUdpListeners (); + void SystemNative_InterfaceNameToIndex (); + void SystemNative_FTruncate (); + void SystemNative_GetControlCharacters (); + void SystemNative_GetPort (); + void SystemNative_Exit (); + void SystemNative_InitializeConsoleBeforeRead (); + void SystemNative_GetReadDirRBufferSize (); + void SystemNative_SchedSetAffinity (); + void SystemNative_GetNativeIPInterfaceStatistics (); + void SystemNative_GetSignalForBreak (); + void SystemNative_PWriteV (); + void SystemNative_FreeEnviron (); + void SystemNative_GetHostName (); + void SystemNative_FcntlSetFD (); + void SystemNative_Realloc (); + void SystemNative_PlatformSupportsDualModeIPv4PacketInfo (); + void SystemNative_GetSockOpt (); + void SystemNative_GetLoadLibraryError (); + void SystemNative_Link (); + void SystemNative_FSync (); + void SystemNative_Malloc (); + void SystemNative_ReceiveSocketError (); + void SystemNative_ReadStdin (); + void SystemNative_DisablePosixSignalHandling (); + void SystemNative_Connect (); + void SystemNative_GetAllMountPoints (); + void SystemNative_LoadLibrary (); + void SystemNative_GetTimeZoneData (); + void SystemNative_GetDomainSocketSizes (); + void SystemNative_MUnmap (); + void SystemNative_MkNod (); + void SystemNative_WaitForSocketEvents (); + void SystemNative_GetPlatformSignalNumber (); + void SystemNative_FcntlSetIsNonBlocking (); + void SystemNative_SetKeypadXmit (); + void SystemNative_MAdvise (); + void SystemNative_MkdTemp (); + void SystemNative_FChMod (); + void SystemNative_OpenDir (); + void SystemNative_WaitPidExitedNoHang (); + void SystemNative_FcntlGetPipeSz (); + void SystemNative_GetTimestamp (); + void SystemNative_SchedGetCpu (); + void SystemNative_GetPwNamR (); + void SystemNative_ShmOpen (); + void SystemNative_GetSid (); + void SystemNative_MksTemps (); + void SystemNative_GetBytesAvailable (); + void SystemNative_GetIPv4MulticastOption (); + void SystemNative_SetSignalForBreak (); + void SystemNative_FcntlCanGetSetPipeSz (); + void SystemNative_MkFifo (); + void SystemNative_GetNetworkInterfaces (); + void SystemNative_ChDir (); + void SystemNative_IsATty (); + void SystemNative_INotifyRemoveWatch (); + void SystemNative_MMap (); + void SystemNative_GetNumRoutes (); + void SystemNative_GetGroups (); + void SystemNative_StdinReady (); + void SystemNative_GetCwd (); + void SystemNative_Shutdown (); + void SystemNative_GetCryptographicallySecureRandomBytes (); + void SystemNative_UTimensat (); + void SystemNative_CopyFile (); + void SystemNative_CloseDir (); + void SystemNative_Rename (); + void SystemNative_MapTcpState (); + void SystemNative_SetIPv6MulticastOption (); + void SystemNative_GetHostEntryForName (); + void SystemNative_Access (); + void SystemNative_GetGroupList (); + void SystemNative_LogError (); + void SystemNative_Socket (); + void SystemNative_GetSockName (); + void SystemNative_SetRawSockOpt (); + void SystemNative_ReadEvents (); + void SystemNative_GetPwUidR (); + void SystemNative_Sync (); + void SystemNative_Calloc (); + void SystemNative_GetBootTimeTicks (); + void SystemNative_SymLink (); + void SystemNative_FcntlGetFD (); + void SystemNative_GetNameInfo (); + void SystemNative_Send (); + void SystemNative_EnumerateInterfaceAddresses (); + void SystemNative_GetPriority (); + void SystemNative_iOSSupportVersion (); + void SystemNative_LowLevelMonitor_Release (); + void SystemNative_GetEGid (); + void SystemNative_GetSocketType (); + void SystemNative_RegisterForSigChld (); + void SystemNative_GetCpuUtilization (); + void SystemNative_ForkAndExecProcess (); + void SystemNative_ChMod (); + void SystemNative_FreeSocketEventBuffer (); + void SystemNative_UninitializeConsoleAfterRead (); + void SystemNative_GetControlMessageBufferSize (); + void SystemNative_ReceiveMessage (); + void SystemNative_Kill (); + void SystemNative_GetEnviron (); + void SystemNative_SearchPath (); + void SystemNative_ConvertErrorPlatformToPal (); + void SystemNative_LSeek (); + void SystemNative_SetPort (); + void SystemNative_GetDefaultTimeZone (); + void SystemNative_PRead (); + void SystemNative_GetDomainName (); + void SystemNative_GetIPv4GlobalStatistics (); + void SystemNative_GetIcmpv4GlobalStatistics (); + void SystemNative_GetEstimatedUdpListenerCount (); + void SystemNative_LowLevelMonitor_Signal_Release (); + void SystemNative_SetLingerOption (); + void SystemNative_Open (); + void SystemNative_GetAtOutOfBandMark (); + void SystemNative_ReadProcessStatusInfo (); + void SystemNative_CreateAutoreleasePool (); + void SystemNative_FcntlGetIsNonBlocking (); + void SystemNative_SendMessage (); + void SystemNative_SetErrNo (); + void SystemNative_TryGetUInt32OSThreadId (); + void SystemNative_Listen (); + void SystemNative_GetNonCryptographicallySecureRandomBytes (); + void SystemNative_SetIPv4Address (); + void SystemNative_GetProcAddress (); + void SystemNative_FreeLibrary (); + void SystemNative_PWrite (); + void SystemNative_SetReceiveTimeout (); + void SystemNative_Poll (); + void SystemNative_GetTcpGlobalStatistics (); + void SystemNative_GetDefaultSearchOrderPseudoHandle (); + void SystemNative_GetIcmpv6GlobalStatistics (); + void SystemNative_SearchPath_TempDirectory (); + void SystemNative_SNPrintF_1I (); + void SystemNative_EnumerateGatewayAddressesForInterface (); + void SystemNative_Free (); + void SystemNative_GetUdpGlobalStatistics (); + void SystemNative_WaitIdAnyExitedNoHangNoWait (); + void SystemNative_PosixFAdvise (); + void SystemNative_GetPid (); + void SystemNative_Sysctl (); + void SystemNative_GetPeerName (); + void SystemNative_GetSpaceInfoForMountPoint (); + void SystemNative_GetFileSystemType (); +} + +namespace { + // + // These functions will eventually reside in the generated portion of code + // + void* find_system_native_entry (hash_t entrypoint_hash) + { + log_debug (LOG_ASSEMBLY, "Looking up System.Native p/invoke"); +#if INTPTR_MAX == INT64_MAX + switch (entrypoint_hash) { + case 0x38afc8bfe830b: return reinterpret_cast(&SystemNative_Bind ); + case 0x190fe65d8736dcb: return reinterpret_cast(&SystemNative_TryGetIPPacketInformation ); + case 0x1c8b86562ad5772: return reinterpret_cast(&SystemNative_Receive ); + case 0x202543f28ecaf06: return reinterpret_cast(&SystemNative_Abort ); + case 0x25abeafa88904a2: return reinterpret_cast(&SystemNative_SetPosixSignalHandler ); + case 0x33158212a812caf: return reinterpret_cast(&SystemNative_GetEstimatedTcpConnectionCount ); + case 0x3511e36d0a6c1b5: return reinterpret_cast(&SystemNative_LockFileRegion ); + case 0x37b9dd562235e42: return reinterpret_cast(&SystemNative_MSync ); + case 0x3a5df4793dd3230: return reinterpret_cast(&SystemNative_INotifyInit ); + case 0x3d24547fa4fc31b: return reinterpret_cast(&SystemNative_GetUInt64OSThreadId ); + case 0x581df5b0a00c422: return reinterpret_cast(&SystemNative_SetRLimit ); + case 0x5b5ab451ff38f8e: return reinterpret_cast(&SystemNative_GetMaximumAddressSize ); + case 0x6861b5336291d12: return reinterpret_cast(&SystemNative_PathConf ); + case 0x6a1f4deffa02c30: return reinterpret_cast(&SystemNative_LowLevelMonitor_Acquire ); + case 0x7ce8a9b967dd269: return reinterpret_cast(&SystemNative_Read ); + case 0x8352ae4bba2b83b: return reinterpret_cast(&SystemNative_SetSendTimeout ); + case 0x98bd27a7461321d: return reinterpret_cast(&SystemNative_Dup ); + case 0xa906c14ca5834bc: return reinterpret_cast(&SystemNative_GetEUid ); + case 0xac9f9c1abb62a92: return reinterpret_cast(&SystemNative_Log ); + case 0xadb2441bcfcdfe9: return reinterpret_cast(&SystemNative_CreateThread ); + case 0xafbf5c69d1badc0: return reinterpret_cast(&SystemNative_SetTerminalInvalidationHandler ); + case 0xba897b7abe67b16: return reinterpret_cast(&SystemNative_FcntlSetPipeSz ); + case 0xc305c22ce7ab8a0: return reinterpret_cast(&SystemNative_SetSockOpt ); + case 0xc79e924361c15ca: return reinterpret_cast(&SystemNative_RealPath ); + case 0xef8dd67e25bac53: return reinterpret_cast(&SystemNative_GetWindowSize ); + case 0xfa0899cf8d00a87: return reinterpret_cast(&SystemNative_MkDir ); + case 0xfe7079441ac127e: return reinterpret_cast(&SystemNative_CreateSocketEventPort ); + case 0x10d733abd1fd94bb: return reinterpret_cast(&SystemNative_TryChangeSocketEventRegistration ); + case 0x114b8384553f5418: return reinterpret_cast(&SystemNative_GetSystemTimeAsTicks ); + case 0x119a38c3e288a233: return reinterpret_cast(&SystemNative_SNPrintF_1S ); + case 0x11b6f4f0aafeda95: return reinterpret_cast(&SystemNative_LowLevelMonitor_TimedWait ); + case 0x11cc73f2926d4064: return reinterpret_cast(&SystemNative_ConfigureTerminalForChildProcess ); + case 0x121bc483ac26f5f8: return reinterpret_cast(&SystemNative_GetGroupName ); + case 0x12d65f9f65b01497: return reinterpret_cast(&SystemNative_GetRawSockOpt ); + case 0x12eaf09505dc19fd: return reinterpret_cast(&SystemNative_FStat ); + case 0x13577369f5ec4b0a: return reinterpret_cast(&SystemNative_GetActiveTcpConnectionInfos ); + case 0x1399413d8a7d9dd8: return reinterpret_cast(&SystemNative_GetAddressFamily ); + case 0x13a1c2de7fb2519f: return reinterpret_cast(&SystemNative_CloseSocketEventPort ); + case 0x146cd1dc4fb2ba58: return reinterpret_cast(&SystemNative_LChflagsCanSetHiddenFlag ); + case 0x176e22ea7c580dae: return reinterpret_cast(&SystemNative_ReadDirR ); + case 0x185f5d25252c3c72: return reinterpret_cast(&SystemNative_FAllocate ); + case 0x18d6b5e9fec9b0dc: return reinterpret_cast(&SystemNative_Connectx ); + case 0x18f7da5f584b5b59: return reinterpret_cast(&SystemNative_PReadV ); + case 0x1948a0cf88329c2f: return reinterpret_cast(&SystemNative_HandleNonCanceledPosixSignal ); + case 0x1ac95b02f23933cc: return reinterpret_cast(&SystemNative_CanGetHiddenFlag ); + case 0x1d4dcbc06728e689: return reinterpret_cast(&SystemNative_Close ); + case 0x1d6d4278ffbbab77: return reinterpret_cast(&SystemNative_Pipe ); + case 0x1d8d6a688fc5bfb3: return reinterpret_cast(&SystemNative_SendFile ); + case 0x1f1c61a157636aad: return reinterpret_cast(&SystemNative_Stat ); + case 0x1f849e45a3014a9f: return reinterpret_cast(&SystemNative_GetIPv6Address ); + case 0x1f9361fc7b624c1b: return reinterpret_cast(&SystemNative_LowLevelMonitor_Wait ); + case 0x2291e0ba4e1b55b0: return reinterpret_cast(&SystemNative_LStat ); + case 0x24f840f903a26ded: return reinterpret_cast(&SystemNative_ConvertErrorPalToPlatform ); + case 0x24ff74e427d0626e: return reinterpret_cast(&SystemNative_GetErrNo ); + case 0x254905036a0061cf: return reinterpret_cast(&SystemNative_CreateSocketEventBuffer ); + case 0x255c4a2e297fd9f5: return reinterpret_cast(&SystemNative_INotifyAddWatch ); + case 0x27f3d9266af2b315: return reinterpret_cast(&SystemNative_GetIPv4Address ); + case 0x2925953889c48cab: return reinterpret_cast(&SystemNative_CreateNetworkChangeListenerSocket ); + case 0x2a49948ae20571cb: return reinterpret_cast(&SystemNative_SchedGetAffinity ); + case 0x2c8da1192c5d7d2b: return reinterpret_cast(&SystemNative_FLock ); + case 0x2d64b1ac218cf29e: return reinterpret_cast(&SystemNative_AlignedRealloc ); + case 0x2e429d96a9fc92bd: return reinterpret_cast(&SystemNative_InitializeTerminalAndSignalHandling ); + case 0x301c465c1ac0adf9: return reinterpret_cast(&SystemNative_MProtect ); + case 0x3319a5483b3cc1fc: return reinterpret_cast(&SystemNative_GetRLimit ); + case 0x3424ffcb69ecef57: return reinterpret_cast(&SystemNative_Unlink ); + case 0x346a9bb11364833c: return reinterpret_cast(&SystemNative_DrainAutoreleasePool ); + case 0x35169e67cc0f8529: return reinterpret_cast(&SystemNative_GetIPv6MulticastOption ); + case 0x359205b4a10fa780: return reinterpret_cast(&SystemNative_LowLevelMonitor_Destroy ); + case 0x36128eed665b1923: return reinterpret_cast(&SystemNative_ShmUnlink ); + case 0x364dcf65ae63adff: return reinterpret_cast(&SystemNative_GetSocketErrorOption ); + case 0x3757b327944abb54: return reinterpret_cast(&SystemNative_EnablePosixSignalHandling ); + case 0x38b4bd21127ceffd: return reinterpret_cast(&SystemNative_StrErrorR ); + case 0x38c7de719e8ae69d: return reinterpret_cast(&SystemNative_RmDir ); + case 0x391bbbb9bbde4455: return reinterpret_cast(&SystemNative_SetIPv4MulticastOption ); + case 0x3a7245f3ea476bf7: return reinterpret_cast(&SystemNative_SNPrintF ); + case 0x3ae92e4198427b0d: return reinterpret_cast(&SystemNative_ReadLink ); + case 0x3e0de839e6cfa6e5: return reinterpret_cast(&SystemNative_Accept ); + case 0x3e7cf9a4789a31c7: return reinterpret_cast(&SystemNative_FChflags ); + case 0x3f49b6278f04ae84: return reinterpret_cast(&SystemNative_Disconnect ); + case 0x3fba15600bf0f229: return reinterpret_cast(&SystemNative_SetEUid ); + case 0x41c1f2c9153639af: return reinterpret_cast(&SystemNative_FUTimens ); + case 0x42339dd2717504d9: return reinterpret_cast(&SystemNative_GetLingerOption ); + case 0x42783107bf2935ec: return reinterpret_cast(&SystemNative_FreeHostEntry ); + case 0x42eb0578a9d62b78: return reinterpret_cast(&SystemNative_GetFormatInfoForMountPoint ); + case 0x44ccb27979f980ce: return reinterpret_cast(&SystemNative_AlignedAlloc ); + case 0x44f1a5c46033eec2: return reinterpret_cast(&SystemNative_SysLog ); + case 0x483b434d7b089c7e: return reinterpret_cast(&SystemNative_Write ); + case 0x484a3a445bdb14fc: return reinterpret_cast(&SystemNative_GetOSArchitecture ); + case 0x4909639a9d87bdb5: return reinterpret_cast(&SystemNative_AlignedFree ); + case 0x49e3ba95feb79c6c: return reinterpret_cast(&SystemNative_SetAddressFamily ); + case 0x4b00795bbeea6f60: return reinterpret_cast(&SystemNative_SetIPv6Address ); + case 0x4be7ceca50f3298c: return reinterpret_cast(&SystemNative_LowLevelMonitor_Create ); + case 0x4bec4a1d7dfd4cf7: return reinterpret_cast(&SystemNative_GetUnixRelease ); + case 0x4bfff22801b209ca: return reinterpret_cast(&SystemNative_LChflags ); + case 0x4c22cc4f2b1dab26: return reinterpret_cast(&SystemNative_SetPriority ); + case 0x509ff12da4e77259: return reinterpret_cast(&SystemNative_GetSocketAddressSizes ); + case 0x523240c01d14ad50: return reinterpret_cast(&SystemNative_GetPeerID ); + case 0x52794f1118d32f08: return reinterpret_cast(&SystemNative_GetUnixVersion ); + case 0x5381564d2c06c0a3: return reinterpret_cast(&SystemNative_SysConf ); + case 0x556bc89d2d4dfc85: return reinterpret_cast(&SystemNative_GetDeviceIdentifiers ); + case 0x5592a052ceb4caf6: return reinterpret_cast(&SystemNative_GetProcessPath ); + case 0x55fe2620f63d83d8: return reinterpret_cast(&SystemNative_SetDelayedSigChildConsoleConfigurationHandler ); + case 0x574d77a68ec3e488: return reinterpret_cast(&SystemNative_GetEnv ); + case 0x583db0344a1cd715: return reinterpret_cast(&SystemNative_GetActiveUdpListeners ); + case 0x5908581fe73717f0: return reinterpret_cast(&SystemNative_InterfaceNameToIndex ); + case 0x5a305cf2a314d6a6: return reinterpret_cast(&SystemNative_FTruncate ); + case 0x5e53b688fede3216: return reinterpret_cast(&SystemNative_GetControlCharacters ); + case 0x5fa62856bdbba9c0: return reinterpret_cast(&SystemNative_GetPort ); + case 0x600b4418896f7808: return reinterpret_cast(&SystemNative_Exit ); + case 0x6089f0c8112eb3d9: return reinterpret_cast(&SystemNative_InitializeConsoleBeforeRead ); + case 0x613307e537d462db: return reinterpret_cast(&SystemNative_GetReadDirRBufferSize ); + case 0x61bacd7170fd8c9b: return reinterpret_cast(&SystemNative_SchedSetAffinity ); + case 0x61f3ce1b18b20d6f: return reinterpret_cast(&SystemNative_GetNativeIPInterfaceStatistics ); + case 0x62351df42d842942: return reinterpret_cast(&SystemNative_GetSignalForBreak ); + case 0x6393d30aceaa6df2: return reinterpret_cast(&SystemNative_PWriteV ); + case 0x6448f0806bd3a338: return reinterpret_cast(&SystemNative_FreeEnviron ); + case 0x650eddee76c6b8da: return reinterpret_cast(&SystemNative_GetHostName ); + case 0x652badfba5d61929: return reinterpret_cast(&SystemNative_FcntlSetFD ); + case 0x67d2cd86792b1d0c: return reinterpret_cast(&SystemNative_Realloc ); + case 0x67e9d60481f4be06: return reinterpret_cast(&SystemNative_PlatformSupportsDualModeIPv4PacketInfo ); + case 0x68df81a8fb5bf442: return reinterpret_cast(&SystemNative_GetSockOpt ); + case 0x68f3fe6083c0355b: return reinterpret_cast(&SystemNative_GetLoadLibraryError ); + case 0x69ad99fac0467f64: return reinterpret_cast(&SystemNative_Link ); + case 0x6b9097385aa77917: return reinterpret_cast(&SystemNative_FSync ); + case 0x6b9bce16ba8e845f: return reinterpret_cast(&SystemNative_Malloc ); + case 0x6bc18fbbbf267e2a: return reinterpret_cast(&SystemNative_ReceiveSocketError ); + case 0x6e2c1caff08e6e2d: return reinterpret_cast(&SystemNative_ReadStdin ); + case 0x6ee05d5e8650e56c: return reinterpret_cast(&SystemNative_DisablePosixSignalHandling ); + case 0x729afe37cdb8ae8f: return reinterpret_cast(&SystemNative_Connect ); + case 0x730ae9a7469a7321: return reinterpret_cast(&SystemNative_GetAllMountPoints ); + case 0x742da00b2dbf435d: return reinterpret_cast(&SystemNative_LoadLibrary ); + case 0x7559feb379d38da5: return reinterpret_cast(&SystemNative_GetTimeZoneData ); + case 0x7d7ee4bce74d4de9: return reinterpret_cast(&SystemNative_GetDomainSocketSizes ); + case 0x7e1766c6df3ad261: return reinterpret_cast(&SystemNative_MUnmap ); + case 0x7e4bdf46d4ff9f11: return reinterpret_cast(&SystemNative_MkNod ); + case 0x7ec328b6ba9eab8a: return reinterpret_cast(&SystemNative_WaitForSocketEvents ); + case 0x84c8a7489b37fea0: return reinterpret_cast(&SystemNative_GetPlatformSignalNumber ); + case 0x8502eeba98158e79: return reinterpret_cast(&SystemNative_FcntlSetIsNonBlocking ); + case 0x8530d37777969db6: return reinterpret_cast(&SystemNative_SetKeypadXmit ); + case 0x85d0033bc38bb4bb: return reinterpret_cast(&SystemNative_MAdvise ); + case 0x889350f209555ecb: return reinterpret_cast(&SystemNative_MkdTemp ); + case 0x88a08b60b80c70cc: return reinterpret_cast(&SystemNative_FChMod ); + case 0x8bcabce135063bed: return reinterpret_cast(&SystemNative_OpenDir ); + case 0x8df448aee6e8fa5e: return reinterpret_cast(&SystemNative_WaitPidExitedNoHang ); + case 0x8e96cb02418947cc: return reinterpret_cast(&SystemNative_FcntlGetPipeSz ); + case 0x8fb6ed14ee0256bc: return reinterpret_cast(&SystemNative_GetTimestamp ); + case 0x8ffe2d950d138c01: return reinterpret_cast(&SystemNative_SchedGetCpu ); + case 0x93a8bec488055608: return reinterpret_cast(&SystemNative_GetPwNamR ); + case 0x95a4cb8563cc6b14: return reinterpret_cast(&SystemNative_ShmOpen ); + case 0x9856fa59ed936b73: return reinterpret_cast(&SystemNative_GetSid ); + case 0x996ada1c038aabba: return reinterpret_cast(&SystemNative_MksTemps ); + case 0x99a840c495204202: return reinterpret_cast(&SystemNative_GetBytesAvailable ); + case 0x9aa9eaee3dd8b23b: return reinterpret_cast(&SystemNative_GetIPv4MulticastOption ); + case 0x9aaaad33b28af82f: return reinterpret_cast(&SystemNative_SetSignalForBreak ); + case 0x9c3e8b890033819a: return reinterpret_cast(&SystemNative_FcntlCanGetSetPipeSz ); + case 0x9c832cd7fcbf2de0: return reinterpret_cast(&SystemNative_MkFifo ); + case 0x9d2cb31282abd3d9: return reinterpret_cast(&SystemNative_GetNetworkInterfaces ); + case 0x9e25ebf4f61cc299: return reinterpret_cast(&SystemNative_ChDir ); + case 0x9fb01da1222e905a: return reinterpret_cast(&SystemNative_IsATty ); + case 0xa1e881a63614507e: return reinterpret_cast(&SystemNative_INotifyRemoveWatch ); + case 0xa2254fea4d8b6909: return reinterpret_cast(&SystemNative_MMap ); + case 0xa2d7790a850024c0: return reinterpret_cast(&SystemNative_GetNumRoutes ); + case 0xa302613a430248b8: return reinterpret_cast(&SystemNative_GetGroups ); + case 0xa56532a23755cd87: return reinterpret_cast(&SystemNative_StdinReady ); + case 0xa89ec9958d999483: return reinterpret_cast(&SystemNative_GetCwd ); + case 0xa8bdc3e7ee898dfc: return reinterpret_cast(&SystemNative_Shutdown ); + case 0xabdcf2f74d210f35: return reinterpret_cast(&SystemNative_GetCryptographicallySecureRandomBytes ); + case 0xac11eab9d9c31b01: return reinterpret_cast(&SystemNative_UTimensat ); + case 0xac7725c652a5fb5b: return reinterpret_cast(&SystemNative_CopyFile ); + case 0xad228cdc4edb11d6: return reinterpret_cast(&SystemNative_CloseDir ); + case 0xadc6889903a2d6f4: return reinterpret_cast(&SystemNative_Rename ); + case 0xae320903718eb45d: return reinterpret_cast(&SystemNative_MapTcpState ); + case 0xaf9706efc72c3904: return reinterpret_cast(&SystemNative_SetIPv6MulticastOption ); + case 0xafd9f6338cdbadd4: return reinterpret_cast(&SystemNative_GetHostEntryForName ); + case 0xb0b66a7145de350d: return reinterpret_cast(&SystemNative_Access ); + case 0xb0e18377ed603e0b: return reinterpret_cast(&SystemNative_GetGroupList ); + case 0xb361006446f560e8: return reinterpret_cast(&SystemNative_LogError ); + case 0xb600c44028c1743d: return reinterpret_cast(&SystemNative_Socket ); + case 0xb632e9bc6f7be0a9: return reinterpret_cast(&SystemNative_GetSockName ); + case 0xb6540b73eff28747: return reinterpret_cast(&SystemNative_SetRawSockOpt ); + case 0xb6ab9abf7887911f: return reinterpret_cast(&SystemNative_ReadEvents ); + case 0xb73c597de01bc0b2: return reinterpret_cast(&SystemNative_GetPwUidR ); + case 0xb78af5975603cd20: return reinterpret_cast(&SystemNative_Sync ); + case 0xb7bbbe2c16a565c6: return reinterpret_cast(&SystemNative_Calloc ); + case 0xbb3343826d504870: return reinterpret_cast(&SystemNative_GetBootTimeTicks ); + case 0xbb5e970ecb6745da: return reinterpret_cast(&SystemNative_SymLink ); + case 0xbbd20cce92ec2c12: return reinterpret_cast(&SystemNative_FcntlGetFD ); + case 0xbcd9e53d2d288094: return reinterpret_cast(&SystemNative_GetNameInfo ); + case 0xbd89ef4df5486744: return reinterpret_cast(&SystemNative_Send ); + case 0xbdd3128e77381b01: return reinterpret_cast(&SystemNative_EnumerateInterfaceAddresses ); + case 0xc00ebc097b776c1f: return reinterpret_cast(&SystemNative_GetPriority ); + case 0xc036b23d88fad91b: return reinterpret_cast(&SystemNative_iOSSupportVersion ); + case 0xc1c679eefc134d31: return reinterpret_cast(&SystemNative_LowLevelMonitor_Release ); + case 0xc3c10021b10ba455: return reinterpret_cast(&SystemNative_GetEGid ); + case 0xc3fe9394fe1f3f02: return reinterpret_cast(&SystemNative_GetSocketType ); + case 0xc560d9947ab2a34d: return reinterpret_cast(&SystemNative_RegisterForSigChld ); + case 0xc5bed971846027de: return reinterpret_cast(&SystemNative_GetCpuUtilization ); + case 0xc69433678dd341ca: return reinterpret_cast(&SystemNative_ForkAndExecProcess ); + case 0xc7ae1b8d93af5d73: return reinterpret_cast(&SystemNative_ChMod ); + case 0xc7d536c0e7eb3fe2: return reinterpret_cast(&SystemNative_FreeSocketEventBuffer ); + case 0xc87a5ee4869035c6: return reinterpret_cast(&SystemNative_UninitializeConsoleAfterRead ); + case 0xc93df58ae5457bfd: return reinterpret_cast(&SystemNative_GetControlMessageBufferSize ); + case 0xc956e528f995739c: return reinterpret_cast(&SystemNative_ReceiveMessage ); + case 0xcaae6d345ba32c7b: return reinterpret_cast(&SystemNative_Kill ); + case 0xcaec08aa13779f7f: return reinterpret_cast(&SystemNative_GetEnviron ); + case 0xcbbb90469d28cded: return reinterpret_cast(&SystemNative_SearchPath ); + case 0xcc43d880192dd6ff: return reinterpret_cast(&SystemNative_ConvertErrorPlatformToPal ); + case 0xcc788c0474c3e178: return reinterpret_cast(&SystemNative_LSeek ); + case 0xcdcb014df9a6eae2: return reinterpret_cast(&SystemNative_SetPort ); + case 0xce36e2e1a139a020: return reinterpret_cast(&SystemNative_GetDefaultTimeZone ); + case 0xce6ddfe40fed99d9: return reinterpret_cast(&SystemNative_PRead ); + case 0xd392d6ed5dcc111c: return reinterpret_cast(&SystemNative_GetDomainName ); + case 0xd55437b16dc84f3b: return reinterpret_cast(&SystemNative_GetIPv4GlobalStatistics ); + case 0xd88be8f9e9f28e90: return reinterpret_cast(&SystemNative_GetIcmpv4GlobalStatistics ); + case 0xd8976692c4c68818: return reinterpret_cast(&SystemNative_GetEstimatedUdpListenerCount ); + case 0xda05c57c78aa6706: return reinterpret_cast(&SystemNative_LowLevelMonitor_Signal_Release ); + case 0xda38bffa1d16cdd6: return reinterpret_cast(&SystemNative_SetLingerOption ); + case 0xda6b3192974ca60e: return reinterpret_cast(&SystemNative_Open ); + case 0xdab5eb45815daabc: return reinterpret_cast(&SystemNative_GetAtOutOfBandMark ); + case 0xdae32aac0c0d305c: return reinterpret_cast(&SystemNative_ReadProcessStatusInfo ); + case 0xdbee22594fa8c585: return reinterpret_cast(&SystemNative_CreateAutoreleasePool ); + case 0xdf650444c8af0763: return reinterpret_cast(&SystemNative_FcntlGetIsNonBlocking ); + case 0xe0a170d2b947a8fc: return reinterpret_cast(&SystemNative_SendMessage ); + case 0xe0a601fd89d9b279: return reinterpret_cast(&SystemNative_SetErrNo ); + case 0xe1930d112ce74c9e: return reinterpret_cast(&SystemNative_TryGetUInt32OSThreadId ); + case 0xe20c29fb8b19da7b: return reinterpret_cast(&SystemNative_Listen ); + case 0xe36a157177b2db08: return reinterpret_cast(&SystemNative_GetNonCryptographicallySecureRandomBytes ); + case 0xe44f737a5bebdd90: return reinterpret_cast(&SystemNative_SetIPv4Address ); + case 0xe582a4a60bb74c35: return reinterpret_cast(&SystemNative_GetProcAddress ); + case 0xe6838f2add787bfe: return reinterpret_cast(&SystemNative_FreeLibrary ); + case 0xe73aeaf9e3a10343: return reinterpret_cast(&SystemNative_PWrite ); + case 0xe78ff100d1d73d99: return reinterpret_cast(&SystemNative_SetReceiveTimeout ); + case 0xe853ecfe4d402ed0: return reinterpret_cast(&SystemNative_Poll ); + case 0xeaafb7963ceb9bf4: return reinterpret_cast(&SystemNative_GetTcpGlobalStatistics ); + case 0xec67e4076662c2de: return reinterpret_cast(&SystemNative_GetDefaultSearchOrderPseudoHandle ); + case 0xef71ee101b3ece96: return reinterpret_cast(&SystemNative_GetIcmpv6GlobalStatistics ); + case 0xf0045895a9043221: return reinterpret_cast(&SystemNative_SearchPath_TempDirectory ); + case 0xf0658a22dd5ede19: return reinterpret_cast(&SystemNative_SNPrintF_1I ); + case 0xf0ec052da6c5fa70: return reinterpret_cast(&SystemNative_EnumerateGatewayAddressesForInterface ); + case 0xf2c7fa39bf166188: return reinterpret_cast(&SystemNative_Free ); + case 0xf38b47e43f352491: return reinterpret_cast(&SystemNative_GetUdpGlobalStatistics ); + case 0xf6ede5d5d8729315: return reinterpret_cast(&SystemNative_WaitIdAnyExitedNoHangNoWait ); + case 0xf870179a8d8d1872: return reinterpret_cast(&SystemNative_PosixFAdvise ); + case 0xf8c983dd21ef9fe6: return reinterpret_cast(&SystemNative_GetPid ); + case 0xfa26b86cedf66721: return reinterpret_cast(&SystemNative_Sysctl ); + case 0xfb3e394cc613f202: return reinterpret_cast(&SystemNative_GetPeerName ); + case 0xfbb57319454b1074: return reinterpret_cast(&SystemNative_GetSpaceInfoForMountPoint ); + case 0xff28b3bec4f32a2c: return reinterpret_cast(&SystemNative_GetFileSystemType ); + } +#endif + return nullptr; + } + + void* find_internal_entry (hash_t entrypoint_hash) + { + log_debug (LOG_ASSEMBLY, "Looking up internal p/invoke"); + +#if INTPTR_MAX == INT64_MAX + switch (entrypoint_hash) { + case 0x452e23128e42f0a: return reinterpret_cast(&monodroid_get_log_categories); + case 0xa50ce5de13bf8b5: return reinterpret_cast(&_monodroid_timezone_get_default_id); + case 0x19055d65edfd668e: return reinterpret_cast(&_monodroid_get_network_interface_up_state); + case 0x2b3b0ca1d14076da: return reinterpret_cast(&monodroid_get_dylib); + case 0x2fbe68718cf2510d: return reinterpret_cast(&_monodroid_get_identity_hash_code); + case 0x3ade4348ac8ce0fa: return reinterpret_cast(&_monodroid_freeifaddrs); + case 0x3b2467e7eadd4a6a: return reinterpret_cast(&_monodroid_lref_log_new); + case 0x3b8097af56b5361f: return reinterpret_cast(&monodroid_log_traces); + case 0x3c5532ecdab53f89: return reinterpret_cast(&set_world_accessable); + case 0x423c8f539a2c56d2: return reinterpret_cast(&_monodroid_lookup_replacement_type); + case 0x4b1956138764939a: return reinterpret_cast(&_monodroid_gref_log_new); + case 0x4d5b5b488f736058: return reinterpret_cast(&path_combine); + case 0x5a2614d15e2fdc2e: return reinterpret_cast(&monodroid_strdup_printf); + case 0x5f0b4e426eff086b: return reinterpret_cast(&_monodroid_detect_cpu_and_architecture); + case 0x709af13cbfbe2e75: return reinterpret_cast(&monodroid_clear_gdb_wait); + case 0x70ae32c9a4f1ad2c: return reinterpret_cast(&monodroid_strsplit); + case 0x70fc9bab8d56666d: return reinterpret_cast(&create_public_directory); + case 0x78514771a67ad724: return reinterpret_cast(&monodroid_strfreev); + case 0x9099a4b95e3c3a89: return reinterpret_cast(&_monodroid_lref_log_delete); + case 0x958cdb6fd9d1b67b: return reinterpret_cast(&monodroid_dylib_mono_new); + case 0xa6ec846592d99536: return reinterpret_cast(&_monodroid_weak_gref_delete); + case 0xa7f58f3ee428cc6b: return reinterpret_cast(&_monodroid_gref_log_delete); + case 0xae3df96dda0143bd: return reinterpret_cast(&_monodroid_gref_log); + case 0xb6222d90af401865: return reinterpret_cast(&_monodroid_weak_gref_get); + case 0xb8306f71b963cd3d: return reinterpret_cast(&monodroid_log); + case 0xbc90bafd5ff9c99e: return reinterpret_cast(&_monodroid_get_dns_servers); + case 0xbe5a300beec69c35: return reinterpret_cast(&monodroid_get_system_property); + case 0xbfbb924fbe190616: return reinterpret_cast(&monodroid_dylib_mono_free); + case 0xc2a21d3f6c8ccc24: return reinterpret_cast(&_monodroid_lookup_replacement_method_info); + case 0xc5b4690e13898fa3: return reinterpret_cast(&monodroid_timing_start); + case 0xcc873ea8493d1dd5: return reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix); + case 0xce439cfbe29dec11: return reinterpret_cast(&_monodroid_get_android_api_level); + case 0xd1e121b94ea63f2e: return reinterpret_cast(&_monodroid_gref_get); + case 0xd5151b00eb33d85e: return reinterpret_cast(&monodroid_TypeManager_get_java_class_name); + case 0xda517ef392b6a888: return reinterpret_cast(&java_interop_free); + case 0xe27b9849b7e982cb: return reinterpret_cast(&_monodroid_max_gref_get); + case 0xe370a0d91cd63bc0: return reinterpret_cast(&_monodroid_getifaddrs); + case 0xe78f1161604ae672: return reinterpret_cast(&send_uninterrupted); + case 0xe86307aac9a2631a: return reinterpret_cast(&_monodroid_weak_gref_new); + case 0xebc2c68e10075cc9: return reinterpret_cast(&monodroid_fopen); + case 0xee83e38e479aeff1: return reinterpret_cast(&_monodroid_counters_dump); + case 0xf3048baf83034541: return reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing); + case 0xf41c48df6f9be476: return reinterpret_cast(&monodroid_free); + case 0xf5a918ef520db207: return reinterpret_cast(&monodroid_timing_stop); + case 0xf5ed87b004005892: return reinterpret_cast(&_monodroid_get_network_interface_supports_multicast); + case 0xf8798f762db15bba: return reinterpret_cast(&recv_uninterrupted); + case 0xfa90326712e7e7c4: return reinterpret_cast(&java_interop_strdup); + case 0xfdc17c4ea8335ffd: return reinterpret_cast(&monodroid_get_namespaced_system_property); + case 0xff010b3140f54d3f: return reinterpret_cast(&monodroid_dylib_mono_init); + } +#endif + return nullptr; + } + + void* find_system_globalization_entry (hash_t entrypoint_hash) + { + log_debug (LOG_ASSEMBLY, "Looking up System.Globalization p/invoke"); +#if INTPTR_MAX == INT64_MAX + switch (entrypoint_hash) { + case 0x10f8526b1edfc3: return reinterpret_cast(&GlobalizationNative_GetLocaleInfoInt ); + case 0xe7e93cf9237e1f2: return reinterpret_cast(&GlobalizationNative_ToAscii ); + case 0x18580a4592ed1ea6: return reinterpret_cast(&GlobalizationNative_GetSortKey ); + case 0x1f72f52873ced9c9: return reinterpret_cast(&GlobalizationNative_InitOrdinalCasingPage ); + case 0x2178ba302d0c5f1c: return reinterpret_cast(&GlobalizationNative_GetCalendars ); + case 0x32e594690358a960: return reinterpret_cast(&GlobalizationNative_GetLocaleInfoString ); + case 0x40d61d78487edb08: return reinterpret_cast(&GlobalizationNative_GetICUVersion ); + case 0x4360eb8a25122eee: return reinterpret_cast(&GlobalizationNative_StartsWith ); + case 0x4bd4b1c0803c8c55: return reinterpret_cast(&GlobalizationNative_GetLocaleName ); + case 0x4f22643b9509cc12: return reinterpret_cast(&GlobalizationNative_IsNormalized ); + case 0x507983f11ffec7a8: return reinterpret_cast(&GlobalizationNative_GetTimeZoneDisplayName ); + case 0x56e982948d00f10d: return reinterpret_cast(&GlobalizationNative_IndexOf ); + case 0x635327a9b09a910d: return reinterpret_cast(&GlobalizationNative_NormalizeString ); + case 0x6ac3aeecfc75bfad: return reinterpret_cast(&GlobalizationNative_GetSortVersion ); + case 0x77ca6a148e5a51d9: return reinterpret_cast(&GlobalizationNative_IanaIdToWindowsId ); + case 0x7a4d912694906c9c: return reinterpret_cast(&GlobalizationNative_ToUnicode ); + case 0x7e5fa2f70891c7fe: return reinterpret_cast(&GlobalizationNative_ChangeCaseTurkish ); + case 0xa193402ff5140ac1: return reinterpret_cast(&GlobalizationNative_GetCalendarInfo ); + case 0xa831a683f743e417: return reinterpret_cast(&GlobalizationNative_WindowsIdToIanaId ); + case 0xac5c6a70d140a4bf: return reinterpret_cast(&GlobalizationNative_GetLocaleTimeFormat ); + case 0xb81236cd1fe85cc9: return reinterpret_cast(&GlobalizationNative_GetLatestJapaneseEra ); + case 0xb95350c7ec77bc72: return reinterpret_cast(&GlobalizationNative_ChangeCase ); + case 0xc287daf58054a21d: return reinterpret_cast(&GlobalizationNative_EndsWith ); + case 0xc8b772178f955d87: return reinterpret_cast(&GlobalizationNative_GetSortHandle ); + case 0xd0899515dfe85287: return reinterpret_cast(&GlobalizationNative_LoadICU ); + case 0xd185dfe303ab91dd: return reinterpret_cast(&GlobalizationNative_CompareString ); + case 0xd5264d57a926edfb: return reinterpret_cast(&GlobalizationNative_InitICUFunctions ); + case 0xd995e71361e6ed2e: return reinterpret_cast(&GlobalizationNative_IsPredefinedLocale ); + case 0xe072da8f2d921f53: return reinterpret_cast(&GlobalizationNative_GetDefaultLocaleName ); + case 0xea21aa1f2b2a671c: return reinterpret_cast(&GlobalizationNative_LastIndexOf ); + case 0xee4dd111dc8d98f3: return reinterpret_cast(&GlobalizationNative_GetJapaneseEraStartDate ); + case 0xf2d074e0aeca51ce: return reinterpret_cast(&GlobalizationNative_GetLocales ); + case 0xf3693f3cadb9b6f4: return reinterpret_cast(&GlobalizationNative_EnumCalendarInfo ); + case 0xf63fa2bfce5c4f80: return reinterpret_cast(&GlobalizationNative_GetLocaleInfoGroupingSizes); + case 0xfa21f0a127c9dce9: return reinterpret_cast(&GlobalizationNative_ChangeCaseInvariant ); + case 0xfacf02f439426705: return reinterpret_cast(&GlobalizationNative_CloseSortHandle ); + } +#endif + return nullptr; + } + + void* find_system_security_cryptography_entry (hash_t entrypoint_hash) + { + log_debug (LOG_ASSEMBLY, "Looking up System.Security.Cryptography p/invoke"); + return nullptr; + } + + void* find_system_io_compression_entry (hash_t entrypoint_hash) + { + log_debug (LOG_ASSEMBLY, "Looking up System.IO.Compression p/invoke"); + return nullptr; + } + + void* find_pinvoke (hash_t library_name_hash, hash_t entrypoint_hash, bool& known_library) + { + // Order of `case` statements should be roughly sorted by the (projected) frequency of calls from the + // managed land. + switch (library_name_hash) { + // `libSystem.Native` and `xa-internal-api` are both used during startup, put them first + case system_native_library_hash: + return find_system_native_entry (entrypoint_hash); + + case xa_internal_api_library_hash: + case java_interop_library_hash: + return find_internal_entry (entrypoint_hash); + + case system_globalization_native_library_hash: + return find_system_globalization_entry (entrypoint_hash); + + case system_security_cryptography_native_android_library_hash: + return find_system_security_cryptography_entry (entrypoint_hash); + + case system_io_compression_native_library_hash: + return find_system_io_compression_entry (entrypoint_hash); + } + + known_library = false; + return nullptr; + } +} + [[gnu::flatten]] void* PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) { - log_info (LOG_ASSEMBLY, __PRETTY_FUNCTION__); - log_info (LOG_ASSEMBLY, "library_name == '%s'; entrypoint_name == '%s'", library_name, entrypoint_name); + log_debug (LOG_ASSEMBLY, __PRETTY_FUNCTION__); + log_debug (LOG_ASSEMBLY, "library_name == '%s'; entrypoint_name == '%s'", library_name, entrypoint_name); + + if (library_name == nullptr || entrypoint_name == nullptr) { + return nullptr; + } + + hash_t library_name_hash = xxhash::hash (library_name, strlen (library_name)); + hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); + log_debug (LOG_ASSEMBLY, "library_name_hash == 0x%zx; entrypoint_hash == 0x%zx", library_name_hash, entrypoint_hash); + + bool known_library = true; + void *pinvoke_ptr = find_pinvoke (library_name_hash, entrypoint_hash, known_library); + if (pinvoke_ptr != nullptr) { + return pinvoke_ptr; + } + + if (known_library) [[unlikely]] { + log_debug (LOG_ASSEMBLY, "Lookup in a known library == internal"); + // Should "never" happen. It seems we have a known library hash (of one that's linked into the dynamically + // built DSO) but an unknown symbol hash. The symbol **probably** doesn't exist (was most likely linked out if + // the find* functions didn't know its hash), but we cannot be sure of that so we'll try to load it. + pinvoke_ptr = dlsym (RTLD_DEFAULT, entrypoint_name); + if (pinvoke_ptr == nullptr) { + log_warn (LOG_ASSEMBLY, "Unable to load p/invoke entry '%s/%s' from the unified runtime DSO", library_name, entrypoint_name); + } + + return pinvoke_ptr; + } - // TODO: implement - return nullptr; + log_debug (LOG_ASSEMBLY, "p/invoke not from a known library, slow path taken."); + return handle_other_pinvoke_request (library_name, library_name_hash, entrypoint_name, entrypoint_hash);; } From d7f3272be384768f522a91cbaf4e3da72ef4fc82 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 4 Sep 2024 20:54:32 +0200 Subject: [PATCH 25/53] Benchmarking before implementation --- src/native/pinvoke-override/dynamic.cc | 898 ++++++++++++++++++++++++- 1 file changed, 892 insertions(+), 6 deletions(-) diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc index 202eb93a35e..b93d843ea0f 100644 --- a/src/native/pinvoke-override/dynamic.cc +++ b/src/native/pinvoke-override/dynamic.cc @@ -2,11 +2,15 @@ #include "internal-pinvokes.hh" #include "logger.hh" +#include "search.hh" +#include "timing.hh" +#include "timing-internal.hh" #define PINVOKE_OVERRIDE_INLINE [[gnu::noinline]] #include "pinvoke-override-api-impl.hh" using namespace xamarin::android; +using namespace xamarin::android::internal; // TODO: these should be shared with the "static" dispatch code. They currently reside in `pinvoke-tables.include` // which is not used by the "dynamic" dispatch @@ -314,15 +318,646 @@ extern "C" { void SystemNative_GetPeerName (); void SystemNative_GetSpaceInfoForMountPoint (); void SystemNative_GetFileSystemType (); + + void AndroidCryptoNative_EcKeyCreateByExplicitParameters (); + void AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry (); + void AndroidCryptoNative_EcKeyUpRef (); + void AndroidCryptoNative_X509GetContentType (); + void AndroidCryptoNative_Aes256Gcm (); + void AndroidCryptoNative_RsaSize (); + void AndroidCryptoNative_Aes256Ecb (); + void AndroidCryptoNative_SetRsaParameters (); + void AndroidCryptoNative_Aes192Cbc (); + void AndroidCryptoNative_SSLGetSupportedProtocols (); + void AndroidCryptoNative_EcKeyCreateByOid (); + void AndroidCryptoNative_SSLStreamGetCipherSuite (); + void AndroidCryptoNative_SSLStreamCreate (); + void AndroidCryptoNative_EcDsaVerify (); + void AndroidCryptoNative_X509ChainGetCertificateCount (); + void AndroidCryptoNative_CipherDestroy (); + void AndroidCryptoNative_X509StoreDeleteEntry (); + void AndroidCryptoNative_DsaSizeSignature (); + void AndroidCryptoNative_SSLStreamVerifyHostname (); + void AndroidCryptoNative_Aes128Cbc (); + void AndroidCryptoNative_ChaCha20Poly1305 (); + void AndroidCryptoNative_X509PublicKey (); + void AndroidCryptoNative_EcKeyGetCurveName (); + void AndroidCryptoNative_X509ChainDestroyContext (); + void AndroidCryptoNative_X509ChainGetErrorCount (); + void AndroidCryptoNative_SSLStreamGetProtocol (); + void AndroidCryptoNative_CipherUpdateAAD (); + void AndroidCryptoNative_X509StoreEnumerateCertificates (); + void AndroidCryptoNative_EcKeyDestroy (); + void AndroidCryptoNative_DsaSign (); + void AndroidCryptoNative_X509ChainCreateContext (); + void AndroidCryptoNative_X509ChainBuild (); + void AndroidCryptoNative_X509StoreRemoveCertificate (); + void AndroidCryptoNative_SSLStreamRelease (); + void AndroidCryptoNative_SSLStreamGetPeerCertificate (); + void AndroidCryptoNative_RsaGenerateKeyEx (); + void AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration (); + void AndroidCryptoNative_SSLStreamShutdown (); + void AndroidCryptoNative_Des3Cbc (); + void AndroidCryptoNative_RsaPrivateDecrypt (); + void AndroidCryptoNative_CipherFinalEx (); + void AndroidCryptoNative_RsaUpRef (); + void AndroidCryptoNative_RsaCreate (); + void AndroidCryptoNative_Aes192Ccm (); + void AndroidCryptoNative_SSLStreamCreateWithCertificates (); + void AndroidCryptoNative_EcdhDeriveKey (); + void AndroidCryptoNative_Aes128Ccm (); + void AndroidCryptoNative_DsaSignatureFieldSize (); + void AndroidCryptoNative_Aes128Gcm (); + void AndroidCryptoNative_Aes256Cbc (); + void AndroidCryptoNative_DsaGenerateKey (); + void AndroidCryptoNative_X509StoreOpenDefault (); + void AndroidCryptoNative_X509Decode (); + void AndroidCryptoNative_Aes128Cfb8 (); + void AndroidCryptoNative_SSLStreamSetTargetHost (); + void AndroidCryptoNative_RsaSignPrimitive (); + void AndroidCryptoNative_RegisterRemoteCertificateValidationCallback (); + void AndroidCryptoNative_Aes192Gcm (); + void AndroidCryptoNative_X509ChainValidate (); + void AndroidCryptoNative_NewGlobalReference (); + void AndroidCryptoNative_Aes256Cfb128 (); + void AndroidCryptoNative_Aes256Ccm (); + void AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey (); + void AndroidCryptoNative_SSLStreamSetApplicationProtocols (); + void AndroidCryptoNative_SSLStreamGetApplicationProtocol (); + void AndroidCryptoNative_DsaKeyCreateByExplicitParameters (); + void AndroidCryptoNative_CipherSetKeyAndIV (); + void AndroidCryptoNative_Aes192Ecb (); + void AndroidCryptoNative_SSLStreamSetEnabledProtocols (); + void AndroidCryptoNative_Des3Cfb8 (); + void AndroidCryptoNative_X509ChainGetErrors (); + void AndroidCryptoNative_DesEcb (); + void AndroidCryptoNative_Aes192Cfb8 (); + void AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry (); + void AndroidCryptoNative_SSLStreamWrite (); + void AndroidCryptoNative_Pbkdf2 (); + void AndroidCryptoNative_GetRsaParameters (); + void AndroidCryptoNative_EcDsaSign (); + void AndroidCryptoNative_AeadCipherFinalEx (); + void AndroidCryptoNative_EcDsaSize (); + void AndroidCryptoNative_DesCfb8 (); + void AndroidCryptoNative_GetECCurveParameters (); + void AndroidCryptoNative_X509StoreAddCertificate (); + void AndroidCryptoNative_SSLStreamHandshake (); + void AndroidCryptoNative_Des3Cfb64 (); + void AndroidCryptoNative_DsaSizeP (); + void AndroidCryptoNative_SSLStreamGetPeerCertificates (); + void AndroidCryptoNative_X509Encode (); + void AndroidCryptoNative_X509ExportPkcs7 (); + void AndroidCryptoNative_GetECKeyParameters (); + void AndroidCryptoNative_CipherCreatePartial (); + void AndroidCryptoNative_SSLStreamRead (); + void AndroidCryptoNative_X509DecodeCollection (); + void AndroidCryptoNative_CipherIsSupported (); + void AndroidCryptoNative_X509ChainGetCertificates (); + void AndroidCryptoNative_Aes256Cfb8 (); + void AndroidCryptoNative_CipherReset (); + void AndroidCryptoNative_DsaVerify (); + void AndroidCryptoNative_DesCbc (); + void AndroidCryptoNative_X509StoreGetPrivateKeyEntry (); + void AndroidCryptoNative_RsaDestroy (); + void AndroidCryptoNative_Aes128Cfb128 (); + void AndroidCryptoNative_CipherSetNonceLength (); + void AndroidCryptoNative_SSLStreamIsLocalCertificateUsed (); + void AndroidCryptoNative_GetDsaParameters (); + void AndroidCryptoNative_X509ChainSetCustomTrustStore (); + void AndroidCryptoNative_EcKeyCreateByKeyParameters (); + void AndroidCryptoNative_RsaPublicEncrypt (); + void AndroidCryptoNative_CipherCtxSetPadding (); + void AndroidCryptoNative_GetBigNumBytes (); + void AndroidCryptoNative_DeleteGlobalReference (); + void AndroidCryptoNative_BigNumToBinary (); + void AndroidCryptoNative_Aes128Ecb (); + void AndroidCryptoNative_Des3Ecb (); + void AndroidCryptoNative_X509StoreContainsCertificate (); + void AndroidCryptoNative_X509StoreEnumerateTrustedCertificates (); + void AndroidCryptoNative_CipherUpdate (); + void AndroidCryptoNative_CipherCreate (); + void AndroidCryptoNative_CipherSetTagLength (); + void AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry (); + void AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo (); + void AndroidCryptoNative_RsaVerificationPrimitive (); + void AndroidCryptoNative_Aes192Cfb128 (); + void AndroidCryptoNative_EcKeyGetSize (); + void AndroidCryptoNative_SSLStreamRequestClientAuthentication (); + void AndroidCryptoNative_SSLStreamInitialize (); + + void CompressionNative_Crc32 (); + void CompressionNative_Inflate (); + void CompressionNative_DeflateEnd (); + void CompressionNative_Deflate (); + void CompressionNative_InflateEnd (); + void CompressionNative_InflateInit2_ (); + void CompressionNative_DeflateInit2_ (); } namespace { +#if INTPTR_MAX == INT64_MAX + std::array internal_pinvokes {{ + {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, + {0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, + {0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, + {0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, + {0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, + {0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, + {0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, + {0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, + {0x3c5532ecdab53f89, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, + {0x423c8f539a2c56d2, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, + {0x4b1956138764939a, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, + {0x4d5b5b488f736058, "path_combine", reinterpret_cast(&path_combine)}, + {0x5a2614d15e2fdc2e, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, + {0x5f0b4e426eff086b, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, + {0x709af13cbfbe2e75, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, + {0x70ae32c9a4f1ad2c, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, + {0x70fc9bab8d56666d, "create_public_directory", reinterpret_cast(&create_public_directory)}, + {0x78514771a67ad724, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, + {0x9099a4b95e3c3a89, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, + {0x958cdb6fd9d1b67b, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, + {0xa6ec846592d99536, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, + {0xa7f58f3ee428cc6b, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, + {0xae3df96dda0143bd, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, + {0xb6222d90af401865, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, + {0xb8306f71b963cd3d, "monodroid_log", reinterpret_cast(&monodroid_log)}, + {0xbc90bafd5ff9c99e, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, + {0xbe5a300beec69c35, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, + {0xbfbb924fbe190616, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, + {0xc2a21d3f6c8ccc24, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, + {0xc5b4690e13898fa3, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, + {0xcc873ea8493d1dd5, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, + {0xce439cfbe29dec11, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, + {0xd1e121b94ea63f2e, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, + {0xd5151b00eb33d85e, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, + {0xda517ef392b6a888, "java_interop_free", reinterpret_cast(&java_interop_free)}, + {0xe27b9849b7e982cb, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, + {0xe370a0d91cd63bc0, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, + {0xe78f1161604ae672, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, + {0xe86307aac9a2631a, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, + {0xebc2c68e10075cc9, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, + {0xee83e38e479aeff1, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, + {0xf3048baf83034541, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, + {0xf41c48df6f9be476, "monodroid_free", reinterpret_cast(&monodroid_free)}, + {0xf5a918ef520db207, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, + {0xf5ed87b004005892, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, + {0xf8798f762db15bba, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, + {0xfa90326712e7e7c4, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, + {0xfdc17c4ea8335ffd, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, + {0xff010b3140f54d3f, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, + }}; + + std::array system_native_pinvokes {{ + {0xb38afc8bfe830b, "SystemNative_Bind", nullptr}, + {0x190fe65d8736dcb, "SystemNative_TryGetIPPacketInformation", nullptr}, + {0x1c8b86562ad5772, "SystemNative_Receive", nullptr}, + {0x202543f28ecaf06, "SystemNative_Abort", nullptr}, + {0x25abeafa88904a2, "SystemNative_SetPosixSignalHandler", nullptr}, + {0x33158212a812caf, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, + {0x3511e36d0a6c1b5, "SystemNative_LockFileRegion", nullptr}, + {0x37b9dd562235e42, "SystemNative_MSync", nullptr}, + {0x3a5df4793dd3230, "SystemNative_INotifyInit", nullptr}, + {0x3d24547fa4fc31b, "SystemNative_GetUInt64OSThreadId", nullptr}, + {0x581df5b0a00c422, "SystemNative_SetRLimit", nullptr}, + {0x5b5ab451ff38f8e, "SystemNative_GetMaximumAddressSize", nullptr}, + {0x6861b5336291d12, "SystemNative_PathConf", nullptr}, + {0x6a1f4deffa02c30, "SystemNative_LowLevelMonitor_Acquire", nullptr}, + {0x7ce8a9b967dd269, "SystemNative_Read", nullptr}, + {0x8352ae4bba2b83b, "SystemNative_SetSendTimeout", nullptr}, + {0x98bd27a7461321d, "SystemNative_Dup", nullptr}, + {0xa906c14ca5834bc, "SystemNative_GetEUid", nullptr}, + {0xac9f9c1abb62a92, "SystemNative_Log", nullptr}, + {0xadb2441bcfcdfe9, "SystemNative_CreateThread", nullptr}, + {0xafbf5c69d1badc0, "SystemNative_SetTerminalInvalidationHandler", nullptr}, + {0xba897b7abe67b16, "SystemNative_FcntlSetPipeSz", nullptr}, + {0xc305c22ce7ab8a0, "SystemNative_SetSockOpt", nullptr}, + {0xc79e924361c15ca, "SystemNative_RealPath", nullptr}, + {0xef8dd67e25bac53, "SystemNative_GetWindowSize", nullptr}, + {0xfa0899cf8d00a87, "SystemNative_MkDir", nullptr}, + {0xfe7079441ac127e, "SystemNative_CreateSocketEventPort", nullptr}, + {0x10d733abd1fd94bb, "SystemNative_TryChangeSocketEventRegistration", nullptr}, + {0x114b8384553f5418, "SystemNative_GetSystemTimeAsTicks", nullptr}, + {0x119a38c3e288a233, "SystemNative_SNPrintF_1S", nullptr}, + {0x11b6f4f0aafeda95, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, + {0x11cc73f2926d4064, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, + {0x121bc483ac26f5f8, "SystemNative_GetGroupName", nullptr}, + {0x12d65f9f65b01497, "SystemNative_GetRawSockOpt", nullptr}, + {0x12eaf09505dc19fd, "SystemNative_FStat", nullptr}, + {0x13577369f5ec4b0a, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, + {0x1399413d8a7d9dd8, "SystemNative_GetAddressFamily", nullptr}, + {0x13a1c2de7fb2519f, "SystemNative_CloseSocketEventPort", nullptr}, + {0x146cd1dc4fb2ba58, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, + {0x176e22ea7c580dae, "SystemNative_ReadDirR", nullptr}, + {0x185f5d25252c3c72, "SystemNative_FAllocate", nullptr}, + {0x18d6b5e9fec9b0dc, "SystemNative_Connectx", nullptr}, + {0x18f7da5f584b5b59, "SystemNative_PReadV", nullptr}, + {0x1948a0cf88329c2f, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, + {0x1ac95b02f23933cc, "SystemNative_CanGetHiddenFlag", nullptr}, + {0x1d4dcbc06728e689, "SystemNative_Close", nullptr}, + {0x1d6d4278ffbbab77, "SystemNative_Pipe", nullptr}, + {0x1d8d6a688fc5bfb3, "SystemNative_SendFile", nullptr}, + {0x1f1c61a157636aad, "SystemNative_Stat", nullptr}, + {0x1f849e45a3014a9f, "SystemNative_GetIPv6Address", nullptr}, + {0x1f9361fc7b624c1b, "SystemNative_LowLevelMonitor_Wait", nullptr}, + {0x2291e0ba4e1b55b0, "SystemNative_LStat", nullptr}, + {0x24f840f903a26ded, "SystemNative_ConvertErrorPalToPlatform", nullptr}, + {0x24ff74e427d0626e, "SystemNative_GetErrNo", nullptr}, + {0x254905036a0061cf, "SystemNative_CreateSocketEventBuffer", nullptr}, + {0x255c4a2e297fd9f5, "SystemNative_INotifyAddWatch", nullptr}, + {0x27f3d9266af2b315, "SystemNative_GetIPv4Address", nullptr}, + {0x2925953889c48cab, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, + {0x2a49948ae20571cb, "SystemNative_SchedGetAffinity", nullptr}, + {0x2c8da1192c5d7d2b, "SystemNative_FLock", nullptr}, + {0x2d64b1ac218cf29e, "SystemNative_AlignedRealloc", nullptr}, + {0x2e429d96a9fc92bd, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, + {0x301c465c1ac0adf9, "SystemNative_MProtect", nullptr}, + {0x3319a5483b3cc1fc, "SystemNative_GetRLimit", nullptr}, + {0x3424ffcb69ecef57, "SystemNative_Unlink", nullptr}, + {0x346a9bb11364833c, "SystemNative_DrainAutoreleasePool", nullptr}, + {0x35169e67cc0f8529, "SystemNative_GetIPv6MulticastOption", nullptr}, + {0x359205b4a10fa780, "SystemNative_LowLevelMonitor_Destroy", nullptr}, + {0x36128eed665b1923, "SystemNative_ShmUnlink", nullptr}, + {0x364dcf65ae63adff, "SystemNative_GetSocketErrorOption", nullptr}, + {0x3757b327944abb54, "SystemNative_EnablePosixSignalHandling", nullptr}, + {0x38b4bd21127ceffd, "SystemNative_StrErrorR", nullptr}, + {0x38c7de719e8ae69d, "SystemNative_RmDir", nullptr}, + {0x391bbbb9bbde4455, "SystemNative_SetIPv4MulticastOption", nullptr}, + {0x3a7245f3ea476bf7, "SystemNative_SNPrintF", nullptr}, + {0x3ae92e4198427b0d, "SystemNative_ReadLink", nullptr}, + {0x3e0de839e6cfa6e5, "SystemNative_Accept", nullptr}, + {0x3e7cf9a4789a31c7, "SystemNative_FChflags", nullptr}, + {0x3f49b6278f04ae84, "SystemNative_Disconnect", nullptr}, + {0x3fba15600bf0f229, "SystemNative_SetEUid", nullptr}, + {0x41c1f2c9153639af, "SystemNative_FUTimens", nullptr}, + {0x42339dd2717504d9, "SystemNative_GetLingerOption", nullptr}, + {0x42783107bf2935ec, "SystemNative_FreeHostEntry", nullptr}, + {0x42eb0578a9d62b78, "SystemNative_GetFormatInfoForMountPoint", nullptr}, + {0x44ccb27979f980ce, "SystemNative_AlignedAlloc", nullptr}, + {0x44f1a5c46033eec2, "SystemNative_SysLog", nullptr}, + {0x483b434d7b089c7e, "SystemNative_Write", nullptr}, + {0x484a3a445bdb14fc, "SystemNative_GetOSArchitecture", nullptr}, + {0x4909639a9d87bdb5, "SystemNative_AlignedFree", nullptr}, + {0x49e3ba95feb79c6c, "SystemNative_SetAddressFamily", nullptr}, + {0x4b00795bbeea6f60, "SystemNative_SetIPv6Address", nullptr}, + {0x4be7ceca50f3298c, "SystemNative_LowLevelMonitor_Create", nullptr}, + {0x4bec4a1d7dfd4cf7, "SystemNative_GetUnixRelease", nullptr}, + {0x4bfff22801b209ca, "SystemNative_LChflags", nullptr}, + {0x4c22cc4f2b1dab26, "SystemNative_SetPriority", nullptr}, + {0x509ff12da4e77259, "SystemNative_GetSocketAddressSizes", nullptr}, + {0x523240c01d14ad50, "SystemNative_GetPeerID", nullptr}, + {0x52794f1118d32f08, "SystemNative_GetUnixVersion", nullptr}, + {0x5381564d2c06c0a3, "SystemNative_SysConf", nullptr}, + {0x556bc89d2d4dfc85, "SystemNative_GetDeviceIdentifiers", nullptr}, + {0x5592a052ceb4caf6, "SystemNative_GetProcessPath", nullptr}, + {0x55fe2620f63d83d8, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, + {0x574d77a68ec3e488, "SystemNative_GetEnv", nullptr}, + {0x583db0344a1cd715, "SystemNative_GetActiveUdpListeners", nullptr}, + {0x5908581fe73717f0, "SystemNative_InterfaceNameToIndex", nullptr}, + {0x5a305cf2a314d6a6, "SystemNative_FTruncate", nullptr}, + {0x5e53b688fede3216, "SystemNative_GetControlCharacters", nullptr}, + {0x5fa62856bdbba9c0, "SystemNative_GetPort", nullptr}, + {0x600b4418896f7808, "SystemNative_Exit", nullptr}, + {0x6089f0c8112eb3d9, "SystemNative_InitializeConsoleBeforeRead", nullptr}, + {0x613307e537d462db, "SystemNative_GetReadDirRBufferSize", nullptr}, + {0x61bacd7170fd8c9b, "SystemNative_SchedSetAffinity", nullptr}, + {0x61f3ce1b18b20d6f, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, + {0x62351df42d842942, "SystemNative_GetSignalForBreak", nullptr}, + {0x6393d30aceaa6df2, "SystemNative_PWriteV", nullptr}, + {0x6448f0806bd3a338, "SystemNative_FreeEnviron", nullptr}, + {0x650eddee76c6b8da, "SystemNative_GetHostName", nullptr}, + {0x652badfba5d61929, "SystemNative_FcntlSetFD", nullptr}, + {0x67d2cd86792b1d0c, "SystemNative_Realloc", nullptr}, + {0x67e9d60481f4be06, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, + {0x68df81a8fb5bf442, "SystemNative_GetSockOpt", nullptr}, + {0x68f3fe6083c0355b, "SystemNative_GetLoadLibraryError", nullptr}, + {0x69ad99fac0467f64, "SystemNative_Link", nullptr}, + {0x6b9097385aa77917, "SystemNative_FSync", nullptr}, + {0x6b9bce16ba8e845f, "SystemNative_Malloc", nullptr}, + {0x6bc18fbbbf267e2a, "SystemNative_ReceiveSocketError", nullptr}, + {0x6e2c1caff08e6e2d, "SystemNative_ReadStdin", nullptr}, + {0x6ee05d5e8650e56c, "SystemNative_DisablePosixSignalHandling", nullptr}, + {0x729afe37cdb8ae8f, "SystemNative_Connect", nullptr}, + {0x730ae9a7469a7321, "SystemNative_GetAllMountPoints", nullptr}, + {0x742da00b2dbf435d, "SystemNative_LoadLibrary", nullptr}, + {0x7559feb379d38da5, "SystemNative_GetTimeZoneData", nullptr}, + {0x7d7ee4bce74d4de9, "SystemNative_GetDomainSocketSizes", nullptr}, + {0x7e1766c6df3ad261, "SystemNative_MUnmap", nullptr}, + {0x7e4bdf46d4ff9f11, "SystemNative_MkNod", nullptr}, + {0x7ec328b6ba9eab8a, "SystemNative_WaitForSocketEvents", nullptr}, + {0x84c8a7489b37fea0, "SystemNative_GetPlatformSignalNumber", nullptr}, + {0x8502eeba98158e79, "SystemNative_FcntlSetIsNonBlocking", nullptr}, + {0x8530d37777969db6, "SystemNative_SetKeypadXmit", nullptr}, + {0x85d0033bc38bb4bb, "SystemNative_MAdvise", nullptr}, + {0x889350f209555ecb, "SystemNative_MkdTemp", nullptr}, + {0x88a08b60b80c70cc, "SystemNative_FChMod", nullptr}, + {0x8bcabce135063bed, "SystemNative_OpenDir", nullptr}, + {0x8df448aee6e8fa5e, "SystemNative_WaitPidExitedNoHang", nullptr}, + {0x8e96cb02418947cc, "SystemNative_FcntlGetPipeSz", nullptr}, + {0x8fb6ed14ee0256bc, "SystemNative_GetTimestamp", nullptr}, + {0x8ffe2d950d138c01, "SystemNative_SchedGetCpu", nullptr}, + {0x93a8bec488055608, "SystemNative_GetPwNamR", nullptr}, + {0x95a4cb8563cc6b14, "SystemNative_ShmOpen", nullptr}, + {0x9856fa59ed936b73, "SystemNative_GetSid", nullptr}, + {0x996ada1c038aabba, "SystemNative_MksTemps", nullptr}, + {0x99a840c495204202, "SystemNative_GetBytesAvailable", nullptr}, + {0x9aa9eaee3dd8b23b, "SystemNative_GetIPv4MulticastOption", nullptr}, + {0x9aaaad33b28af82f, "SystemNative_SetSignalForBreak", nullptr}, + {0x9c3e8b890033819a, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, + {0x9c832cd7fcbf2de0, "SystemNative_MkFifo", nullptr}, + {0x9d2cb31282abd3d9, "SystemNative_GetNetworkInterfaces", nullptr}, + {0x9e25ebf4f61cc299, "SystemNative_ChDir", nullptr}, + {0x9fb01da1222e905a, "SystemNative_IsATty", nullptr}, + {0xa1e881a63614507e, "SystemNative_INotifyRemoveWatch", nullptr}, + {0xa2254fea4d8b6909, "SystemNative_MMap", nullptr}, + {0xa2d7790a850024c0, "SystemNative_GetNumRoutes", nullptr}, + {0xa302613a430248b8, "SystemNative_GetGroups", nullptr}, + {0xa56532a23755cd87, "SystemNative_StdinReady", nullptr}, + {0xa89ec9958d999483, "SystemNative_GetCwd", nullptr}, + {0xa8bdc3e7ee898dfc, "SystemNative_Shutdown", nullptr}, + {0xabdcf2f74d210f35, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, + {0xac11eab9d9c31b01, "SystemNative_UTimensat", nullptr}, + {0xac7725c652a5fb5b, "SystemNative_CopyFile", nullptr}, + {0xad228cdc4edb11d6, "SystemNative_CloseDir", nullptr}, + {0xadc6889903a2d6f4, "SystemNative_Rename", nullptr}, + {0xae320903718eb45d, "SystemNative_MapTcpState", nullptr}, + {0xaf9706efc72c3904, "SystemNative_SetIPv6MulticastOption", nullptr}, + {0xafd9f6338cdbadd4, "SystemNative_GetHostEntryForName", nullptr}, + {0xb0b66a7145de350d, "SystemNative_Access", nullptr}, + {0xb0e18377ed603e0b, "SystemNative_GetGroupList", nullptr}, + {0xb361006446f560e8, "SystemNative_LogError", nullptr}, + {0xb600c44028c1743d, "SystemNative_Socket", nullptr}, + {0xb632e9bc6f7be0a9, "SystemNative_GetSockName", nullptr}, + {0xb6540b73eff28747, "SystemNative_SetRawSockOpt", nullptr}, + {0xb6ab9abf7887911f, "SystemNative_ReadEvents", nullptr}, + {0xb73c597de01bc0b2, "SystemNative_GetPwUidR", nullptr}, + {0xb78af5975603cd20, "SystemNative_Sync", nullptr}, + {0xb7bbbe2c16a565c6, "SystemNative_Calloc", nullptr}, + {0xbb3343826d504870, "SystemNative_GetBootTimeTicks", nullptr}, + {0xbb5e970ecb6745da, "SystemNative_SymLink", nullptr}, + {0xbbd20cce92ec2c12, "SystemNative_FcntlGetFD", nullptr}, + {0xbcd9e53d2d288094, "SystemNative_GetNameInfo", nullptr}, + {0xbd89ef4df5486744, "SystemNative_Send", nullptr}, + {0xbdd3128e77381b01, "SystemNative_EnumerateInterfaceAddresses", nullptr}, + {0xc00ebc097b776c1f, "SystemNative_GetPriority", nullptr}, + {0xc036b23d88fad91b, "SystemNative_iOSSupportVersion", nullptr}, + {0xc1c679eefc134d31, "SystemNative_LowLevelMonitor_Release", nullptr}, + {0xc3c10021b10ba455, "SystemNative_GetEGid", nullptr}, + {0xc3fe9394fe1f3f02, "SystemNative_GetSocketType", nullptr}, + {0xc560d9947ab2a34d, "SystemNative_RegisterForSigChld", nullptr}, + {0xc5bed971846027de, "SystemNative_GetCpuUtilization", nullptr}, + {0xc69433678dd341ca, "SystemNative_ForkAndExecProcess", nullptr}, + {0xc7ae1b8d93af5d73, "SystemNative_ChMod", nullptr}, + {0xc7d536c0e7eb3fe2, "SystemNative_FreeSocketEventBuffer", nullptr}, + {0xc87a5ee4869035c6, "SystemNative_UninitializeConsoleAfterRead", nullptr}, + {0xc93df58ae5457bfd, "SystemNative_GetControlMessageBufferSize", nullptr}, + {0xc956e528f995739c, "SystemNative_ReceiveMessage", nullptr}, + {0xcaae6d345ba32c7b, "SystemNative_Kill", nullptr}, + {0xcaec08aa13779f7f, "SystemNative_GetEnviron", nullptr}, + {0xcaf599a20538b10b, "SystemNative_SetWindowSize", nullptr}, + {0xcbbb90469d28cded, "SystemNative_SearchPath", nullptr}, + {0xcc43d880192dd6ff, "SystemNative_ConvertErrorPlatformToPal", nullptr}, + {0xcc788c0474c3e178, "SystemNative_LSeek", nullptr}, + {0xcdcb014df9a6eae2, "SystemNative_SetPort", nullptr}, + {0xce36e2e1a139a020, "SystemNative_GetDefaultTimeZone", nullptr}, + {0xce6ddfe40fed99d9, "SystemNative_PRead", nullptr}, + {0xd392d6ed5dcc111c, "SystemNative_GetDomainName", nullptr}, + {0xd55437b16dc84f3b, "SystemNative_GetIPv4GlobalStatistics", nullptr}, + {0xd88be8f9e9f28e90, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, + {0xd8976692c4c68818, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, + {0xda05c57c78aa6706, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, + {0xda38bffa1d16cdd6, "SystemNative_SetLingerOption", nullptr}, + {0xda6b3192974ca60e, "SystemNative_Open", nullptr}, + {0xdab5eb45815daabc, "SystemNative_GetAtOutOfBandMark", nullptr}, + {0xdae32aac0c0d305c, "SystemNative_ReadProcessStatusInfo", nullptr}, + {0xdbee22594fa8c585, "SystemNative_CreateAutoreleasePool", nullptr}, + {0xdf650444c8af0763, "SystemNative_FcntlGetIsNonBlocking", nullptr}, + {0xe0a170d2b947a8fc, "SystemNative_SendMessage", nullptr}, + {0xe0a601fd89d9b279, "SystemNative_SetErrNo", nullptr}, + {0xe1930d112ce74c9e, "SystemNative_TryGetUInt32OSThreadId", nullptr}, + {0xe20c29fb8b19da7b, "SystemNative_Listen", nullptr}, + {0xe36a157177b2db08, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, + {0xe44f737a5bebdd90, "SystemNative_SetIPv4Address", nullptr}, + {0xe582a4a60bb74c35, "SystemNative_GetProcAddress", nullptr}, + {0xe6838f2add787bfe, "SystemNative_FreeLibrary", nullptr}, + {0xe73aeaf9e3a10343, "SystemNative_PWrite", nullptr}, + {0xe78ff100d1d73d99, "SystemNative_SetReceiveTimeout", nullptr}, + {0xe853ecfe4d402ed0, "SystemNative_Poll", nullptr}, + {0xeaafb7963ceb9bf4, "SystemNative_GetTcpGlobalStatistics", nullptr}, + {0xec67e4076662c2de, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, + {0xef71ee101b3ece96, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, + {0xf0045895a9043221, "SystemNative_SearchPath_TempDirectory", nullptr}, + {0xf0658a22dd5ede19, "SystemNative_SNPrintF_1I", nullptr}, + {0xf0ec052da6c5fa70, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, + {0xf2c7fa39bf166188, "SystemNative_Free", nullptr}, + {0xf38b47e43f352491, "SystemNative_GetUdpGlobalStatistics", nullptr}, + {0xf6ede5d5d8729315, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, + {0xf870179a8d8d1872, "SystemNative_PosixFAdvise", nullptr}, + {0xf8c983dd21ef9fe6, "SystemNative_GetPid", nullptr}, + {0xfa26b86cedf66721, "SystemNative_Sysctl", nullptr}, + {0xfb3e394cc613f202, "SystemNative_GetPeerName", nullptr}, + {0xfbb57319454b1074, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, + {0xff28b3bec4f32a2c, "SystemNative_GetFileSystemType", nullptr}, + }}; + + std::array system_globalization_pinvokes {{ + {0x410f8526b1edfc3, "GlobalizationNative_GetLocaleInfoInt", nullptr}, + {0xe7e93cf9237e1f2, "GlobalizationNative_ToAscii", nullptr}, + {0x18580a4592ed1ea6, "GlobalizationNative_GetSortKey", nullptr}, + {0x1f72f52873ced9c9, "GlobalizationNative_InitOrdinalCasingPage", nullptr}, + {0x2178ba302d0c5f1c, "GlobalizationNative_GetCalendars", nullptr}, + {0x32e594690358a960, "GlobalizationNative_GetLocaleInfoString", nullptr}, + {0x40d61d78487edb08, "GlobalizationNative_GetICUVersion", nullptr}, + {0x4360eb8a25122eee, "GlobalizationNative_StartsWith", nullptr}, + {0x4bd4b1c0803c8c55, "GlobalizationNative_GetLocaleName", nullptr}, + {0x4f22643b9509cc12, "GlobalizationNative_IsNormalized", nullptr}, + {0x507983f11ffec7a8, "GlobalizationNative_GetTimeZoneDisplayName", nullptr}, + {0x56e982948d00f10d, "GlobalizationNative_IndexOf", nullptr}, + {0x635327a9b09a910d, "GlobalizationNative_NormalizeString", nullptr}, + {0x6ac3aeecfc75bfad, "GlobalizationNative_GetSortVersion", nullptr}, + {0x77ca6a148e5a51d9, "GlobalizationNative_IanaIdToWindowsId", nullptr}, + {0x7a4d912694906c9c, "GlobalizationNative_ToUnicode", nullptr}, + {0x7e5fa2f70891c7fe, "GlobalizationNative_ChangeCaseTurkish", nullptr}, + {0xa193402ff5140ac1, "GlobalizationNative_GetCalendarInfo", nullptr}, + {0xa831a683f743e417, "GlobalizationNative_WindowsIdToIanaId", nullptr}, + {0xac5c6a70d140a4bf, "GlobalizationNative_GetLocaleTimeFormat", nullptr}, + {0xb81236cd1fe85cc9, "GlobalizationNative_GetLatestJapaneseEra", nullptr}, + {0xb95350c7ec77bc72, "GlobalizationNative_ChangeCase", nullptr}, + {0xc287daf58054a21d, "GlobalizationNative_EndsWith", nullptr}, + {0xc8b772178f955d87, "GlobalizationNative_GetSortHandle", nullptr}, + {0xd0899515dfe85287, "GlobalizationNative_LoadICU", nullptr}, + {0xd185dfe303ab91dd, "GlobalizationNative_CompareString", nullptr}, + {0xd5264d57a926edfb, "GlobalizationNative_InitICUFunctions", nullptr}, + {0xd995e71361e6ed2e, "GlobalizationNative_IsPredefinedLocale", nullptr}, + {0xe072da8f2d921f53, "GlobalizationNative_GetDefaultLocaleName", nullptr}, + {0xea21aa1f2b2a671c, "GlobalizationNative_LastIndexOf", nullptr}, + {0xee4dd111dc8d98f3, "GlobalizationNative_GetJapaneseEraStartDate", nullptr}, + {0xf2d074e0aeca51ce, "GlobalizationNative_GetLocales", nullptr}, + {0xf3693f3cadb9b6f4, "GlobalizationNative_EnumCalendarInfo", nullptr}, + {0xf63fa2bfce5c4f80, "GlobalizationNative_GetLocaleInfoGroupingSizes", nullptr}, + {0xfa21f0a127c9dce9, "GlobalizationNative_ChangeCaseInvariant", nullptr}, + {0xfacf02f439426705, "GlobalizationNative_CloseSortHandle", nullptr}, + }}; + + std::array system_crypto_android_pinvokes {{ + {0x375a0e90c77ca35, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, + {0x47302bd7e277183, "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", nullptr}, + {0x598db66ca39c41f, "AndroidCryptoNative_EcKeyUpRef", nullptr}, + {0x656cac62ccc9e3c, "AndroidCryptoNative_X509GetContentType", nullptr}, + {0x690c4347972024f, "AndroidCryptoNative_Aes256Gcm", nullptr}, + {0x7b5579ab0499b1f, "AndroidCryptoNative_RsaSize", nullptr}, + {0xcaba893801c6a6f, "AndroidCryptoNative_Aes256Ecb", nullptr}, + {0xcbe6d3d22131194, "AndroidCryptoNative_SetRsaParameters", nullptr}, + {0x1027786cdd9a3e9c, "AndroidCryptoNative_Aes192Cbc", nullptr}, + {0x1d1bb0528d517729, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, + {0x1e6228e955989698, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, + {0x1f45ac9d3c6b1554, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, + {0x1f7d2360a1cdcbff, "AndroidCryptoNative_SSLStreamCreate", nullptr}, + {0x218fce505a140c55, "AndroidCryptoNative_EcDsaVerify", nullptr}, + {0x23ac2a4c4d1c744e, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, + {0x267c94097a3bf1f3, "AndroidCryptoNative_CipherDestroy", nullptr}, + {0x2b45d7cdf6e8e0c7, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, + {0x2c7e5e179cc917cb, "AndroidCryptoNative_DsaSizeSignature", nullptr}, + {0x2fdcf708ff792105, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, + {0x31027564deeb71b0, "AndroidCryptoNative_Aes128Cbc", nullptr}, + {0x3f19a16a3230b551, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, + {0x401935ffc3454bb1, "AndroidCryptoNative_X509PublicKey", nullptr}, + {0x40bfa1211f5f6f9c, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, + {0x41b6e7f32da99fa9, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, + {0x41c169fb0e30a390, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, + {0x420718c398131a55, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, + {0x43741165a5ba60d5, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, + {0x4845e1c76265acc9, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, + {0x4a7272ac9d117f2d, "AndroidCryptoNative_EcKeyDestroy", nullptr}, + {0x4d6361e5095cff36, "AndroidCryptoNative_DsaSign", nullptr}, + {0x4d74053b37e582fa, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, + {0x501daf7e3a890220, "AndroidCryptoNative_X509ChainBuild", nullptr}, + {0x52fc107ebdb6fcc7, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, + {0x5fd29ac523ff6e3d, "AndroidCryptoNative_SSLStreamRelease", nullptr}, + {0x5ffae3c8023a80b8, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, + {0x648a9b317bc64fe0, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, + {0x66e049fe27bf91ea, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, + {0x67a8868ef592a3fd, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, + {0x67a9b5bbce322f8c, "AndroidCryptoNative_Des3Cbc", nullptr}, + {0x6a59d9242cd31785, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, + {0x6dbd90e9cc86310b, "AndroidCryptoNative_CipherFinalEx", nullptr}, + {0x6dfd40c2dd0d7382, "AndroidCryptoNative_RsaUpRef", nullptr}, + {0x6f990f1f7bc80630, "AndroidCryptoNative_RsaCreate", nullptr}, + {0x70f907b97d3fe059, "AndroidCryptoNative_Aes192Ccm", nullptr}, + {0x7150f0eb40797bb3, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, + {0x7356b141407d261e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, + {0x74ec4a8d869776ad, "AndroidCryptoNative_Aes128Ccm", nullptr}, + {0x758dfbf057da0da0, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, + {0x7975d1d7029cf1a3, "AndroidCryptoNative_Aes128Gcm", nullptr}, + {0x79f5c24afbd04af1, "AndroidCryptoNative_Aes256Cbc", nullptr}, + {0x7a37e0d077f2dfe5, "AndroidCryptoNative_DsaGenerateKey", nullptr}, + {0x7d5273ad530e7298, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, + {0x7fa96d0284954375, "AndroidCryptoNative_X509Decode", nullptr}, + {0x813bedf08c3388d4, "AndroidCryptoNative_Aes128Cfb8", nullptr}, + {0x84cc0301870c37ce, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, + {0x868e09dc7dfea364, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, + {0x870191ad244b8069, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, + {0x87019b7831c0c34c, "AndroidCryptoNative_Aes192Gcm", nullptr}, + {0x87c447e7f873cff0, "AndroidCryptoNative_X509ChainValidate", nullptr}, + {0x9039632237d70ae7, "AndroidCryptoNative_NewGlobalReference", nullptr}, + {0x9161ade1206fd86e, "AndroidCryptoNative_Aes256Cfb128", nullptr}, + {0x9167a072639a7c95, "AndroidCryptoNative_Aes256Ccm", nullptr}, + {0x91f065ec0d3aec55, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, + {0x95a0e2fc5c0cb49e, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, + {0x9991a277809ef205, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, + {0x9aab07f824659d3e, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, + {0x9e79166979634030, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, + {0x9edddf30d660eff4, "AndroidCryptoNative_Aes192Ecb", nullptr}, + {0xa308025a784497df, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, + {0xa56954e28eb9a9c9, "AndroidCryptoNative_Des3Cfb8", nullptr}, + {0xa5eda72b95fe78c3, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, + {0xa93eb533acf7564d, "AndroidCryptoNative_DesEcb", nullptr}, + {0xa961e8db31830e16, "AndroidCryptoNative_Aes192Cfb8", nullptr}, + {0xaa8f0f87ae474ffe, "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", nullptr}, + {0xad1a2d6575cdd4e3, "AndroidCryptoNative_SSLStreamWrite", nullptr}, + {0xae82e9ceae24192d, "AndroidCryptoNative_Pbkdf2", nullptr}, + {0xb0df46ff09c57741, "AndroidCryptoNative_GetRsaParameters", nullptr}, + {0xb1c394b9992bd67d, "AndroidCryptoNative_EcDsaSign", nullptr}, + {0xb1ff12f3bd735982, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, + {0xb4996dd1aba38200, "AndroidCryptoNative_EcDsaSize", nullptr}, + {0xb575ec01a7a79f8f, "AndroidCryptoNative_DesCfb8", nullptr}, + {0xb66be1550d27bfb4, "AndroidCryptoNative_GetECCurveParameters", nullptr}, + {0xbd5a0be2f7904089, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, + {0xbdbbd2898347c0d1, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, + {0xc11cd661db8be230, "AndroidCryptoNative_Des3Cfb64", nullptr}, + {0xc2d5e1c465b2f5b6, "AndroidCryptoNative_DsaSizeP", nullptr}, + {0xc3145e336c38379b, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, + {0xc7815e0476511544, "AndroidCryptoNative_X509Encode", nullptr}, + {0xc8a52a8b6d96b32b, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, + {0xca48c3927c202794, "AndroidCryptoNative_GetECKeyParameters", nullptr}, + {0xcb4bcdafdc81d116, "AndroidCryptoNative_CipherCreatePartial", nullptr}, + {0xcc433093c073719e, "AndroidCryptoNative_SSLStreamRead", nullptr}, + {0xce9f8a6ac705faa5, "AndroidCryptoNative_X509DecodeCollection", nullptr}, + {0xd5c063a90ae882c1, "AndroidCryptoNative_CipherIsSupported", nullptr}, + {0xd7d818c7640598dc, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, + {0xd7f1a8f616897ace, "AndroidCryptoNative_Aes256Cfb8", nullptr}, + {0xd9bd0b370726ce34, "AndroidCryptoNative_CipherReset", nullptr}, + {0xda4898a26933f73d, "AndroidCryptoNative_DsaVerify", nullptr}, + {0xdbb4752ed23670f0, "AndroidCryptoNative_DesCbc", nullptr}, + {0xdc780005b0d39711, "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", nullptr}, + {0xdd4c03f06ce96e04, "AndroidCryptoNative_RsaDestroy", nullptr}, + {0xdde06993f87d6ffc, "AndroidCryptoNative_Aes128Cfb128", nullptr}, + {0xde1e22dd097f799c, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, + {0xde259001bf54e6f1, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, + {0xdec5c7544d2c8cb1, "AndroidCryptoNative_GetDsaParameters", nullptr}, + {0xdfede2defd776f7e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, + {0xe059239741e0011a, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, + {0xe0f34ce89fd38aef, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, + {0xe604fca300068c0c, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, + {0xeab45239fb3f138d, "AndroidCryptoNative_GetBigNumBytes", nullptr}, + {0xeff5d014640ae969, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, + {0xf1577384f409ea85, "AndroidCryptoNative_BigNumToBinary", nullptr}, + {0xf4dea312f71c5ff2, "AndroidCryptoNative_Aes128Ecb", nullptr}, + {0xf57f81262f07542c, "AndroidCryptoNative_Des3Ecb", nullptr}, + {0xf7b334768844b502, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, + {0xf85b8ffeba9b06c1, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, + {0xf96bc1e7e15e69f2, "AndroidCryptoNative_CipherUpdate", nullptr}, + {0xf970881d4fa83e07, "AndroidCryptoNative_CipherCreate", nullptr}, + {0xf9c3d216226b3355, "AndroidCryptoNative_CipherSetTagLength", nullptr}, + {0xfa2669c25616a8ff, "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", nullptr}, + {0xfaa7766eaa2c54a5, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, + {0xfc0bad2b1528000f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, + {0xfcdeea476953780c, "AndroidCryptoNative_Aes192Cfb128", nullptr}, + {0xfd2cdd99f11de76c, "AndroidCryptoNative_EcKeyGetSize", nullptr}, + {0xfd4f2784ec1c98aa, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, + {0xfe3dd06281f7cd1f, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, + }}; + + std::array system_io_compression_pinvokes {{ + {0x99f2ee02463000, "CompressionNative_Crc32", nullptr}, + {0x403e1bc0b3baba84, "CompressionNative_Inflate", nullptr}, + {0xafe3d21bbaa71464, "CompressionNative_DeflateEnd", nullptr}, + {0xc10e411c989a9314, "CompressionNative_Deflate", nullptr}, + {0xca001af79c0d7a8b, "CompressionNative_InflateEnd", nullptr}, + {0xcd5d8a63493f5e38, "CompressionNative_InflateInit2_", nullptr}, + {0xea5e6653389b924a, "CompressionNative_DeflateInit2_", nullptr}, + }}; + + template [[gnu::noinline, gnu::flatten]] + PinvokeEntry* find_pinvoke_binary_search (std::array data, hash_t hash) + { + auto equal = [](PinvokeEntry const& entry, hash_t key) -> bool { return entry.hash == key; }; + auto less_than = [](PinvokeEntry const& entry, hash_t key) -> bool { return entry.hash < key; }; + ssize_t idx = Search::binary_search (hash, data.data (), NEntries); + if (idx >= 0) { + return &data[idx]; + } + + return nullptr; + } +#endif // // These functions will eventually reside in the generated portion of code // void* find_system_native_entry (hash_t entrypoint_hash) { - log_debug (LOG_ASSEMBLY, "Looking up System.Native p/invoke"); +// log_debug (LOG_ASSEMBLY, "Looking up System.Native p/invoke"); #if INTPTR_MAX == INT64_MAX switch (entrypoint_hash) { case 0x38afc8bfe830b: return reinterpret_cast(&SystemNative_Bind ); @@ -578,9 +1213,70 @@ namespace { return nullptr; } +#if INTPTR_MAX == INT64_MAX + template + void find_entry_benchmark (const char *label, std::array const& data) + { + log_debug (LOG_ASSEMBLY, "%s search benchmark, %zu entries", label, data.size ()); + + hash_t first = data[0].hash; + hash_t middle = data[data.size () / 2].hash; + hash_t last = data[data.size () - 1].hash; + size_t index; + PinvokeEntry *entry; + void *ptr; + + timing_period elapsed; + auto log_elapsed = [&elapsed](const char *label) { + timing_diff diff (elapsed); + log_debug (LOG_ASSEMBLY, "%s; elapsed: %lis:%lu::%lu", label, diff.sec, diff.ms, diff.ns); + }; + + elapsed.mark_start (); + entry = find_pinvoke_binary_search (data, first); + elapsed.mark_end (); + log_elapsed ( "BINARY: find first entry"); + + elapsed.reset (); + elapsed.mark_start (); + entry = find_pinvoke_binary_search (data, middle); + elapsed.mark_end (); + log_elapsed ("BINARY: find middle entry"); + + elapsed.reset (); + elapsed.mark_start (); + entry = find_pinvoke_binary_search (data, last); + elapsed.mark_end (); + log_elapsed ("BINARY: find last entry"); + + elapsed.reset (); + elapsed.mark_start (); + ptr = linear_search (first); + elapsed.mark_end (); + log_elapsed ("LINEAR: find first entry"); + + elapsed.reset (); + elapsed.mark_start (); + ptr = linear_search (middle); + elapsed.mark_end (); + log_elapsed ("LINEAR: find middle entry"); + + elapsed.reset (); + elapsed.mark_start (); + ptr = linear_search (last); + elapsed.mark_end (); + log_elapsed ("LINEAR: find last entry"); + } + + void find_system_native_entry_benchmark () + { + find_entry_benchmark ("System.Native", system_native_pinvokes); + } +#endif + void* find_internal_entry (hash_t entrypoint_hash) { - log_debug (LOG_ASSEMBLY, "Looking up internal p/invoke"); +// log_debug (LOG_ASSEMBLY, "Looking up internal p/invoke"); #if INTPTR_MAX == INT64_MAX switch (entrypoint_hash) { @@ -638,9 +1334,16 @@ namespace { return nullptr; } +#if INTPTR_MAX == INT64_MAX + void find_internal_benchmark () + { + find_entry_benchmark ("Internal", internal_pinvokes); + } +#endif + void* find_system_globalization_entry (hash_t entrypoint_hash) { - log_debug (LOG_ASSEMBLY, "Looking up System.Globalization p/invoke"); +// log_debug (LOG_ASSEMBLY, "Looking up System.Globalization p/invoke"); #if INTPTR_MAX == INT64_MAX switch (entrypoint_hash) { case 0x10f8526b1edfc3: return reinterpret_cast(&GlobalizationNative_GetLocaleInfoInt ); @@ -684,18 +1387,181 @@ namespace { return nullptr; } +#if INTPTR_MAX == INT64_MAX + void find_system_globalization_benchmark () + { + find_entry_benchmark ("System.Globalization", system_globalization_pinvokes); + } +#endif + void* find_system_security_cryptography_entry (hash_t entrypoint_hash) { - log_debug (LOG_ASSEMBLY, "Looking up System.Security.Cryptography p/invoke"); +// log_debug (LOG_ASSEMBLY, "Looking up System.Security.Cryptography p/invoke"); +#if INTPTR_MAX == INT64_MAX + switch (entrypoint_hash) { + case 0x75a0e90c77ca35: return reinterpret_cast(&AndroidCryptoNative_EcKeyCreateByExplicitParameters ); + case 0x47302bd7e277183: return reinterpret_cast(&AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry ); + case 0x598db66ca39c41f: return reinterpret_cast(&AndroidCryptoNative_EcKeyUpRef ); + case 0x656cac62ccc9e3c: return reinterpret_cast(&AndroidCryptoNative_X509GetContentType ); + case 0x690c4347972024f: return reinterpret_cast(&AndroidCryptoNative_Aes256Gcm ); + case 0x7b5579ab0499b1f: return reinterpret_cast(&AndroidCryptoNative_RsaSize ); + case 0xcaba893801c6a6f: return reinterpret_cast(&AndroidCryptoNative_Aes256Ecb ); + case 0xcbe6d3d22131194: return reinterpret_cast(&AndroidCryptoNative_SetRsaParameters ); + case 0x1027786cdd9a3e9c: return reinterpret_cast(&AndroidCryptoNative_Aes192Cbc ); + case 0x1d1bb0528d517729: return reinterpret_cast(&AndroidCryptoNative_SSLGetSupportedProtocols ); + case 0x1e6228e955989698: return reinterpret_cast(&AndroidCryptoNative_EcKeyCreateByOid ); + case 0x1f45ac9d3c6b1554: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetCipherSuite ); + case 0x1f7d2360a1cdcbff: return reinterpret_cast(&AndroidCryptoNative_SSLStreamCreate ); + case 0x218fce505a140c55: return reinterpret_cast(&AndroidCryptoNative_EcDsaVerify ); + case 0x23ac2a4c4d1c744e: return reinterpret_cast(&AndroidCryptoNative_X509ChainGetCertificateCount ); + case 0x267c94097a3bf1f3: return reinterpret_cast(&AndroidCryptoNative_CipherDestroy ); + case 0x2b45d7cdf6e8e0c7: return reinterpret_cast(&AndroidCryptoNative_X509StoreDeleteEntry ); + case 0x2c7e5e179cc917cb: return reinterpret_cast(&AndroidCryptoNative_DsaSizeSignature ); + case 0x2fdcf708ff792105: return reinterpret_cast(&AndroidCryptoNative_SSLStreamVerifyHostname ); + case 0x31027564deeb71b0: return reinterpret_cast(&AndroidCryptoNative_Aes128Cbc ); + case 0x3f19a16a3230b551: return reinterpret_cast(&AndroidCryptoNative_ChaCha20Poly1305 ); + case 0x401935ffc3454bb1: return reinterpret_cast(&AndroidCryptoNative_X509PublicKey ); + case 0x40bfa1211f5f6f9c: return reinterpret_cast(&AndroidCryptoNative_EcKeyGetCurveName ); + case 0x41b6e7f32da99fa9: return reinterpret_cast(&AndroidCryptoNative_X509ChainDestroyContext ); + case 0x41c169fb0e30a390: return reinterpret_cast(&AndroidCryptoNative_X509ChainGetErrorCount ); + case 0x420718c398131a55: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetProtocol ); + case 0x43741165a5ba60d5: return reinterpret_cast(&AndroidCryptoNative_CipherUpdateAAD ); + case 0x4845e1c76265acc9: return reinterpret_cast(&AndroidCryptoNative_X509StoreEnumerateCertificates ); + case 0x4a7272ac9d117f2d: return reinterpret_cast(&AndroidCryptoNative_EcKeyDestroy ); + case 0x4d6361e5095cff36: return reinterpret_cast(&AndroidCryptoNative_DsaSign ); + case 0x4d74053b37e582fa: return reinterpret_cast(&AndroidCryptoNative_X509ChainCreateContext ); + case 0x501daf7e3a890220: return reinterpret_cast(&AndroidCryptoNative_X509ChainBuild ); + case 0x52fc107ebdb6fcc7: return reinterpret_cast(&AndroidCryptoNative_X509StoreRemoveCertificate ); + case 0x5fd29ac523ff6e3d: return reinterpret_cast(&AndroidCryptoNative_SSLStreamRelease ); + case 0x5ffae3c8023a80b8: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetPeerCertificate ); + case 0x648a9b317bc64fe0: return reinterpret_cast(&AndroidCryptoNative_RsaGenerateKeyEx ); + case 0x66e049fe27bf91ea: return reinterpret_cast(&AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration ); + case 0x67a8868ef592a3fd: return reinterpret_cast(&AndroidCryptoNative_SSLStreamShutdown ); + case 0x67a9b5bbce322f8c: return reinterpret_cast(&AndroidCryptoNative_Des3Cbc ); + case 0x6a59d9242cd31785: return reinterpret_cast(&AndroidCryptoNative_RsaPrivateDecrypt ); + case 0x6dbd90e9cc86310b: return reinterpret_cast(&AndroidCryptoNative_CipherFinalEx ); + case 0x6dfd40c2dd0d7382: return reinterpret_cast(&AndroidCryptoNative_RsaUpRef ); + case 0x6f990f1f7bc80630: return reinterpret_cast(&AndroidCryptoNative_RsaCreate ); + case 0x70f907b97d3fe059: return reinterpret_cast(&AndroidCryptoNative_Aes192Ccm ); + case 0x7150f0eb40797bb3: return reinterpret_cast(&AndroidCryptoNative_SSLStreamCreateWithCertificates ); + case 0x7356b141407d261e: return reinterpret_cast(&AndroidCryptoNative_EcdhDeriveKey ); + case 0x74ec4a8d869776ad: return reinterpret_cast(&AndroidCryptoNative_Aes128Ccm ); + case 0x758dfbf057da0da0: return reinterpret_cast(&AndroidCryptoNative_DsaSignatureFieldSize ); + case 0x7975d1d7029cf1a3: return reinterpret_cast(&AndroidCryptoNative_Aes128Gcm ); + case 0x79f5c24afbd04af1: return reinterpret_cast(&AndroidCryptoNative_Aes256Cbc ); + case 0x7a37e0d077f2dfe5: return reinterpret_cast(&AndroidCryptoNative_DsaGenerateKey ); + case 0x7d5273ad530e7298: return reinterpret_cast(&AndroidCryptoNative_X509StoreOpenDefault ); + case 0x7fa96d0284954375: return reinterpret_cast(&AndroidCryptoNative_X509Decode ); + case 0x813bedf08c3388d4: return reinterpret_cast(&AndroidCryptoNative_Aes128Cfb8 ); + case 0x84cc0301870c37ce: return reinterpret_cast(&AndroidCryptoNative_SSLStreamSetTargetHost ); + case 0x868e09dc7dfea364: return reinterpret_cast(&AndroidCryptoNative_RsaSignPrimitive ); + case 0x870191ad244b8069: return reinterpret_cast(&AndroidCryptoNative_RegisterRemoteCertificateValidationCallback ); + case 0x87019b7831c0c34c: return reinterpret_cast(&AndroidCryptoNative_Aes192Gcm ); + case 0x87c447e7f873cff0: return reinterpret_cast(&AndroidCryptoNative_X509ChainValidate ); + case 0x9039632237d70ae7: return reinterpret_cast(&AndroidCryptoNative_NewGlobalReference ); + case 0x9161ade1206fd86e: return reinterpret_cast(&AndroidCryptoNative_Aes256Cfb128 ); + case 0x9167a072639a7c95: return reinterpret_cast(&AndroidCryptoNative_Aes256Ccm ); + case 0x91f065ec0d3aec55: return reinterpret_cast(&AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey ); + case 0x95a0e2fc5c0cb49e: return reinterpret_cast(&AndroidCryptoNative_SSLStreamSetApplicationProtocols ); + case 0x9991a277809ef205: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetApplicationProtocol ); + case 0x9aab07f824659d3e: return reinterpret_cast(&AndroidCryptoNative_DsaKeyCreateByExplicitParameters ); + case 0x9e79166979634030: return reinterpret_cast(&AndroidCryptoNative_CipherSetKeyAndIV ); + case 0x9edddf30d660eff4: return reinterpret_cast(&AndroidCryptoNative_Aes192Ecb ); + case 0xa308025a784497df: return reinterpret_cast(&AndroidCryptoNative_SSLStreamSetEnabledProtocols ); + case 0xa56954e28eb9a9c9: return reinterpret_cast(&AndroidCryptoNative_Des3Cfb8 ); + case 0xa5eda72b95fe78c3: return reinterpret_cast(&AndroidCryptoNative_X509ChainGetErrors ); + case 0xa93eb533acf7564d: return reinterpret_cast(&AndroidCryptoNative_DesEcb ); + case 0xa961e8db31830e16: return reinterpret_cast(&AndroidCryptoNative_Aes192Cfb8 ); + case 0xaa8f0f87ae474ffe: return reinterpret_cast(&AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry ); + case 0xad1a2d6575cdd4e3: return reinterpret_cast(&AndroidCryptoNative_SSLStreamWrite ); + case 0xae82e9ceae24192d: return reinterpret_cast(&AndroidCryptoNative_Pbkdf2 ); + case 0xb0df46ff09c57741: return reinterpret_cast(&AndroidCryptoNative_GetRsaParameters ); + case 0xb1c394b9992bd67d: return reinterpret_cast(&AndroidCryptoNative_EcDsaSign ); + case 0xb1ff12f3bd735982: return reinterpret_cast(&AndroidCryptoNative_AeadCipherFinalEx ); + case 0xb4996dd1aba38200: return reinterpret_cast(&AndroidCryptoNative_EcDsaSize ); + case 0xb575ec01a7a79f8f: return reinterpret_cast(&AndroidCryptoNative_DesCfb8 ); + case 0xb66be1550d27bfb4: return reinterpret_cast(&AndroidCryptoNative_GetECCurveParameters ); + case 0xbd5a0be2f7904089: return reinterpret_cast(&AndroidCryptoNative_X509StoreAddCertificate ); + case 0xbdbbd2898347c0d1: return reinterpret_cast(&AndroidCryptoNative_SSLStreamHandshake ); + case 0xc11cd661db8be230: return reinterpret_cast(&AndroidCryptoNative_Des3Cfb64 ); + case 0xc2d5e1c465b2f5b6: return reinterpret_cast(&AndroidCryptoNative_DsaSizeP ); + case 0xc3145e336c38379b: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetPeerCertificates ); + case 0xc7815e0476511544: return reinterpret_cast(&AndroidCryptoNative_X509Encode ); + case 0xc8a52a8b6d96b32b: return reinterpret_cast(&AndroidCryptoNative_X509ExportPkcs7 ); + case 0xca48c3927c202794: return reinterpret_cast(&AndroidCryptoNative_GetECKeyParameters ); + case 0xcb4bcdafdc81d116: return reinterpret_cast(&AndroidCryptoNative_CipherCreatePartial ); + case 0xcc433093c073719e: return reinterpret_cast(&AndroidCryptoNative_SSLStreamRead ); + case 0xce9f8a6ac705faa5: return reinterpret_cast(&AndroidCryptoNative_X509DecodeCollection ); + case 0xd5c063a90ae882c1: return reinterpret_cast(&AndroidCryptoNative_CipherIsSupported ); + case 0xd7d818c7640598dc: return reinterpret_cast(&AndroidCryptoNative_X509ChainGetCertificates ); + case 0xd7f1a8f616897ace: return reinterpret_cast(&AndroidCryptoNative_Aes256Cfb8 ); + case 0xd9bd0b370726ce34: return reinterpret_cast(&AndroidCryptoNative_CipherReset ); + case 0xda4898a26933f73d: return reinterpret_cast(&AndroidCryptoNative_DsaVerify ); + case 0xdbb4752ed23670f0: return reinterpret_cast(&AndroidCryptoNative_DesCbc ); + case 0xdc780005b0d39711: return reinterpret_cast(&AndroidCryptoNative_X509StoreGetPrivateKeyEntry ); + case 0xdd4c03f06ce96e04: return reinterpret_cast(&AndroidCryptoNative_RsaDestroy ); + case 0xdde06993f87d6ffc: return reinterpret_cast(&AndroidCryptoNative_Aes128Cfb128 ); + case 0xde1e22dd097f799c: return reinterpret_cast(&AndroidCryptoNative_CipherSetNonceLength ); + case 0xde259001bf54e6f1: return reinterpret_cast(&AndroidCryptoNative_SSLStreamIsLocalCertificateUsed ); + case 0xdec5c7544d2c8cb1: return reinterpret_cast(&AndroidCryptoNative_GetDsaParameters ); + case 0xdfede2defd776f7e: return reinterpret_cast(&AndroidCryptoNative_X509ChainSetCustomTrustStore ); + case 0xe059239741e0011a: return reinterpret_cast(&AndroidCryptoNative_EcKeyCreateByKeyParameters ); + case 0xe0f34ce89fd38aef: return reinterpret_cast(&AndroidCryptoNative_RsaPublicEncrypt ); + case 0xe604fca300068c0c: return reinterpret_cast(&AndroidCryptoNative_CipherCtxSetPadding ); + case 0xeab45239fb3f138d: return reinterpret_cast(&AndroidCryptoNative_GetBigNumBytes ); + case 0xeff5d014640ae969: return reinterpret_cast(&AndroidCryptoNative_DeleteGlobalReference ); + case 0xf1577384f409ea85: return reinterpret_cast(&AndroidCryptoNative_BigNumToBinary ); + case 0xf4dea312f71c5ff2: return reinterpret_cast(&AndroidCryptoNative_Aes128Ecb ); + case 0xf57f81262f07542c: return reinterpret_cast(&AndroidCryptoNative_Des3Ecb ); + case 0xf7b334768844b502: return reinterpret_cast(&AndroidCryptoNative_X509StoreContainsCertificate ); + case 0xf85b8ffeba9b06c1: return reinterpret_cast(&AndroidCryptoNative_X509StoreEnumerateTrustedCertificates ); + case 0xf96bc1e7e15e69f2: return reinterpret_cast(&AndroidCryptoNative_CipherUpdate ); + case 0xf970881d4fa83e07: return reinterpret_cast(&AndroidCryptoNative_CipherCreate ); + case 0xf9c3d216226b3355: return reinterpret_cast(&AndroidCryptoNative_CipherSetTagLength ); + case 0xfa2669c25616a8ff: return reinterpret_cast(&AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry ); + case 0xfaa7766eaa2c54a5: return reinterpret_cast(&AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo ); + case 0xfc0bad2b1528000f: return reinterpret_cast(&AndroidCryptoNative_RsaVerificationPrimitive ); + case 0xfcdeea476953780c: return reinterpret_cast(&AndroidCryptoNative_Aes192Cfb128 ); + case 0xfd2cdd99f11de76c: return reinterpret_cast(&AndroidCryptoNative_EcKeyGetSize ); + case 0xfd4f2784ec1c98aa: return reinterpret_cast(&AndroidCryptoNative_SSLStreamRequestClientAuthentication ); + case 0xfe3dd06281f7cd1f: return reinterpret_cast(&AndroidCryptoNative_SSLStreamInitialize ); + } +#endif return nullptr; } +#if INTPTR_MAX == INT64_MAX + void find_system_security_cryptography_benchmark () + { + find_entry_benchmark ("System.Security.Cryptography", system_crypto_android_pinvokes); + } +#endif + void* find_system_io_compression_entry (hash_t entrypoint_hash) { - log_debug (LOG_ASSEMBLY, "Looking up System.IO.Compression p/invoke"); +// log_debug (LOG_ASSEMBLY, "Looking up System.IO.Compression p/invoke"); + +#if INTPTR_MAX == INT64_MAX + switch (entrypoint_hash) { + case 0x99f2ee02463000: return reinterpret_cast(&CompressionNative_Crc32 ); + case 0x403e1bc0b3baba84: return reinterpret_cast(&CompressionNative_Inflate ); + case 0xafe3d21bbaa71464: return reinterpret_cast(&CompressionNative_DeflateEnd ); + case 0xc10e411c989a9314: return reinterpret_cast(&CompressionNative_Deflate ); + case 0xca001af79c0d7a8b: return reinterpret_cast(&CompressionNative_InflateEnd ); + case 0xcd5d8a63493f5e38: return reinterpret_cast(&CompressionNative_InflateInit2_ ); + case 0xea5e6653389b924a: return reinterpret_cast(&CompressionNative_DeflateInit2_ ); + } +#endif return nullptr; } +#if INTPTR_MAX == INT64_MAX + void find_system_io_compression_benchmark () + { + find_entry_benchmark ("System.IO.Compression", system_io_compression_pinvokes); + } +#endif + void* find_pinvoke (hash_t library_name_hash, hash_t entrypoint_hash, bool& known_library) { // Order of `case` statements should be roughly sorted by the (projected) frequency of calls from the @@ -724,6 +1590,10 @@ namespace { } } +namespace { + bool benchmarks_done = false; +} + [[gnu::flatten]] void* PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) @@ -731,6 +1601,22 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha log_debug (LOG_ASSEMBLY, __PRETTY_FUNCTION__); log_debug (LOG_ASSEMBLY, "library_name == '%s'; entrypoint_name == '%s'", library_name, entrypoint_name); + bool known_library = true; +#if INTPTR_MAX == INT64_MAX + if (!benchmarks_done) { + benchmarks_done = true; + + if (FastTiming::enabled ()) { + find_system_io_compression_benchmark (); + find_system_globalization_benchmark (); + find_internal_benchmark (); + find_system_security_cryptography_benchmark (); + find_system_native_entry_benchmark (); + } + } + known_library = true; +#endif + if (library_name == nullptr || entrypoint_name == nullptr) { return nullptr; } @@ -739,7 +1625,7 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); log_debug (LOG_ASSEMBLY, "library_name_hash == 0x%zx; entrypoint_hash == 0x%zx", library_name_hash, entrypoint_hash); - bool known_library = true; + //bool known_library = true; void *pinvoke_ptr = find_pinvoke (library_name_hash, entrypoint_hash, known_library); if (pinvoke_ptr != nullptr) { return pinvoke_ptr; From 105d44ae947d5368310565736721fae130fe4574 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Thu, 5 Sep 2024 21:31:31 +0200 Subject: [PATCH 26/53] Beginnings of real code generation --- .../Utilities/PinvokeScanner.cs | 22 ++-- ...PreservePinvokesNativeAssemblyGenerator.cs | 82 ++++++++++++-- src/native/monodroid/monodroid-networkinfo.cc | 6 +- src/native/pinvoke-override/dynamic.cc | 2 + src/native/runtime-base/cpu-arch.hh | 2 +- src/native/runtime-base/internal-pinvokes.hh | 105 ++++++++---------- 6 files changed, 140 insertions(+), 79 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs index ae510e5c38e..f06e90bc1a5 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs @@ -45,33 +45,33 @@ public List Scan (AndroidTargetArch targetArch, XAAssemblyReso log.LogWarning ($"Failed to resolve assembly '{fasm.ItemSpec}' for target architecture {targetArch}"); continue; } - Scan (asmdef, pinvokeCache, pinvokes); + Scan (targetArch, asmdef, pinvokeCache, pinvokes); } return pinvokes; } - void Scan (AssemblyDefinition assembly, HashSet pinvokeCache, List pinvokes) + void Scan (AndroidTargetArch targetArch, AssemblyDefinition assembly, HashSet pinvokeCache, List pinvokes) { - log.LogDebugMessage ($"Scanning assembly {assembly}"); + log.LogDebugMessage ($"[p/invoke][{targetArch}] Scanning assembly {assembly}"); foreach (ModuleDefinition module in assembly.Modules) { if (!module.HasTypes) { continue; } foreach (TypeDefinition type in module.Types) { - Scan (type, pinvokeCache, pinvokes); + Scan (targetArch, type, pinvokeCache, pinvokes); } } } - void Scan (TypeDefinition type, HashSet pinvokeCache, List pinvokes) + void Scan (AndroidTargetArch targetArch, TypeDefinition type, HashSet pinvokeCache, List pinvokes) { if (!type.HasMethods) { return; } - log.LogDebugMessage ($"Scanning type '{type}'"); + log.LogDebugMessage ($"[p/invoke][{targetArch}] Scanning type '{type}'"); foreach (MethodDefinition method in type.Methods) { if (!method.HasPInvokeInfo) { continue; @@ -83,9 +83,17 @@ void Scan (TypeDefinition type, HashSet pinvokeCache, List PInvokes; + public bool Is64Bit; + + public Component (string name, ulong nameHash, List pinvokes, bool is64Bit) + { + Name = name; + NameHash = nameHash; + PInvokes = pinvokes; + Is64Bit = is64Bit; + } + } + // Maps a component name after ridding it of the `lib` prefix and the extension to a "canonical" // name of a library, as used in `[DllImport]` attributes. readonly Dictionary libraryNameMap = new (StringComparer.Ordinal) { @@ -42,7 +70,7 @@ public PreservePinvokesNativeAssemblyGenerator (TaskLoggingHelper log, NativeCod protected override void Construct (LlvmIrModule module) { - Log.LogDebugMessage ("Constructing p/invoke preserve code"); + Log.LogDebugMessage ($"[{state.TargetArch}] Constructing p/invoke preserve code"); List pinvokeInfos = state.PinvokeInfos!; if (pinvokeInfos.Count == 0) { // This is a very unlikely scenario, but we will work just fine. The module that this generator produces will merely result @@ -67,14 +95,50 @@ protected override void Construct (LlvmIrModule module) return; } + bool is64Bit = state.TargetArch switch { + AndroidTargetArch.Arm64 => true, + AndroidTargetArch.X86_64 => true, + AndroidTargetArch.Arm => false, + AndroidTargetArch.X86 => false, + _ => throw new NotSupportedException ($"Architecture {state.TargetArch} is not supported here") + }; + Log.LogDebugMessage (" Checking discovered p/invokes against the list of components"); + var preservedPerComponent = new Dictionary (StringComparer.OrdinalIgnoreCase); + var processedCache = new HashSet (StringComparer.OrdinalIgnoreCase); + foreach (PinvokeScanner.PinvokeEntryInfo pinfo in pinvokeInfos) { Log.LogDebugMessage ($" p/invoke: {pinfo.EntryName} in {pinfo.LibraryName}"); - if (MustPreserve (pinfo, componentNames)) { - Log.LogDebugMessage (" must be preserved"); - } else { + string key = $"{pinfo.LibraryName}/${pinfo.EntryName}"; + if (processedCache.Contains (key)) { + Log.LogDebugMessage ($" already processed"); + continue; + } + + processedCache.Add (key); + if (!MustPreserve (pinfo, componentNames)) { Log.LogDebugMessage (" no need to preserve"); + continue; + } + Log.LogDebugMessage (" must be preserved"); + + if (!preservedPerComponent.TryGetValue (pinfo.LibraryName, out Component? component)) { + component = new Component ( + pinfo.LibraryName, + MonoAndroidHelper.GetXxHash (pinfo.LibraryName, is64Bit), + new List (), + is64Bit + ); + preservedPerComponent.Add (pinfo.LibraryName, component); } + component.PInvokes.Add (new PInvoke (module, pinfo)); + } + + Log.LogDebugMessage (" Components to be preserved:"); + + foreach (var kvp in preservedPerComponent) { + var component = kvp.Value; + Log.LogDebugMessage ($" {component.Name} (hash: 0x{component.NameHash:x}; {component.PInvokes.Count} p/invoke(s))"); } } diff --git a/src/native/monodroid/monodroid-networkinfo.cc b/src/native/monodroid/monodroid-networkinfo.cc index 50267299def..6a328db218f 100644 --- a/src/native/monodroid/monodroid-networkinfo.cc +++ b/src/native/monodroid/monodroid-networkinfo.cc @@ -127,19 +127,19 @@ _monodroid_get_network_interface_state (const char *ifname, mono_bool *is_up, mo return ret; } -mono_bool +extern "C" mono_bool _monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up) { return _monodroid_get_network_interface_state (ifname, is_up, nullptr); } -mono_bool +extern "C" mono_bool _monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast) { return _monodroid_get_network_interface_state (ifname, nullptr, supports_multicast); } -int +extern "C" int _monodroid_get_dns_servers (void **dns_servers_array) { if (!dns_servers_array) { diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc index b93d843ea0f..b81a91d19dc 100644 --- a/src/native/pinvoke-override/dynamic.cc +++ b/src/native/pinvoke-override/dynamic.cc @@ -1562,6 +1562,8 @@ namespace { } #endif + extern "C" + [[gnu::noinline]] void* find_pinvoke (hash_t library_name_hash, hash_t entrypoint_hash, bool& known_library) { // Order of `case` statements should be roughly sorted by the (projected) frequency of calls from the diff --git a/src/native/runtime-base/cpu-arch.hh b/src/native/runtime-base/cpu-arch.hh index de0e9cf93d5..db9cd6bb43f 100644 --- a/src/native/runtime-base/cpu-arch.hh +++ b/src/native/runtime-base/cpu-arch.hh @@ -8,5 +8,5 @@ #define CPU_KIND_X86 ((unsigned short)4) #define CPU_KIND_X86_64 ((unsigned short)5) -void _monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit); +extern "C" void _monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit); #endif // ndef NET diff --git a/src/native/runtime-base/internal-pinvokes.hh b/src/native/runtime-base/internal-pinvokes.hh index c3ad0e9cc3f..e8370cbec55 100644 --- a/src/native/runtime-base/internal-pinvokes.hh +++ b/src/native/runtime-base/internal-pinvokes.hh @@ -12,62 +12,49 @@ #include "xamarin-app.hh" #include "xamarin_getifaddrs.h" -int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); -void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); - -#include - -#include "log_types.hh" -#include "timing.hh" -#include "xamarin-app.hh" -#include "xamarin_getifaddrs.h" - -int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); -void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); - -mono_bool _monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up); -mono_bool _monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast); -int _monodroid_get_dns_servers (void **dns_servers_array); - -unsigned int monodroid_get_log_categories (); -int monodroid_get_system_property (const char *name, char **value); -int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix); -void monodroid_log (xamarin::android::LogLevel level, LogCategories category, const char *message); -void monodroid_free (void *ptr); -int _monodroid_max_gref_get (); -int _monodroid_gref_get (); -void _monodroid_gref_log (const char *message); -int _monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable); -void _monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); -int _monodroid_weak_gref_get (); -void _monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable); -void _monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); -void _monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); -void _monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); -void _monodroid_gc_wait_for_bridge_processing (); -void monodroid_clear_gdb_wait (); -void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v); -void* _monodroid_timezone_get_default_id (); -void _monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args); -xamarin::android::managed_timing_sequence* monodroid_timing_start (const char *message); -void monodroid_timing_stop (xamarin::android::managed_timing_sequence *sequence, const char *message); -char** monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens); -void monodroid_strfreev (char **str_array); -char* monodroid_strdup_printf (const char *format, ...); -char* monodroid_TypeManager_get_java_class_name (jclass klass); -int monodroid_get_namespaced_system_property (const char *name, char **value); -FILE* monodroid_fopen (const char* filename, const char* mode); -int send_uninterrupted (int fd, void *buf, int len); -int recv_uninterrupted (int fd, void *buf, int len); -void set_world_accessable (const char *path); -void create_public_directory (const char *dir); -char* path_combine (const char *path1, const char *path2); -void* monodroid_dylib_mono_new ([[maybe_unused]] const char *libmono_path); -void monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports); -int monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path); -void* monodroid_get_dylib (); -const char* _monodroid_lookup_replacement_type (const char *jniSimpleReference); -const JniRemappingReplacementMethod* _monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature); -void monodroid_log_traces (uint32_t kind, const char *first_line); -void _monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit); - +extern "C" { + int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); + void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); + unsigned int monodroid_get_log_categories (); + int monodroid_get_system_property (const char *name, char **value); + int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix); + void monodroid_log (xamarin::android::LogLevel level, LogCategories category, const char *message); + void monodroid_free (void *ptr); + int _monodroid_max_gref_get (); + int _monodroid_gref_get (); + void _monodroid_gref_log (const char *message); + int _monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable); + void _monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); + int _monodroid_weak_gref_get (); + void _monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable); + void _monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); + void _monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); + void _monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); + void _monodroid_gc_wait_for_bridge_processing (); + int _monodroid_get_android_api_level (); + void monodroid_clear_gdb_wait (); + void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v); + void* _monodroid_timezone_get_default_id (); + void _monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args); + xamarin::android::managed_timing_sequence* monodroid_timing_start (const char *message); + void monodroid_timing_stop (xamarin::android::managed_timing_sequence *sequence, const char *message); + char** monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens); + void monodroid_strfreev (char **str_array); + char* monodroid_strdup_printf (const char *format, ...); + char* monodroid_TypeManager_get_java_class_name (jclass klass); + int monodroid_get_namespaced_system_property (const char *name, char **value); + FILE* monodroid_fopen (const char* filename, const char* mode); + int send_uninterrupted (int fd, void *buf, int len); + int recv_uninterrupted (int fd, void *buf, int len); + void set_world_accessable (const char *path); + void create_public_directory (const char *dir); + char* path_combine (const char *path1, const char *path2); + void* monodroid_dylib_mono_new ([[maybe_unused]] const char *libmono_path); + void monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports); + int monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path); + void* monodroid_get_dylib (); + const char* _monodroid_lookup_replacement_type (const char *jniSimpleReference); + const JniRemappingReplacementMethod* _monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature); + void monodroid_log_traces (uint32_t kind, const char *first_line); + void _monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit); +} From 56e1096e4064623ee26b052ebb92d3a9b5d13707 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Fri, 6 Sep 2024 21:47:08 +0200 Subject: [PATCH 27/53] Code generation progress --- .../LlvmIrCallingConvention.cs | 34 +++++ .../LlvmIrGenerator/LlvmIrFunction.cs | 11 ++ .../LlvmIrGenerator.Constants.cs | 7 + .../LlvmIrGenerator/LlvmIrGenerator.cs | 21 ++- .../LlvmIrGenerator/LlvmIrInstructions.cs | 105 +++++++++++++++ ...PreservePinvokesNativeAssemblyGenerator.cs | 122 +++++++++++++++--- 6 files changed, 282 insertions(+), 18 deletions(-) create mode 100644 src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrCallingConvention.cs diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrCallingConvention.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrCallingConvention.cs new file mode 100644 index 00000000000..c9abcc34a0b --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrCallingConvention.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace Xamarin.Android.Tasks.LLVMIR; + +/// +/// Function calling convention, see https://llvm.org/docs/LangRef.html#callingconv for more detailed docs. +/// Not all conventions are included in this enumeration, only those we may potentially need. +/// +enum LlvmIrCallingConvention +{ + /// + /// Outputs no keyword, making function use whatever is the compiler's default calling convention. + /// + Default, + + /// + /// The C calling convention (`ccc`) + /// + Ccc, + + /// + /// The fast calling convention (`fastcc`). This calling convention attempts to make calls as fast + /// as possible (e.g. by passing things in registers). + /// + Fastcc, + + /// + /// Tail callable calling convention (`tailcc`). This calling convention ensures that calls in tail + /// position will always be tail call optimized. This calling convention is equivalent to fastcc, + /// except for an additional guarantee that tail calls will be produced whenever possible. + /// + Tailcc, +} diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrFunction.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrFunction.cs index aa156ecaef9..10238567864 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrFunction.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrFunction.cs @@ -21,6 +21,7 @@ sealed class SavedParameterState : ILlvmIrSavedFunctionParameterState public bool? ReadNone; public bool? SignExt; public bool? ZeroExt; + public bool? WriteOnly; public bool? IsCplusPlusReference; public bool IsVarArgs; @@ -40,6 +41,7 @@ public SavedParameterState (LlvmIrFunctionParameter owner, SavedParameterState? ReadNone = previousState.ReadNone; SignExt = previousState.SignExt; ZeroExt = previousState.ZeroExt; + WriteOnly = previousState.WriteOnly; IsCplusPlusReference = previousState.IsCplusPlusReference; IsVarArgs = previousState.IsVarArgs; } @@ -131,6 +133,14 @@ public bool? ZeroExt { set => state.ZeroExt = value; } + /// + /// writeonly attribute, see + /// + public bool? WriteOnly { + get => state.WriteOnly; + set => state.WriteOnly = value; + } + /// /// This serves a purely documentational purpose, when generating comments about types. It describes a parameter that is a C++ reference, something we can't /// reflect on the managed side. @@ -411,6 +421,7 @@ public SavedFunctionState (LlvmIrFunction owner, ILlvmIrSavedFunctionSignatureSt public LlvmIrLinkage Linkage { get; set; } = LlvmIrLinkage.Default; public LlvmIrRuntimePreemption RuntimePreemption { get; set; } = LlvmIrRuntimePreemption.Default; public LlvmIrVisibility Visibility { get; set; } = LlvmIrVisibility.Default; + public LlvmIrCallingConvention CallingConvention { get; set; } = LlvmIrCallingConvention.Default; public LlvmIrFunctionBody Body { get; } public string? Comment { get; set; } public bool ReturnsValue => Signature.ReturnType != typeof(void); diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.Constants.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.Constants.cs index 9600dbc81e1..c71b7753b59 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.Constants.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.Constants.cs @@ -46,5 +46,12 @@ partial class LlvmIrGenerator { LlvmIrWritability.Constant, "constant" }, { LlvmIrWritability.Writable, "global" }, }; + + // https://llvm.org/docs/LangRef.html#callingconv + static readonly Dictionary llvmCallingConvention = new () { + { LlvmIrCallingConvention.Ccc, "ccc" }, + { LlvmIrCallingConvention.Fastcc, "fastcc" }, + { LlvmIrCallingConvention.Tailcc, "tailcc" }, + }; } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs index 7e29ecad9f2..7844a917192 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs @@ -28,12 +28,14 @@ sealed class GeneratorWriteContext public readonly LlvmIrModuleTarget Target; public readonly LlvmIrMetadataManager MetadataManager; public readonly LlvmIrTypeCache TypeCache; + public readonly LlvmIrGenerator Generator; public string CurrentIndent { get; private set; } = String.Empty; public bool InVariableGroup { get; set; } public LlvmIrVariableNumberFormat NumberFormat { get; set; } = LlvmIrVariableNumberFormat.Default; - public GeneratorWriteContext (TextWriter writer, LlvmIrModule module, LlvmIrModuleTarget target, LlvmIrMetadataManager metadataManager, LlvmIrTypeCache cache) + public GeneratorWriteContext (LlvmIrGenerator generator, TextWriter writer, LlvmIrModule module, LlvmIrModuleTarget target, LlvmIrMetadataManager metadataManager, LlvmIrTypeCache cache) { + Generator = generator; Output = writer; Module = module; Target = target; @@ -163,7 +165,7 @@ public void Generate (TextWriter writer, LlvmIrModule module) LlvmIrMetadataManager metadataManager = module.GetMetadataManagerCopy (); target.AddTargetSpecificMetadata (metadataManager); - var context = new GeneratorWriteContext (writer, module, target, metadataManager, module.TypeCache); + var context = new GeneratorWriteContext (this, writer, module, target, metadataManager, module.TypeCache); if (!String.IsNullOrEmpty (FilePath)) { WriteCommentLine (context, $" ModuleID = '{FileName}'"); context.Output.WriteLine ($"source_filename = \"{FileName}\""); @@ -670,7 +672,7 @@ string ToHex (BasicType basicTypeDesc, Type type, object? value) return $"{(basicTypeDesc.IsUnsigned ? prefixUnsigned : prefixSigned)}0x{hex}"; } - void WriteValue (GeneratorWriteContext context, Type type, object? value) + public void WriteValue (GeneratorWriteContext context, Type type, object? value) { if (value is LlvmIrVariable variableRef) { context.Output.Write (variableRef.Reference); @@ -1226,6 +1228,11 @@ void WriteFunctionLeadingDecorations (GeneratorWriteContext context, LlvmIrFunct context.Output.Write (llvmVisibility[func.Visibility]); context.Output.Write (' '); } + + if (func.CallingConvention != LlvmIrCallingConvention.Default) { + context.Output.Write (llvmCallingConvention[func.CallingConvention]); + context.Output.Write (' '); + } } void WriteFunctionDeclarationTrailingDecorations (GeneratorWriteContext context, LlvmIrFunction func) @@ -1251,6 +1258,10 @@ void WriteFunctionTrailingDecorations (GeneratorWriteContext context, LlvmIrFunc public static void WriteReturnAttributes (GeneratorWriteContext context, LlvmIrFunctionSignature.ReturnTypeAttributes returnAttrs) { + if (AttributeIsSet (returnAttrs.InReg)) { + context.Output.Write ("inreg"); + } + if (AttributeIsSet (returnAttrs.NoUndef)) { context.Output.Write ("noundef "); } @@ -1349,6 +1360,10 @@ public static void WriteParameterAttributes (GeneratorWriteContext context, Llvm attributes.Add ("zeroext"); } + if (AttributeIsSet (parameter.WriteOnly)) { + attributes.Add ("writeonly"); + } + if (parameter.Align.HasValue) { attributes.Add ($"align({ValueOrPointerSize (parameter.Align.Value)})"); } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs index 1d93cbec9e5..aba43059f08 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs @@ -624,4 +624,109 @@ public Unreachable () : base ("unreachable") {} } + + public class Switch : LlvmIrInstruction where T: struct + { + // Since we can't use System.Numerics.IBinaryInteger, this is the poor man's verification that T is acceptable for us + static readonly HashSet acceptedTypes = new () { + typeof (byte), + typeof (sbyte), + typeof (short), + typeof (ushort), + typeof (int), + typeof (uint), + typeof (long), + typeof (ulong), + }; + + readonly LlvmIrVariable value; + readonly LlvmIrFunctionLabelItem defaultDest; + readonly string? automaticLabelPrefix; + ulong automaticLabelCounter = 0; + List<(T constant, LlvmIrFunctionLabelItem label, string? comment)>? items; + + public Switch (LlvmIrVariable value, LlvmIrFunctionLabelItem defaultDest, string? automaticLabelPrefix = null) + : base ("switch") + { + if (!acceptedTypes.Contains (typeof(T))) { + throw new NotSupportedException ($"Type '{typeof(T)}' is unsupported, only integer types are accepted"); + } + + if (value.Type != typeof (T)) { + throw new ArgumentException ($"Must refer to value of type '{typeof(T)}'", nameof (value)); + } + + this.value = value; + this.defaultDest = defaultDest; + this.automaticLabelPrefix = automaticLabelPrefix; + + if (!String.IsNullOrEmpty (automaticLabelPrefix)) { + items = new (); + } + } + + protected override void WriteBody (GeneratorWriteContext context) + { + string irType = LlvmIrGenerator.MapToIRType (value.Type, context.TypeCache, out _, out bool isPointer); + + context.Output.Write (irType); + context.Output.Write (' '); + + WriteValue (context, value.Type, value, isPointer); + + context.Output.Write (", label %"); + context.Output.Write (defaultDest.Name); + context.Output.WriteLine (" ["); + context.IncreaseIndent (); + + foreach ((T constant, LlvmIrFunctionLabelItem label, string? comment) in items) { + context.Output.Write (context.CurrentIndent); + context.Output.Write (irType); + context.Output.Write (' '); + context.Generator.WriteValue (context, value.Type, constant); + context.Output.Write (", label %"); + context.Output.Write (label.Name); + if (!String.IsNullOrEmpty (comment)) { + context.Generator.WriteCommentLine (context, comment); + } else { + context.Output.WriteLine (); + } + } + + context.DecreaseIndent (); + context.Output.Write (context.CurrentIndent); + context.Output.Write (']'); + } + + public LlvmIrFunctionLabelItem Add (T val, LlvmIrFunctionLabelItem? dest = null, string? comment = null) + { + var label = MakeLabel (dest); + items.Add ((val, label, comment)); + return label; + } + + void EnsureValidity (LlvmIrFunctionLabelItem? dest) + { + if (dest != null) { + return; + } + + if (String.IsNullOrEmpty (automaticLabelPrefix)) { + throw new InvalidOperationException ($"Internal error: automatic label management requested, but prefix not defined"); + } + } + + LlvmIrFunctionLabelItem MakeLabel (LlvmIrFunctionLabelItem? maybeDest) + { + EnsureValidity (maybeDest); + if (maybeDest != null) { + return maybeDest; + } + + var ret = new LlvmIrFunctionLabelItem (automaticLabelCounter == 0 ? automaticLabelPrefix : $"{automaticLabelPrefix}{automaticLabelCounter}"); + automaticLabelCounter++; + + return ret; + } + } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs index 5d180ea6779..9bbadb91525 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs @@ -17,10 +17,12 @@ sealed class PInvoke { public readonly LlvmIrFunction NativeFunction; public readonly PinvokeScanner.PinvokeEntryInfo Info; + public readonly ulong Hash; - public PInvoke (LlvmIrModule module, PinvokeScanner.PinvokeEntryInfo pinfo) + public PInvoke (LlvmIrModule module, PinvokeScanner.PinvokeEntryInfo pinfo, bool is64Bit) { Info = pinfo; + Hash = MonoAndroidHelper.GetXxHash (pinfo.EntryName, is64Bit); // All the p/invoke functions use the same dummy signature. The only thing we care about is // a way to reference to the symbol at build time so that we can return pointer to it. For @@ -37,13 +39,23 @@ sealed class Component public readonly List PInvokes; public bool Is64Bit; - public Component (string name, ulong nameHash, List pinvokes, bool is64Bit) + public Component (string name, bool is64Bit) { Name = name; - NameHash = nameHash; - PInvokes = pinvokes; + NameHash = MonoAndroidHelper.GetXxHash (name, is64Bit); + PInvokes = new (); Is64Bit = is64Bit; } + + public void Add (LlvmIrModule module, PinvokeScanner.PinvokeEntryInfo pinfo) + { + PInvokes.Add (new PInvoke (module, pinfo, Is64Bit)); + } + + public void Sort () + { + PInvokes.Sort ((PInvoke a, PInvoke b) => a.Hash.CompareTo (b.Hash)); + } } // Maps a component name after ridding it of the `lib` prefix and the extension to a "canonical" @@ -123,23 +135,103 @@ protected override void Construct (LlvmIrModule module) Log.LogDebugMessage (" must be preserved"); if (!preservedPerComponent.TryGetValue (pinfo.LibraryName, out Component? component)) { - component = new Component ( - pinfo.LibraryName, - MonoAndroidHelper.GetXxHash (pinfo.LibraryName, is64Bit), - new List (), - is64Bit - ); - preservedPerComponent.Add (pinfo.LibraryName, component); + component = new Component (pinfo.LibraryName, is64Bit); + preservedPerComponent.Add (component.Name, component); } - component.PInvokes.Add (new PInvoke (module, pinfo)); + component.Add (module, pinfo); } - Log.LogDebugMessage (" Components to be preserved:"); + var components = new List (preservedPerComponent.Values); + if (is64Bit) { + AddFindPinvoke (module, components, is64Bit); + } else { + AddFindPinvoke (module, components, is64Bit); + } + } + + void AddFindPinvoke (LlvmIrModule module, List components, bool is64Bit) where T: struct + { + var hashType = is64Bit ? typeof (ulong) : typeof (uint); + var parameters = new List { + new LlvmIrFunctionParameter (hashType, "library_name_hash") { + NoUndef = true, + }, + + new LlvmIrFunctionParameter (hashType, "entrypoint_hash") { + NoUndef = true, + }, - foreach (var kvp in preservedPerComponent) { - var component = kvp.Value; + new LlvmIrFunctionParameter (typeof(IntPtr), "known_library") { + Align = 1, // it's a reference to C++ `bool` + Dereferenceable = 1, + IsCplusPlusReference = true, + NoCapture = true, + NonNull = true, + NoUndef = true, + WriteOnly = true, + }, + }; + + var sig = new LlvmIrFunctionSignature ( + name: "find_pinvoke", + returnType: typeof(IntPtr), + parameters: parameters, + new LlvmIrFunctionSignature.ReturnTypeAttributes { + NoUndef = true, + } + ); + + // TODO: attributes + var func = new LlvmIrFunction (sig, MakeFindPinvokeAttributeSet (module)) { + CallingConvention = LlvmIrCallingConvention.Fastcc, + Linkage = LlvmIrLinkage.Internal, + }; + module.Add (func); + func.Body.Add (new LlvmIrFunctionLabelItem ("entry")); + + var libraryNameSwitchEpilog = new LlvmIrFunctionLabelItem ("libNameSW.epilog"); + var componentSwitch = new LlvmIrInstructions.Switch (parameters[0], libraryNameSwitchEpilog, "sw.libname"); + func.Body.Add (componentSwitch); + + components.Sort ((Component a, Component b) => a.NameHash.CompareTo (b.NameHash)); + Log.LogDebugMessage (" Components to be preserved:"); + foreach (Component component in components) { + component.Sort (); Log.LogDebugMessage ($" {component.Name} (hash: 0x{component.NameHash:x}; {component.PInvokes.Count} p/invoke(s))"); + + LlvmIrFunctionLabelItem componentLabel; + if (is64Bit) { + componentLabel = componentSwitch.Add ((T)(object)component.NameHash); + } else { + componentLabel = componentSwitch.Add ((T)(object)(uint)component.NameHash); + } + + func.Body.Add (componentLabel); + // TODO: output component `switch` here } + + func.Body.Add (libraryNameSwitchEpilog); + } + + LlvmIrFunctionAttributeSet MakeFindPinvokeAttributeSet (LlvmIrModule module) + { + var attrSet = new LlvmIrFunctionAttributeSet { + new MustprogressFunctionAttribute (), + new NofreeFunctionAttribute (), + new NorecurseFunctionAttribute (), + new NosyncFunctionAttribute (), + new NounwindFunctionAttribute (), + new WillreturnFunctionAttribute (), + new MemoryFunctionAttribute { + Default = MemoryAttributeAccessKind.Write, + Argmem = MemoryAttributeAccessKind.None, + InaccessibleMem = MemoryAttributeAccessKind.None, + }, + new UwtableFunctionAttribute (), + new NoTrappingMathFunctionAttribute (true), + }; + + return module.AddAttributeSet (attrSet); } // Returns `true` for all p/invokes that we know are part of our set of components, otherwise returns `false`. From 23252f886c889a88173673822777f4d19ee01b66 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 9 Sep 2024 17:35:55 +0200 Subject: [PATCH 28/53] Generated find_pinvoke code appears to be correct --- .../LlvmIrGenerator/LlvmIrFunctionBody.cs | 17 ++-- .../LlvmIrGenerator/LlvmIrInstructions.cs | 93 +++++++++++++++---- .../LlvmIrGenerator/LlvmIrVariable.cs | 55 +++++++---- ...PreservePinvokesNativeAssemblyGenerator.cs | 91 +++++++++++++++--- 4 files changed, 203 insertions(+), 53 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrFunctionBody.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrFunctionBody.cs index 5c1b03990ae..f8cd42eab0a 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrFunctionBody.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrFunctionBody.cs @@ -171,7 +171,7 @@ public LlvmIrFunctionBody (LlvmIrFunction func, LlvmIrFunction.FunctionState fun previousLabel = implicitStartBlock = new LlvmIrFunctionImplicitStartLabel (functionState.StartingBlockNumber); } - public void Add (LlvmIrFunctionLabelItem label) + public void Add (LlvmIrFunctionLabelItem label, string? comment = null) { label.WillAddToBody (this, functionState); if (definedLabels.Contains (label.Name)) { @@ -189,13 +189,16 @@ public void Add (LlvmIrFunctionLabelItem label) precedingBlock1 = previousLabel; previousLabel = label; - var comment = new StringBuilder (" preds = %"); - comment.Append (precedingBlock1.Name); - if (precedingBlock2 != null) { - comment.Append (", %"); - comment.Append (precedingBlock2.Name); + if (comment == null) { + var sb = new StringBuilder (" preds = %"); + sb.Append (precedingBlock1.Name); + if (precedingBlock2 != null) { + sb.Append (", %"); + sb.Append (precedingBlock2.Name); + } + comment = sb.ToString (); } - label.Comment = comment.ToString (); + label.Comment = comment; } public void Add (LlvmIrFunctionBodyItem item) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs index aba43059f08..8c6848ef5ff 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs @@ -73,6 +73,8 @@ protected void WriteValue (GeneratorWriteContext context, Type type, object? val context.Output.Write ("null"); } else if (value is LlvmIrVariable variable) { context.Output.Write (variable.Reference); + } else if (value is bool) { + context.Output.Write ((bool)value ? "true" : "false"); } else { context.Output.Write (MonoAndroidHelper.CultureInvariantToString (value)); } @@ -510,11 +512,27 @@ protected override void WriteBody (GeneratorWriteContext context) public class Phi : LlvmIrInstruction { + sealed class Node + { + public readonly LlvmIrVariableReference? Variable; + public readonly LlvmIrFunctionLabelItem? Label; + + public Node (LlvmIrVariableReference? variable, LlvmIrFunctionLabelItem? label) + { + Variable = variable; + Label = label; + } + } + LlvmIrVariable result; - LlvmIrVariable val1; - LlvmIrFunctionLabelItem label1; - LlvmIrVariable val2; - LlvmIrFunctionLabelItem label2; + readonly List nodes; + + public Phi (LlvmIrVariable result) + : base ("phi") + { + nodes = new (); + this.result = result; + } /// /// Represents the `phi` instruction form we use the most throughout marshal methods generator - one which refers to an if/else block and where @@ -522,14 +540,20 @@ public class Phi : LlvmIrInstruction /// it is possible that hasn't had the required blocks defined prior to adding the `phi` instruction and, thus, /// we must check for the possibility here. /// - public Phi (LlvmIrVariable result, LlvmIrVariable val1, LlvmIrFunctionLabelItem? label1, LlvmIrVariable val2, LlvmIrFunctionLabelItem? label2) + public Phi (LlvmIrVariable result, LlvmIrVariableReference val1, LlvmIrFunctionLabelItem? label1, LlvmIrVariableReference val2, LlvmIrFunctionLabelItem? label2) : base ("phi") { this.result = result; - this.val1 = val1; - this.label1 = label1 ?? throw new ArgumentNullException (nameof (label1)); - this.val2 = val2; - this.label2 = label2 ?? throw new ArgumentNullException (nameof (label2)); + + nodes = new () { + new Node (val1, label1 ?? throw new ArgumentNullException (nameof (label1))), + new Node (val2, label2 ?? throw new ArgumentNullException (nameof (label2))), + }; + } + + public void AddNode (LlvmIrFunctionLabelItem label, LlvmIrVariableReference? variable) + { + nodes.Add (new Node (variable, label)); } protected override void WriteValueAssignment (GeneratorWriteContext context) @@ -541,14 +565,42 @@ protected override void WriteValueAssignment (GeneratorWriteContext context) protected override void WriteBody (GeneratorWriteContext context) { context.Output.Write (LlvmIrGenerator.MapToIRType (result.Type, context.TypeCache)); + context.IncreaseIndent (); + + bool first = true; + foreach (Node node in nodes) { + if (!first) { + context.Output.WriteLine (','); + } else { + first = false; + context.Output.WriteLine (); + } + context.Output.Write (context.CurrentIndent); + WriteNode (context, node); + } + context.DecreaseIndent (); + + // context.Output.Write (" ["); + // context.Output.Write (val1.Reference); + // context.Output.Write (", %"); + // context.Output.Write (label1.Name); + // context.Output.Write ("], ["); + // context.Output.Write (val2.Reference); + // context.Output.Write (", %"); + // context.Output.Write (label2.Name); + // context.Output.Write (']'); + } + + void WriteNode (GeneratorWriteContext context, Node node) + { + if (node.Label == null) { + throw new NotImplementedException ("Internal error: null labels not implemented"); + } + context.Output.Write (" ["); - context.Output.Write (val1.Reference); - context.Output.Write (", %"); - context.Output.Write (label1.Name); - context.Output.Write ("], ["); - context.Output.Write (val2.Reference); + context.Output.Write (node.Variable == null ? "null" : node.Variable.Reference); context.Output.Write (", %"); - context.Output.Write (label2.Name); + context.Output.Write (node.Label.Name); context.Output.Write (']'); } } @@ -594,6 +646,13 @@ public Store (LlvmIrVariable from, LlvmIrVariable to) this.to = to; } + public Store (object from, LlvmIrVariable to) + : base (Opcode) + { + this.from = from; + this.to = to; + } + /// /// Stores `null` in the indicated variable /// @@ -605,7 +664,8 @@ public Store (LlvmIrVariable to) protected override void WriteBody (GeneratorWriteContext context) { - string irType = LlvmIrGenerator.MapToIRType (to.Type, context.TypeCache, out ulong size, out bool isPointer); + Type type = from?.GetType () ?? to.Type; + string irType = LlvmIrGenerator.MapToIRType (type, context.TypeCache, out ulong size, out bool isPointer); context.Output.Write (irType); context.Output.Write (' '); @@ -687,6 +747,7 @@ protected override void WriteBody (GeneratorWriteContext context) context.Output.Write (", label %"); context.Output.Write (label.Name); if (!String.IsNullOrEmpty (comment)) { + context.Output.Write (' '); context.Generator.WriteCommentLine (context, comment); } else { context.Output.WriteLine (); diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrVariable.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrVariable.cs index d66bda3d7c9..324868328a2 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrVariable.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrVariable.cs @@ -21,12 +21,45 @@ enum LlvmIrVariableNumberFormat Decimal, } -abstract class LlvmIrVariable : IEquatable +abstract class LlvmIrVariableReference { public abstract bool Global { get; } public abstract string NamePrefix { get; } - public string? Name { get; protected set; } + + /// + /// Returns a string which constitutes a reference to a local (using the % prefix character) or a global + /// (using the @ prefix character) variable, ready for use in the generated code wherever variables are + /// referenced. + /// + public virtual string Reference { + get { + if (String.IsNullOrEmpty (Name)) { + throw new InvalidOperationException ("Variable doesn't have a name, it cannot be referenced"); + } + + return $"{NamePrefix}{Name}"; + } + } + + protected LlvmIrVariableReference (string name) + { + Name = name; + } +} + +class LlvmIrGlobalVariableReference : LlvmIrVariableReference +{ + public override bool Global => true; + public override string NamePrefix => "@"; + + public LlvmIrGlobalVariableReference (string name) + : base (name) + {} +} + +abstract class LlvmIrVariable : LlvmIrVariableReference, IEquatable +{ public Type Type { get; protected set; } public LlvmIrVariableWriteOptions WriteOptions { get; set; } = LlvmIrVariableWriteOptions.ArrayWriteIndexComments; @@ -47,21 +80,6 @@ abstract class LlvmIrVariable : IEquatable /// will ignore name when checking for equality. protected bool NameMatters { get; set; } = true; - /// - /// Returns a string which constitutes a reference to a local (using the % prefix character) or a global - /// (using the @ prefix character) variable, ready for use in the generated code wherever variables are - /// referenced. - /// - public virtual string Reference { - get { - if (String.IsNullOrEmpty (Name)) { - throw new InvalidOperationException ("Variable doesn't have a name, it cannot be referenced"); - } - - return $"{NamePrefix}{Name}"; - } - } - /// /// /// Certain data must be calculated when the target architecture is known, because it may depend on certain aspects of @@ -103,6 +121,7 @@ public virtual string Reference { /// is treated as an opaque pointer type. /// protected LlvmIrVariable (Type type, string? name = null) + : base (name) { Type = type; Name = name; @@ -253,7 +272,7 @@ class LlvmIrGlobalVariable : LlvmIrVariable public LlvmIrStreamedArrayDataProvider? ArrayDataProvider { get; set; } /// - /// Constructs a local variable. is translated to one of the LLVM IR first class types (see + /// Constructs a global variable. is translated to one of the LLVM IR first class types (see /// https://llvm.org/docs/LangRef.html#t-firstclass) only if it's an integral or floating point type. In all other cases it /// is treated as an opaque pointer type. is required because global variables must be named. /// diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs index 9bbadb91525..4ea00f3ca7b 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs @@ -58,6 +58,15 @@ public void Sort () } } + sealed class ConstructionState + { + public LlvmIrFunction Func; + public LlvmIrFunctionLabelItem ReturnLabel; + public LlvmIrFunctionParameter EntryPointHashParam; + public LlvmIrInstructions.Phi Phi; + public bool Is64Bit; + } + // Maps a component name after ridding it of the `lib` prefix and the extension to a "canonical" // name of a library, as used in `[DllImport]` attributes. readonly Dictionary libraryNameMap = new (StringComparer.Ordinal) { @@ -181,36 +190,94 @@ void AddFindPinvoke (LlvmIrModule module, List components, bool is } ); - // TODO: attributes var func = new LlvmIrFunction (sig, MakeFindPinvokeAttributeSet (module)) { CallingConvention = LlvmIrCallingConvention.Fastcc, Linkage = LlvmIrLinkage.Internal, }; - module.Add (func); - func.Body.Add (new LlvmIrFunctionLabelItem ("entry")); + LlvmIrLocalVariable retval = func.CreateLocalVariable (typeof(IntPtr), "retval"); + var state = new ConstructionState { + Func = func, + ReturnLabel = new LlvmIrFunctionLabelItem ("return"), + EntryPointHashParam = parameters[1], + Phi = new LlvmIrInstructions.Phi (retval), + Is64Bit = is64Bit, + }; + module.Add (state.Func); + state.Func.Body.Add (new LlvmIrFunctionLabelItem ("entry")); var libraryNameSwitchEpilog = new LlvmIrFunctionLabelItem ("libNameSW.epilog"); var componentSwitch = new LlvmIrInstructions.Switch (parameters[0], libraryNameSwitchEpilog, "sw.libname"); - func.Body.Add (componentSwitch); + + state.Func.Body.Add (componentSwitch); + state.Phi.AddNode (libraryNameSwitchEpilog, null); components.Sort ((Component a, Component b) => a.NameHash.CompareTo (b.NameHash)); Log.LogDebugMessage (" Components to be preserved:"); + uint componentID = 1; + foreach (Component component in components) { - component.Sort (); Log.LogDebugMessage ($" {component.Name} (hash: 0x{component.NameHash:x}; {component.PInvokes.Count} p/invoke(s))"); - LlvmIrFunctionLabelItem componentLabel; - if (is64Bit) { - componentLabel = componentSwitch.Add ((T)(object)component.NameHash); + string comment = $" {component.Name}"; + LlvmIrFunctionLabelItem componentLabel = AddSwitchItem (componentSwitch, component.NameHash, is64Bit, comment, null); + + func.Body.Add (componentLabel, comment); + AddPInvokeSwitch (state, componentLabel, component, componentID++); + } + + func.Body.Add (libraryNameSwitchEpilog); + + var setKnownLib = new LlvmIrInstructions.Store (false, parameters[2]); + func.Body.Add (setKnownLib); + AddReturnBranch (func, state.ReturnLabel); + + func.Body.Add (state.ReturnLabel); + func.Body.Add (state.Phi); + func.Body.Add (new LlvmIrInstructions.Ret (typeof (IntPtr), retval)); + } + + void AddPInvokeSwitch (ConstructionState state, LlvmIrFunctionLabelItem componentLabel, Component component, uint id) where T: struct + { + var pinvokeSwitchEpilog = new LlvmIrFunctionLabelItem ($"pinvokeSW.epilog.{id}"); + state.Phi.AddNode (pinvokeSwitchEpilog, null); + + var pinvokeSwitch = new LlvmIrInstructions.Switch (state.EntryPointHashParam, pinvokeSwitchEpilog, $"sw.pinvoke.{id}"); + state.Func.Body.Add (pinvokeSwitch); + + component.Sort (); + bool first = true; + foreach (PInvoke pi in component.PInvokes) { + string pinvokeName = pi.NativeFunction.Signature.Name; + string comment = $" {pinvokeName}"; + LlvmIrFunctionLabelItem pinvokeLabel = AddSwitchItem (pinvokeSwitch, pi.Hash, state.Is64Bit, comment, first ? state.ReturnLabel : null); + + // First item of every component switch block "reuses" the block's label + if (first) { + first = false; } else { - componentLabel = componentSwitch.Add ((T)(object)(uint)component.NameHash); + state.Func.Body.Add (pinvokeLabel, comment); + AddReturnBranch (state.Func, state.ReturnLabel); } - func.Body.Add (componentLabel); - // TODO: output component `switch` here + state.Phi.AddNode (pinvokeLabel == state.ReturnLabel ? componentLabel : pinvokeLabel, new LlvmIrGlobalVariableReference (pinvokeName)); } - func.Body.Add (libraryNameSwitchEpilog); + state.Func.Body.Add (pinvokeSwitchEpilog); + AddReturnBranch (state.Func, state.ReturnLabel); + } + + void AddReturnBranch (LlvmIrFunction func, LlvmIrFunctionLabelItem returnLabel) + { + var branch = new LlvmIrInstructions.Br (returnLabel); + func.Body.Add (branch); + } + + LlvmIrFunctionLabelItem AddSwitchItem (LlvmIrInstructions.Switch sw, ulong hash, bool is64Bit, string? comment, LlvmIrFunctionLabelItem? label) where T: struct + { + if (is64Bit) { + return sw.Add ((T)(object)hash, dest: label, comment: comment); + } + return sw.Add ((T)(object)(uint)hash, dest: label, comment: comment); } LlvmIrFunctionAttributeSet MakeFindPinvokeAttributeSet (LlvmIrModule module) From 18f1d1430742fbc105fc7ca4db34177ae9f62679 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 9 Sep 2024 18:45:51 +0200 Subject: [PATCH 29/53] Linking works as expected The "hello world" apps size decrease: * ~2 meg for XA * ~1.8 meg for MAUI --- .../Utilities/NativeRuntimeComponents.cs | 4 +- ...PreservePinvokesNativeAssemblyGenerator.cs | 3 +- src/native/pinvoke-override/dynamic.cc | 1611 +---------------- 3 files changed, 8 insertions(+), 1610 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index 70ee1d5133a..e2e92594513 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -44,13 +44,13 @@ public ClangBuiltinsArchive (string clangAbi) class AndroidArchive : Archive { public AndroidArchive (string name) - : base (name, wholeArchive: true) + : base (name, wholeArchive: false) {} } sealed class BclArchive : Archive { - public BclArchive (string name, bool wholeArchive = true) + public BclArchive (string name, bool wholeArchive = false) : base (name, wholeArchive: wholeArchive) {} } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs index 4ea00f3ca7b..275b61387f2 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs @@ -192,7 +192,6 @@ void AddFindPinvoke (LlvmIrModule module, List components, bool is var func = new LlvmIrFunction (sig, MakeFindPinvokeAttributeSet (module)) { CallingConvention = LlvmIrCallingConvention.Fastcc, - Linkage = LlvmIrLinkage.Internal, }; LlvmIrLocalVariable retval = func.CreateLocalVariable (typeof(IntPtr), "retval"); var state = new ConstructionState { @@ -218,7 +217,7 @@ void AddFindPinvoke (LlvmIrModule module, List components, bool is foreach (Component component in components) { Log.LogDebugMessage ($" {component.Name} (hash: 0x{component.NameHash:x}; {component.PInvokes.Count} p/invoke(s))"); - string comment = $" {component.Name}"; + string comment = $" {component.Name} (p/invoke count: {component.PInvokes.Count})"; LlvmIrFunctionLabelItem componentLabel = AddSwitchItem (componentSwitch, component.NameHash, is64Bit, comment, null); func.Body.Add (componentLabel, comment); diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc index b81a91d19dc..7f87681e86c 100644 --- a/src/native/pinvoke-override/dynamic.cc +++ b/src/native/pinvoke-override/dynamic.cc @@ -1,1600 +1,15 @@ #include -#include "internal-pinvokes.hh" -#include "logger.hh" -#include "search.hh" -#include "timing.hh" -#include "timing-internal.hh" - #define PINVOKE_OVERRIDE_INLINE [[gnu::noinline]] #include "pinvoke-override-api-impl.hh" using namespace xamarin::android; using namespace xamarin::android::internal; -// TODO: these should be shared with the "static" dispatch code. They currently reside in `pinvoke-tables.include` -// which is not used by the "dynamic" dispatch -#if INTPTR_MAX == INT64_MAX -constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; -constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; -constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; -constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; -constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; -constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; -#else -constexpr hash_t java_interop_library_hash = 0x6e36e350; -constexpr hash_t xa_internal_api_library_hash = 0x13c9bd62; -constexpr hash_t system_native_library_hash = 0x5b9ade60; -constexpr hash_t system_io_compression_native_library_hash = 0xafe3142c; -constexpr hash_t system_security_cryptography_native_android_library_hash = 0x93625cd; -constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a; -#endif - -extern "C" { - // Fake prototypes, just to get symbol names - - void GlobalizationNative_GetLocaleInfoInt (); - void GlobalizationNative_ToAscii (); - void GlobalizationNative_GetSortKey (); - void GlobalizationNative_InitOrdinalCasingPage (); - void GlobalizationNative_GetCalendars (); - void GlobalizationNative_GetLocaleInfoString (); - void GlobalizationNative_GetICUVersion (); - void GlobalizationNative_StartsWith (); - void GlobalizationNative_GetLocaleName (); - void GlobalizationNative_IsNormalized (); - void GlobalizationNative_GetTimeZoneDisplayName (); - void GlobalizationNative_IndexOf (); - void GlobalizationNative_NormalizeString (); - void GlobalizationNative_GetSortVersion (); - void GlobalizationNative_IanaIdToWindowsId (); - void GlobalizationNative_ToUnicode (); - void GlobalizationNative_ChangeCaseTurkish (); - void GlobalizationNative_GetCalendarInfo (); - void GlobalizationNative_WindowsIdToIanaId (); - void GlobalizationNative_GetLocaleTimeFormat (); - void GlobalizationNative_GetLatestJapaneseEra (); - void GlobalizationNative_ChangeCase (); - void GlobalizationNative_EndsWith (); - void GlobalizationNative_GetSortHandle (); - void GlobalizationNative_LoadICU (); - void GlobalizationNative_CompareString (); - void GlobalizationNative_InitICUFunctions (); - void GlobalizationNative_IsPredefinedLocale (); - void GlobalizationNative_GetDefaultLocaleName (); - void GlobalizationNative_LastIndexOf (); - void GlobalizationNative_GetJapaneseEraStartDate (); - void GlobalizationNative_GetLocales (); - void GlobalizationNative_EnumCalendarInfo (); - void GlobalizationNative_GetLocaleInfoGroupingSizes(); - void GlobalizationNative_ChangeCaseInvariant (); - void GlobalizationNative_CloseSortHandle (); - - void SystemNative_Bind (); - void SystemNative_TryGetIPPacketInformation (); - void SystemNative_Receive (); - void SystemNative_Abort (); - void SystemNative_SetPosixSignalHandler (); - void SystemNative_GetEstimatedTcpConnectionCount (); - void SystemNative_LockFileRegion (); - void SystemNative_MSync (); - void SystemNative_INotifyInit (); - void SystemNative_GetUInt64OSThreadId (); - void SystemNative_SetRLimit (); - void SystemNative_GetMaximumAddressSize (); - void SystemNative_PathConf (); - void SystemNative_LowLevelMonitor_Acquire (); - void SystemNative_Read (); - void SystemNative_SetSendTimeout (); - void SystemNative_Dup (); - void SystemNative_GetEUid (); - void SystemNative_Log (); - void SystemNative_CreateThread (); - void SystemNative_SetTerminalInvalidationHandler (); - void SystemNative_FcntlSetPipeSz (); - void SystemNative_SetSockOpt (); - void SystemNative_RealPath (); - void SystemNative_GetWindowSize (); - void SystemNative_MkDir (); - void SystemNative_CreateSocketEventPort (); - void SystemNative_TryChangeSocketEventRegistration (); - void SystemNative_GetSystemTimeAsTicks (); - void SystemNative_SNPrintF_1S (); - void SystemNative_LowLevelMonitor_TimedWait (); - void SystemNative_ConfigureTerminalForChildProcess (); - void SystemNative_GetGroupName (); - void SystemNative_GetRawSockOpt (); - void SystemNative_FStat (); - void SystemNative_GetActiveTcpConnectionInfos (); - void SystemNative_GetAddressFamily (); - void SystemNative_CloseSocketEventPort (); - void SystemNative_LChflagsCanSetHiddenFlag (); - void SystemNative_ReadDirR (); - void SystemNative_FAllocate (); - void SystemNative_Connectx (); - void SystemNative_PReadV (); - void SystemNative_HandleNonCanceledPosixSignal (); - void SystemNative_CanGetHiddenFlag (); - void SystemNative_Close (); - void SystemNative_Pipe (); - void SystemNative_SendFile (); - void SystemNative_Stat (); - void SystemNative_GetIPv6Address (); - void SystemNative_LowLevelMonitor_Wait (); - void SystemNative_LStat (); - void SystemNative_ConvertErrorPalToPlatform (); - void SystemNative_GetErrNo (); - void SystemNative_CreateSocketEventBuffer (); - void SystemNative_INotifyAddWatch (); - void SystemNative_GetIPv4Address (); - void SystemNative_CreateNetworkChangeListenerSocket (); - void SystemNative_SchedGetAffinity (); - void SystemNative_FLock (); - void SystemNative_AlignedRealloc (); - void SystemNative_InitializeTerminalAndSignalHandling (); - void SystemNative_MProtect (); - void SystemNative_GetRLimit (); - void SystemNative_Unlink (); - void SystemNative_DrainAutoreleasePool (); - void SystemNative_GetIPv6MulticastOption (); - void SystemNative_LowLevelMonitor_Destroy (); - void SystemNative_ShmUnlink (); - void SystemNative_GetSocketErrorOption (); - void SystemNative_EnablePosixSignalHandling (); - void SystemNative_StrErrorR (); - void SystemNative_RmDir (); - void SystemNative_SetIPv4MulticastOption (); - void SystemNative_SNPrintF (); - void SystemNative_ReadLink (); - void SystemNative_Accept (); - void SystemNative_FChflags (); - void SystemNative_Disconnect (); - void SystemNative_SetEUid (); - void SystemNative_FUTimens (); - void SystemNative_GetLingerOption (); - void SystemNative_FreeHostEntry (); - void SystemNative_GetFormatInfoForMountPoint (); - void SystemNative_AlignedAlloc (); - void SystemNative_SysLog (); - void SystemNative_Write (); - void SystemNative_GetOSArchitecture (); - void SystemNative_AlignedFree (); - void SystemNative_SetAddressFamily (); - void SystemNative_SetIPv6Address (); - void SystemNative_LowLevelMonitor_Create (); - void SystemNative_GetUnixRelease (); - void SystemNative_LChflags (); - void SystemNative_SetPriority (); - void SystemNative_GetSocketAddressSizes (); - void SystemNative_GetPeerID (); - void SystemNative_GetUnixVersion (); - void SystemNative_SysConf (); - void SystemNative_GetDeviceIdentifiers (); - void SystemNative_GetProcessPath (); - void SystemNative_SetDelayedSigChildConsoleConfigurationHandler (); - void SystemNative_GetEnv (); - void SystemNative_GetActiveUdpListeners (); - void SystemNative_InterfaceNameToIndex (); - void SystemNative_FTruncate (); - void SystemNative_GetControlCharacters (); - void SystemNative_GetPort (); - void SystemNative_Exit (); - void SystemNative_InitializeConsoleBeforeRead (); - void SystemNative_GetReadDirRBufferSize (); - void SystemNative_SchedSetAffinity (); - void SystemNative_GetNativeIPInterfaceStatistics (); - void SystemNative_GetSignalForBreak (); - void SystemNative_PWriteV (); - void SystemNative_FreeEnviron (); - void SystemNative_GetHostName (); - void SystemNative_FcntlSetFD (); - void SystemNative_Realloc (); - void SystemNative_PlatformSupportsDualModeIPv4PacketInfo (); - void SystemNative_GetSockOpt (); - void SystemNative_GetLoadLibraryError (); - void SystemNative_Link (); - void SystemNative_FSync (); - void SystemNative_Malloc (); - void SystemNative_ReceiveSocketError (); - void SystemNative_ReadStdin (); - void SystemNative_DisablePosixSignalHandling (); - void SystemNative_Connect (); - void SystemNative_GetAllMountPoints (); - void SystemNative_LoadLibrary (); - void SystemNative_GetTimeZoneData (); - void SystemNative_GetDomainSocketSizes (); - void SystemNative_MUnmap (); - void SystemNative_MkNod (); - void SystemNative_WaitForSocketEvents (); - void SystemNative_GetPlatformSignalNumber (); - void SystemNative_FcntlSetIsNonBlocking (); - void SystemNative_SetKeypadXmit (); - void SystemNative_MAdvise (); - void SystemNative_MkdTemp (); - void SystemNative_FChMod (); - void SystemNative_OpenDir (); - void SystemNative_WaitPidExitedNoHang (); - void SystemNative_FcntlGetPipeSz (); - void SystemNative_GetTimestamp (); - void SystemNative_SchedGetCpu (); - void SystemNative_GetPwNamR (); - void SystemNative_ShmOpen (); - void SystemNative_GetSid (); - void SystemNative_MksTemps (); - void SystemNative_GetBytesAvailable (); - void SystemNative_GetIPv4MulticastOption (); - void SystemNative_SetSignalForBreak (); - void SystemNative_FcntlCanGetSetPipeSz (); - void SystemNative_MkFifo (); - void SystemNative_GetNetworkInterfaces (); - void SystemNative_ChDir (); - void SystemNative_IsATty (); - void SystemNative_INotifyRemoveWatch (); - void SystemNative_MMap (); - void SystemNative_GetNumRoutes (); - void SystemNative_GetGroups (); - void SystemNative_StdinReady (); - void SystemNative_GetCwd (); - void SystemNative_Shutdown (); - void SystemNative_GetCryptographicallySecureRandomBytes (); - void SystemNative_UTimensat (); - void SystemNative_CopyFile (); - void SystemNative_CloseDir (); - void SystemNative_Rename (); - void SystemNative_MapTcpState (); - void SystemNative_SetIPv6MulticastOption (); - void SystemNative_GetHostEntryForName (); - void SystemNative_Access (); - void SystemNative_GetGroupList (); - void SystemNative_LogError (); - void SystemNative_Socket (); - void SystemNative_GetSockName (); - void SystemNative_SetRawSockOpt (); - void SystemNative_ReadEvents (); - void SystemNative_GetPwUidR (); - void SystemNative_Sync (); - void SystemNative_Calloc (); - void SystemNative_GetBootTimeTicks (); - void SystemNative_SymLink (); - void SystemNative_FcntlGetFD (); - void SystemNative_GetNameInfo (); - void SystemNative_Send (); - void SystemNative_EnumerateInterfaceAddresses (); - void SystemNative_GetPriority (); - void SystemNative_iOSSupportVersion (); - void SystemNative_LowLevelMonitor_Release (); - void SystemNative_GetEGid (); - void SystemNative_GetSocketType (); - void SystemNative_RegisterForSigChld (); - void SystemNative_GetCpuUtilization (); - void SystemNative_ForkAndExecProcess (); - void SystemNative_ChMod (); - void SystemNative_FreeSocketEventBuffer (); - void SystemNative_UninitializeConsoleAfterRead (); - void SystemNative_GetControlMessageBufferSize (); - void SystemNative_ReceiveMessage (); - void SystemNative_Kill (); - void SystemNative_GetEnviron (); - void SystemNative_SearchPath (); - void SystemNative_ConvertErrorPlatformToPal (); - void SystemNative_LSeek (); - void SystemNative_SetPort (); - void SystemNative_GetDefaultTimeZone (); - void SystemNative_PRead (); - void SystemNative_GetDomainName (); - void SystemNative_GetIPv4GlobalStatistics (); - void SystemNative_GetIcmpv4GlobalStatistics (); - void SystemNative_GetEstimatedUdpListenerCount (); - void SystemNative_LowLevelMonitor_Signal_Release (); - void SystemNative_SetLingerOption (); - void SystemNative_Open (); - void SystemNative_GetAtOutOfBandMark (); - void SystemNative_ReadProcessStatusInfo (); - void SystemNative_CreateAutoreleasePool (); - void SystemNative_FcntlGetIsNonBlocking (); - void SystemNative_SendMessage (); - void SystemNative_SetErrNo (); - void SystemNative_TryGetUInt32OSThreadId (); - void SystemNative_Listen (); - void SystemNative_GetNonCryptographicallySecureRandomBytes (); - void SystemNative_SetIPv4Address (); - void SystemNative_GetProcAddress (); - void SystemNative_FreeLibrary (); - void SystemNative_PWrite (); - void SystemNative_SetReceiveTimeout (); - void SystemNative_Poll (); - void SystemNative_GetTcpGlobalStatistics (); - void SystemNative_GetDefaultSearchOrderPseudoHandle (); - void SystemNative_GetIcmpv6GlobalStatistics (); - void SystemNative_SearchPath_TempDirectory (); - void SystemNative_SNPrintF_1I (); - void SystemNative_EnumerateGatewayAddressesForInterface (); - void SystemNative_Free (); - void SystemNative_GetUdpGlobalStatistics (); - void SystemNative_WaitIdAnyExitedNoHangNoWait (); - void SystemNative_PosixFAdvise (); - void SystemNative_GetPid (); - void SystemNative_Sysctl (); - void SystemNative_GetPeerName (); - void SystemNative_GetSpaceInfoForMountPoint (); - void SystemNative_GetFileSystemType (); - - void AndroidCryptoNative_EcKeyCreateByExplicitParameters (); - void AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry (); - void AndroidCryptoNative_EcKeyUpRef (); - void AndroidCryptoNative_X509GetContentType (); - void AndroidCryptoNative_Aes256Gcm (); - void AndroidCryptoNative_RsaSize (); - void AndroidCryptoNative_Aes256Ecb (); - void AndroidCryptoNative_SetRsaParameters (); - void AndroidCryptoNative_Aes192Cbc (); - void AndroidCryptoNative_SSLGetSupportedProtocols (); - void AndroidCryptoNative_EcKeyCreateByOid (); - void AndroidCryptoNative_SSLStreamGetCipherSuite (); - void AndroidCryptoNative_SSLStreamCreate (); - void AndroidCryptoNative_EcDsaVerify (); - void AndroidCryptoNative_X509ChainGetCertificateCount (); - void AndroidCryptoNative_CipherDestroy (); - void AndroidCryptoNative_X509StoreDeleteEntry (); - void AndroidCryptoNative_DsaSizeSignature (); - void AndroidCryptoNative_SSLStreamVerifyHostname (); - void AndroidCryptoNative_Aes128Cbc (); - void AndroidCryptoNative_ChaCha20Poly1305 (); - void AndroidCryptoNative_X509PublicKey (); - void AndroidCryptoNative_EcKeyGetCurveName (); - void AndroidCryptoNative_X509ChainDestroyContext (); - void AndroidCryptoNative_X509ChainGetErrorCount (); - void AndroidCryptoNative_SSLStreamGetProtocol (); - void AndroidCryptoNative_CipherUpdateAAD (); - void AndroidCryptoNative_X509StoreEnumerateCertificates (); - void AndroidCryptoNative_EcKeyDestroy (); - void AndroidCryptoNative_DsaSign (); - void AndroidCryptoNative_X509ChainCreateContext (); - void AndroidCryptoNative_X509ChainBuild (); - void AndroidCryptoNative_X509StoreRemoveCertificate (); - void AndroidCryptoNative_SSLStreamRelease (); - void AndroidCryptoNative_SSLStreamGetPeerCertificate (); - void AndroidCryptoNative_RsaGenerateKeyEx (); - void AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration (); - void AndroidCryptoNative_SSLStreamShutdown (); - void AndroidCryptoNative_Des3Cbc (); - void AndroidCryptoNative_RsaPrivateDecrypt (); - void AndroidCryptoNative_CipherFinalEx (); - void AndroidCryptoNative_RsaUpRef (); - void AndroidCryptoNative_RsaCreate (); - void AndroidCryptoNative_Aes192Ccm (); - void AndroidCryptoNative_SSLStreamCreateWithCertificates (); - void AndroidCryptoNative_EcdhDeriveKey (); - void AndroidCryptoNative_Aes128Ccm (); - void AndroidCryptoNative_DsaSignatureFieldSize (); - void AndroidCryptoNative_Aes128Gcm (); - void AndroidCryptoNative_Aes256Cbc (); - void AndroidCryptoNative_DsaGenerateKey (); - void AndroidCryptoNative_X509StoreOpenDefault (); - void AndroidCryptoNative_X509Decode (); - void AndroidCryptoNative_Aes128Cfb8 (); - void AndroidCryptoNative_SSLStreamSetTargetHost (); - void AndroidCryptoNative_RsaSignPrimitive (); - void AndroidCryptoNative_RegisterRemoteCertificateValidationCallback (); - void AndroidCryptoNative_Aes192Gcm (); - void AndroidCryptoNative_X509ChainValidate (); - void AndroidCryptoNative_NewGlobalReference (); - void AndroidCryptoNative_Aes256Cfb128 (); - void AndroidCryptoNative_Aes256Ccm (); - void AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey (); - void AndroidCryptoNative_SSLStreamSetApplicationProtocols (); - void AndroidCryptoNative_SSLStreamGetApplicationProtocol (); - void AndroidCryptoNative_DsaKeyCreateByExplicitParameters (); - void AndroidCryptoNative_CipherSetKeyAndIV (); - void AndroidCryptoNative_Aes192Ecb (); - void AndroidCryptoNative_SSLStreamSetEnabledProtocols (); - void AndroidCryptoNative_Des3Cfb8 (); - void AndroidCryptoNative_X509ChainGetErrors (); - void AndroidCryptoNative_DesEcb (); - void AndroidCryptoNative_Aes192Cfb8 (); - void AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry (); - void AndroidCryptoNative_SSLStreamWrite (); - void AndroidCryptoNative_Pbkdf2 (); - void AndroidCryptoNative_GetRsaParameters (); - void AndroidCryptoNative_EcDsaSign (); - void AndroidCryptoNative_AeadCipherFinalEx (); - void AndroidCryptoNative_EcDsaSize (); - void AndroidCryptoNative_DesCfb8 (); - void AndroidCryptoNative_GetECCurveParameters (); - void AndroidCryptoNative_X509StoreAddCertificate (); - void AndroidCryptoNative_SSLStreamHandshake (); - void AndroidCryptoNative_Des3Cfb64 (); - void AndroidCryptoNative_DsaSizeP (); - void AndroidCryptoNative_SSLStreamGetPeerCertificates (); - void AndroidCryptoNative_X509Encode (); - void AndroidCryptoNative_X509ExportPkcs7 (); - void AndroidCryptoNative_GetECKeyParameters (); - void AndroidCryptoNative_CipherCreatePartial (); - void AndroidCryptoNative_SSLStreamRead (); - void AndroidCryptoNative_X509DecodeCollection (); - void AndroidCryptoNative_CipherIsSupported (); - void AndroidCryptoNative_X509ChainGetCertificates (); - void AndroidCryptoNative_Aes256Cfb8 (); - void AndroidCryptoNative_CipherReset (); - void AndroidCryptoNative_DsaVerify (); - void AndroidCryptoNative_DesCbc (); - void AndroidCryptoNative_X509StoreGetPrivateKeyEntry (); - void AndroidCryptoNative_RsaDestroy (); - void AndroidCryptoNative_Aes128Cfb128 (); - void AndroidCryptoNative_CipherSetNonceLength (); - void AndroidCryptoNative_SSLStreamIsLocalCertificateUsed (); - void AndroidCryptoNative_GetDsaParameters (); - void AndroidCryptoNative_X509ChainSetCustomTrustStore (); - void AndroidCryptoNative_EcKeyCreateByKeyParameters (); - void AndroidCryptoNative_RsaPublicEncrypt (); - void AndroidCryptoNative_CipherCtxSetPadding (); - void AndroidCryptoNative_GetBigNumBytes (); - void AndroidCryptoNative_DeleteGlobalReference (); - void AndroidCryptoNative_BigNumToBinary (); - void AndroidCryptoNative_Aes128Ecb (); - void AndroidCryptoNative_Des3Ecb (); - void AndroidCryptoNative_X509StoreContainsCertificate (); - void AndroidCryptoNative_X509StoreEnumerateTrustedCertificates (); - void AndroidCryptoNative_CipherUpdate (); - void AndroidCryptoNative_CipherCreate (); - void AndroidCryptoNative_CipherSetTagLength (); - void AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry (); - void AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo (); - void AndroidCryptoNative_RsaVerificationPrimitive (); - void AndroidCryptoNative_Aes192Cfb128 (); - void AndroidCryptoNative_EcKeyGetSize (); - void AndroidCryptoNative_SSLStreamRequestClientAuthentication (); - void AndroidCryptoNative_SSLStreamInitialize (); - - void CompressionNative_Crc32 (); - void CompressionNative_Inflate (); - void CompressionNative_DeflateEnd (); - void CompressionNative_Deflate (); - void CompressionNative_InflateEnd (); - void CompressionNative_InflateInit2_ (); - void CompressionNative_DeflateInit2_ (); -} - -namespace { -#if INTPTR_MAX == INT64_MAX - std::array internal_pinvokes {{ - {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, - {0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, - {0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, - {0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, - {0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, - {0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, - {0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, - {0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, - {0x3c5532ecdab53f89, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, - {0x423c8f539a2c56d2, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, - {0x4b1956138764939a, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, - {0x4d5b5b488f736058, "path_combine", reinterpret_cast(&path_combine)}, - {0x5a2614d15e2fdc2e, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, - {0x5f0b4e426eff086b, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, - {0x709af13cbfbe2e75, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, - {0x70ae32c9a4f1ad2c, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, - {0x70fc9bab8d56666d, "create_public_directory", reinterpret_cast(&create_public_directory)}, - {0x78514771a67ad724, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, - {0x9099a4b95e3c3a89, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, - {0x958cdb6fd9d1b67b, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, - {0xa6ec846592d99536, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, - {0xa7f58f3ee428cc6b, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, - {0xae3df96dda0143bd, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, - {0xb6222d90af401865, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, - {0xb8306f71b963cd3d, "monodroid_log", reinterpret_cast(&monodroid_log)}, - {0xbc90bafd5ff9c99e, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, - {0xbe5a300beec69c35, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, - {0xbfbb924fbe190616, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, - {0xc2a21d3f6c8ccc24, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, - {0xc5b4690e13898fa3, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, - {0xcc873ea8493d1dd5, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, - {0xce439cfbe29dec11, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, - {0xd1e121b94ea63f2e, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, - {0xd5151b00eb33d85e, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, - {0xda517ef392b6a888, "java_interop_free", reinterpret_cast(&java_interop_free)}, - {0xe27b9849b7e982cb, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0xe370a0d91cd63bc0, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, - {0xe78f1161604ae672, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, - {0xe86307aac9a2631a, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, - {0xebc2c68e10075cc9, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, - {0xee83e38e479aeff1, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, - {0xf3048baf83034541, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, - {0xf41c48df6f9be476, "monodroid_free", reinterpret_cast(&monodroid_free)}, - {0xf5a918ef520db207, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, - {0xf5ed87b004005892, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, - {0xf8798f762db15bba, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, - {0xfa90326712e7e7c4, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, - {0xfdc17c4ea8335ffd, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0xff010b3140f54d3f, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, - }}; - - std::array system_native_pinvokes {{ - {0xb38afc8bfe830b, "SystemNative_Bind", nullptr}, - {0x190fe65d8736dcb, "SystemNative_TryGetIPPacketInformation", nullptr}, - {0x1c8b86562ad5772, "SystemNative_Receive", nullptr}, - {0x202543f28ecaf06, "SystemNative_Abort", nullptr}, - {0x25abeafa88904a2, "SystemNative_SetPosixSignalHandler", nullptr}, - {0x33158212a812caf, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, - {0x3511e36d0a6c1b5, "SystemNative_LockFileRegion", nullptr}, - {0x37b9dd562235e42, "SystemNative_MSync", nullptr}, - {0x3a5df4793dd3230, "SystemNative_INotifyInit", nullptr}, - {0x3d24547fa4fc31b, "SystemNative_GetUInt64OSThreadId", nullptr}, - {0x581df5b0a00c422, "SystemNative_SetRLimit", nullptr}, - {0x5b5ab451ff38f8e, "SystemNative_GetMaximumAddressSize", nullptr}, - {0x6861b5336291d12, "SystemNative_PathConf", nullptr}, - {0x6a1f4deffa02c30, "SystemNative_LowLevelMonitor_Acquire", nullptr}, - {0x7ce8a9b967dd269, "SystemNative_Read", nullptr}, - {0x8352ae4bba2b83b, "SystemNative_SetSendTimeout", nullptr}, - {0x98bd27a7461321d, "SystemNative_Dup", nullptr}, - {0xa906c14ca5834bc, "SystemNative_GetEUid", nullptr}, - {0xac9f9c1abb62a92, "SystemNative_Log", nullptr}, - {0xadb2441bcfcdfe9, "SystemNative_CreateThread", nullptr}, - {0xafbf5c69d1badc0, "SystemNative_SetTerminalInvalidationHandler", nullptr}, - {0xba897b7abe67b16, "SystemNative_FcntlSetPipeSz", nullptr}, - {0xc305c22ce7ab8a0, "SystemNative_SetSockOpt", nullptr}, - {0xc79e924361c15ca, "SystemNative_RealPath", nullptr}, - {0xef8dd67e25bac53, "SystemNative_GetWindowSize", nullptr}, - {0xfa0899cf8d00a87, "SystemNative_MkDir", nullptr}, - {0xfe7079441ac127e, "SystemNative_CreateSocketEventPort", nullptr}, - {0x10d733abd1fd94bb, "SystemNative_TryChangeSocketEventRegistration", nullptr}, - {0x114b8384553f5418, "SystemNative_GetSystemTimeAsTicks", nullptr}, - {0x119a38c3e288a233, "SystemNative_SNPrintF_1S", nullptr}, - {0x11b6f4f0aafeda95, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, - {0x11cc73f2926d4064, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, - {0x121bc483ac26f5f8, "SystemNative_GetGroupName", nullptr}, - {0x12d65f9f65b01497, "SystemNative_GetRawSockOpt", nullptr}, - {0x12eaf09505dc19fd, "SystemNative_FStat", nullptr}, - {0x13577369f5ec4b0a, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, - {0x1399413d8a7d9dd8, "SystemNative_GetAddressFamily", nullptr}, - {0x13a1c2de7fb2519f, "SystemNative_CloseSocketEventPort", nullptr}, - {0x146cd1dc4fb2ba58, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, - {0x176e22ea7c580dae, "SystemNative_ReadDirR", nullptr}, - {0x185f5d25252c3c72, "SystemNative_FAllocate", nullptr}, - {0x18d6b5e9fec9b0dc, "SystemNative_Connectx", nullptr}, - {0x18f7da5f584b5b59, "SystemNative_PReadV", nullptr}, - {0x1948a0cf88329c2f, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, - {0x1ac95b02f23933cc, "SystemNative_CanGetHiddenFlag", nullptr}, - {0x1d4dcbc06728e689, "SystemNative_Close", nullptr}, - {0x1d6d4278ffbbab77, "SystemNative_Pipe", nullptr}, - {0x1d8d6a688fc5bfb3, "SystemNative_SendFile", nullptr}, - {0x1f1c61a157636aad, "SystemNative_Stat", nullptr}, - {0x1f849e45a3014a9f, "SystemNative_GetIPv6Address", nullptr}, - {0x1f9361fc7b624c1b, "SystemNative_LowLevelMonitor_Wait", nullptr}, - {0x2291e0ba4e1b55b0, "SystemNative_LStat", nullptr}, - {0x24f840f903a26ded, "SystemNative_ConvertErrorPalToPlatform", nullptr}, - {0x24ff74e427d0626e, "SystemNative_GetErrNo", nullptr}, - {0x254905036a0061cf, "SystemNative_CreateSocketEventBuffer", nullptr}, - {0x255c4a2e297fd9f5, "SystemNative_INotifyAddWatch", nullptr}, - {0x27f3d9266af2b315, "SystemNative_GetIPv4Address", nullptr}, - {0x2925953889c48cab, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, - {0x2a49948ae20571cb, "SystemNative_SchedGetAffinity", nullptr}, - {0x2c8da1192c5d7d2b, "SystemNative_FLock", nullptr}, - {0x2d64b1ac218cf29e, "SystemNative_AlignedRealloc", nullptr}, - {0x2e429d96a9fc92bd, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, - {0x301c465c1ac0adf9, "SystemNative_MProtect", nullptr}, - {0x3319a5483b3cc1fc, "SystemNative_GetRLimit", nullptr}, - {0x3424ffcb69ecef57, "SystemNative_Unlink", nullptr}, - {0x346a9bb11364833c, "SystemNative_DrainAutoreleasePool", nullptr}, - {0x35169e67cc0f8529, "SystemNative_GetIPv6MulticastOption", nullptr}, - {0x359205b4a10fa780, "SystemNative_LowLevelMonitor_Destroy", nullptr}, - {0x36128eed665b1923, "SystemNative_ShmUnlink", nullptr}, - {0x364dcf65ae63adff, "SystemNative_GetSocketErrorOption", nullptr}, - {0x3757b327944abb54, "SystemNative_EnablePosixSignalHandling", nullptr}, - {0x38b4bd21127ceffd, "SystemNative_StrErrorR", nullptr}, - {0x38c7de719e8ae69d, "SystemNative_RmDir", nullptr}, - {0x391bbbb9bbde4455, "SystemNative_SetIPv4MulticastOption", nullptr}, - {0x3a7245f3ea476bf7, "SystemNative_SNPrintF", nullptr}, - {0x3ae92e4198427b0d, "SystemNative_ReadLink", nullptr}, - {0x3e0de839e6cfa6e5, "SystemNative_Accept", nullptr}, - {0x3e7cf9a4789a31c7, "SystemNative_FChflags", nullptr}, - {0x3f49b6278f04ae84, "SystemNative_Disconnect", nullptr}, - {0x3fba15600bf0f229, "SystemNative_SetEUid", nullptr}, - {0x41c1f2c9153639af, "SystemNative_FUTimens", nullptr}, - {0x42339dd2717504d9, "SystemNative_GetLingerOption", nullptr}, - {0x42783107bf2935ec, "SystemNative_FreeHostEntry", nullptr}, - {0x42eb0578a9d62b78, "SystemNative_GetFormatInfoForMountPoint", nullptr}, - {0x44ccb27979f980ce, "SystemNative_AlignedAlloc", nullptr}, - {0x44f1a5c46033eec2, "SystemNative_SysLog", nullptr}, - {0x483b434d7b089c7e, "SystemNative_Write", nullptr}, - {0x484a3a445bdb14fc, "SystemNative_GetOSArchitecture", nullptr}, - {0x4909639a9d87bdb5, "SystemNative_AlignedFree", nullptr}, - {0x49e3ba95feb79c6c, "SystemNative_SetAddressFamily", nullptr}, - {0x4b00795bbeea6f60, "SystemNative_SetIPv6Address", nullptr}, - {0x4be7ceca50f3298c, "SystemNative_LowLevelMonitor_Create", nullptr}, - {0x4bec4a1d7dfd4cf7, "SystemNative_GetUnixRelease", nullptr}, - {0x4bfff22801b209ca, "SystemNative_LChflags", nullptr}, - {0x4c22cc4f2b1dab26, "SystemNative_SetPriority", nullptr}, - {0x509ff12da4e77259, "SystemNative_GetSocketAddressSizes", nullptr}, - {0x523240c01d14ad50, "SystemNative_GetPeerID", nullptr}, - {0x52794f1118d32f08, "SystemNative_GetUnixVersion", nullptr}, - {0x5381564d2c06c0a3, "SystemNative_SysConf", nullptr}, - {0x556bc89d2d4dfc85, "SystemNative_GetDeviceIdentifiers", nullptr}, - {0x5592a052ceb4caf6, "SystemNative_GetProcessPath", nullptr}, - {0x55fe2620f63d83d8, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, - {0x574d77a68ec3e488, "SystemNative_GetEnv", nullptr}, - {0x583db0344a1cd715, "SystemNative_GetActiveUdpListeners", nullptr}, - {0x5908581fe73717f0, "SystemNative_InterfaceNameToIndex", nullptr}, - {0x5a305cf2a314d6a6, "SystemNative_FTruncate", nullptr}, - {0x5e53b688fede3216, "SystemNative_GetControlCharacters", nullptr}, - {0x5fa62856bdbba9c0, "SystemNative_GetPort", nullptr}, - {0x600b4418896f7808, "SystemNative_Exit", nullptr}, - {0x6089f0c8112eb3d9, "SystemNative_InitializeConsoleBeforeRead", nullptr}, - {0x613307e537d462db, "SystemNative_GetReadDirRBufferSize", nullptr}, - {0x61bacd7170fd8c9b, "SystemNative_SchedSetAffinity", nullptr}, - {0x61f3ce1b18b20d6f, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, - {0x62351df42d842942, "SystemNative_GetSignalForBreak", nullptr}, - {0x6393d30aceaa6df2, "SystemNative_PWriteV", nullptr}, - {0x6448f0806bd3a338, "SystemNative_FreeEnviron", nullptr}, - {0x650eddee76c6b8da, "SystemNative_GetHostName", nullptr}, - {0x652badfba5d61929, "SystemNative_FcntlSetFD", nullptr}, - {0x67d2cd86792b1d0c, "SystemNative_Realloc", nullptr}, - {0x67e9d60481f4be06, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, - {0x68df81a8fb5bf442, "SystemNative_GetSockOpt", nullptr}, - {0x68f3fe6083c0355b, "SystemNative_GetLoadLibraryError", nullptr}, - {0x69ad99fac0467f64, "SystemNative_Link", nullptr}, - {0x6b9097385aa77917, "SystemNative_FSync", nullptr}, - {0x6b9bce16ba8e845f, "SystemNative_Malloc", nullptr}, - {0x6bc18fbbbf267e2a, "SystemNative_ReceiveSocketError", nullptr}, - {0x6e2c1caff08e6e2d, "SystemNative_ReadStdin", nullptr}, - {0x6ee05d5e8650e56c, "SystemNative_DisablePosixSignalHandling", nullptr}, - {0x729afe37cdb8ae8f, "SystemNative_Connect", nullptr}, - {0x730ae9a7469a7321, "SystemNative_GetAllMountPoints", nullptr}, - {0x742da00b2dbf435d, "SystemNative_LoadLibrary", nullptr}, - {0x7559feb379d38da5, "SystemNative_GetTimeZoneData", nullptr}, - {0x7d7ee4bce74d4de9, "SystemNative_GetDomainSocketSizes", nullptr}, - {0x7e1766c6df3ad261, "SystemNative_MUnmap", nullptr}, - {0x7e4bdf46d4ff9f11, "SystemNative_MkNod", nullptr}, - {0x7ec328b6ba9eab8a, "SystemNative_WaitForSocketEvents", nullptr}, - {0x84c8a7489b37fea0, "SystemNative_GetPlatformSignalNumber", nullptr}, - {0x8502eeba98158e79, "SystemNative_FcntlSetIsNonBlocking", nullptr}, - {0x8530d37777969db6, "SystemNative_SetKeypadXmit", nullptr}, - {0x85d0033bc38bb4bb, "SystemNative_MAdvise", nullptr}, - {0x889350f209555ecb, "SystemNative_MkdTemp", nullptr}, - {0x88a08b60b80c70cc, "SystemNative_FChMod", nullptr}, - {0x8bcabce135063bed, "SystemNative_OpenDir", nullptr}, - {0x8df448aee6e8fa5e, "SystemNative_WaitPidExitedNoHang", nullptr}, - {0x8e96cb02418947cc, "SystemNative_FcntlGetPipeSz", nullptr}, - {0x8fb6ed14ee0256bc, "SystemNative_GetTimestamp", nullptr}, - {0x8ffe2d950d138c01, "SystemNative_SchedGetCpu", nullptr}, - {0x93a8bec488055608, "SystemNative_GetPwNamR", nullptr}, - {0x95a4cb8563cc6b14, "SystemNative_ShmOpen", nullptr}, - {0x9856fa59ed936b73, "SystemNative_GetSid", nullptr}, - {0x996ada1c038aabba, "SystemNative_MksTemps", nullptr}, - {0x99a840c495204202, "SystemNative_GetBytesAvailable", nullptr}, - {0x9aa9eaee3dd8b23b, "SystemNative_GetIPv4MulticastOption", nullptr}, - {0x9aaaad33b28af82f, "SystemNative_SetSignalForBreak", nullptr}, - {0x9c3e8b890033819a, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, - {0x9c832cd7fcbf2de0, "SystemNative_MkFifo", nullptr}, - {0x9d2cb31282abd3d9, "SystemNative_GetNetworkInterfaces", nullptr}, - {0x9e25ebf4f61cc299, "SystemNative_ChDir", nullptr}, - {0x9fb01da1222e905a, "SystemNative_IsATty", nullptr}, - {0xa1e881a63614507e, "SystemNative_INotifyRemoveWatch", nullptr}, - {0xa2254fea4d8b6909, "SystemNative_MMap", nullptr}, - {0xa2d7790a850024c0, "SystemNative_GetNumRoutes", nullptr}, - {0xa302613a430248b8, "SystemNative_GetGroups", nullptr}, - {0xa56532a23755cd87, "SystemNative_StdinReady", nullptr}, - {0xa89ec9958d999483, "SystemNative_GetCwd", nullptr}, - {0xa8bdc3e7ee898dfc, "SystemNative_Shutdown", nullptr}, - {0xabdcf2f74d210f35, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, - {0xac11eab9d9c31b01, "SystemNative_UTimensat", nullptr}, - {0xac7725c652a5fb5b, "SystemNative_CopyFile", nullptr}, - {0xad228cdc4edb11d6, "SystemNative_CloseDir", nullptr}, - {0xadc6889903a2d6f4, "SystemNative_Rename", nullptr}, - {0xae320903718eb45d, "SystemNative_MapTcpState", nullptr}, - {0xaf9706efc72c3904, "SystemNative_SetIPv6MulticastOption", nullptr}, - {0xafd9f6338cdbadd4, "SystemNative_GetHostEntryForName", nullptr}, - {0xb0b66a7145de350d, "SystemNative_Access", nullptr}, - {0xb0e18377ed603e0b, "SystemNative_GetGroupList", nullptr}, - {0xb361006446f560e8, "SystemNative_LogError", nullptr}, - {0xb600c44028c1743d, "SystemNative_Socket", nullptr}, - {0xb632e9bc6f7be0a9, "SystemNative_GetSockName", nullptr}, - {0xb6540b73eff28747, "SystemNative_SetRawSockOpt", nullptr}, - {0xb6ab9abf7887911f, "SystemNative_ReadEvents", nullptr}, - {0xb73c597de01bc0b2, "SystemNative_GetPwUidR", nullptr}, - {0xb78af5975603cd20, "SystemNative_Sync", nullptr}, - {0xb7bbbe2c16a565c6, "SystemNative_Calloc", nullptr}, - {0xbb3343826d504870, "SystemNative_GetBootTimeTicks", nullptr}, - {0xbb5e970ecb6745da, "SystemNative_SymLink", nullptr}, - {0xbbd20cce92ec2c12, "SystemNative_FcntlGetFD", nullptr}, - {0xbcd9e53d2d288094, "SystemNative_GetNameInfo", nullptr}, - {0xbd89ef4df5486744, "SystemNative_Send", nullptr}, - {0xbdd3128e77381b01, "SystemNative_EnumerateInterfaceAddresses", nullptr}, - {0xc00ebc097b776c1f, "SystemNative_GetPriority", nullptr}, - {0xc036b23d88fad91b, "SystemNative_iOSSupportVersion", nullptr}, - {0xc1c679eefc134d31, "SystemNative_LowLevelMonitor_Release", nullptr}, - {0xc3c10021b10ba455, "SystemNative_GetEGid", nullptr}, - {0xc3fe9394fe1f3f02, "SystemNative_GetSocketType", nullptr}, - {0xc560d9947ab2a34d, "SystemNative_RegisterForSigChld", nullptr}, - {0xc5bed971846027de, "SystemNative_GetCpuUtilization", nullptr}, - {0xc69433678dd341ca, "SystemNative_ForkAndExecProcess", nullptr}, - {0xc7ae1b8d93af5d73, "SystemNative_ChMod", nullptr}, - {0xc7d536c0e7eb3fe2, "SystemNative_FreeSocketEventBuffer", nullptr}, - {0xc87a5ee4869035c6, "SystemNative_UninitializeConsoleAfterRead", nullptr}, - {0xc93df58ae5457bfd, "SystemNative_GetControlMessageBufferSize", nullptr}, - {0xc956e528f995739c, "SystemNative_ReceiveMessage", nullptr}, - {0xcaae6d345ba32c7b, "SystemNative_Kill", nullptr}, - {0xcaec08aa13779f7f, "SystemNative_GetEnviron", nullptr}, - {0xcaf599a20538b10b, "SystemNative_SetWindowSize", nullptr}, - {0xcbbb90469d28cded, "SystemNative_SearchPath", nullptr}, - {0xcc43d880192dd6ff, "SystemNative_ConvertErrorPlatformToPal", nullptr}, - {0xcc788c0474c3e178, "SystemNative_LSeek", nullptr}, - {0xcdcb014df9a6eae2, "SystemNative_SetPort", nullptr}, - {0xce36e2e1a139a020, "SystemNative_GetDefaultTimeZone", nullptr}, - {0xce6ddfe40fed99d9, "SystemNative_PRead", nullptr}, - {0xd392d6ed5dcc111c, "SystemNative_GetDomainName", nullptr}, - {0xd55437b16dc84f3b, "SystemNative_GetIPv4GlobalStatistics", nullptr}, - {0xd88be8f9e9f28e90, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, - {0xd8976692c4c68818, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, - {0xda05c57c78aa6706, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, - {0xda38bffa1d16cdd6, "SystemNative_SetLingerOption", nullptr}, - {0xda6b3192974ca60e, "SystemNative_Open", nullptr}, - {0xdab5eb45815daabc, "SystemNative_GetAtOutOfBandMark", nullptr}, - {0xdae32aac0c0d305c, "SystemNative_ReadProcessStatusInfo", nullptr}, - {0xdbee22594fa8c585, "SystemNative_CreateAutoreleasePool", nullptr}, - {0xdf650444c8af0763, "SystemNative_FcntlGetIsNonBlocking", nullptr}, - {0xe0a170d2b947a8fc, "SystemNative_SendMessage", nullptr}, - {0xe0a601fd89d9b279, "SystemNative_SetErrNo", nullptr}, - {0xe1930d112ce74c9e, "SystemNative_TryGetUInt32OSThreadId", nullptr}, - {0xe20c29fb8b19da7b, "SystemNative_Listen", nullptr}, - {0xe36a157177b2db08, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, - {0xe44f737a5bebdd90, "SystemNative_SetIPv4Address", nullptr}, - {0xe582a4a60bb74c35, "SystemNative_GetProcAddress", nullptr}, - {0xe6838f2add787bfe, "SystemNative_FreeLibrary", nullptr}, - {0xe73aeaf9e3a10343, "SystemNative_PWrite", nullptr}, - {0xe78ff100d1d73d99, "SystemNative_SetReceiveTimeout", nullptr}, - {0xe853ecfe4d402ed0, "SystemNative_Poll", nullptr}, - {0xeaafb7963ceb9bf4, "SystemNative_GetTcpGlobalStatistics", nullptr}, - {0xec67e4076662c2de, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, - {0xef71ee101b3ece96, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, - {0xf0045895a9043221, "SystemNative_SearchPath_TempDirectory", nullptr}, - {0xf0658a22dd5ede19, "SystemNative_SNPrintF_1I", nullptr}, - {0xf0ec052da6c5fa70, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, - {0xf2c7fa39bf166188, "SystemNative_Free", nullptr}, - {0xf38b47e43f352491, "SystemNative_GetUdpGlobalStatistics", nullptr}, - {0xf6ede5d5d8729315, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, - {0xf870179a8d8d1872, "SystemNative_PosixFAdvise", nullptr}, - {0xf8c983dd21ef9fe6, "SystemNative_GetPid", nullptr}, - {0xfa26b86cedf66721, "SystemNative_Sysctl", nullptr}, - {0xfb3e394cc613f202, "SystemNative_GetPeerName", nullptr}, - {0xfbb57319454b1074, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, - {0xff28b3bec4f32a2c, "SystemNative_GetFileSystemType", nullptr}, - }}; - - std::array system_globalization_pinvokes {{ - {0x410f8526b1edfc3, "GlobalizationNative_GetLocaleInfoInt", nullptr}, - {0xe7e93cf9237e1f2, "GlobalizationNative_ToAscii", nullptr}, - {0x18580a4592ed1ea6, "GlobalizationNative_GetSortKey", nullptr}, - {0x1f72f52873ced9c9, "GlobalizationNative_InitOrdinalCasingPage", nullptr}, - {0x2178ba302d0c5f1c, "GlobalizationNative_GetCalendars", nullptr}, - {0x32e594690358a960, "GlobalizationNative_GetLocaleInfoString", nullptr}, - {0x40d61d78487edb08, "GlobalizationNative_GetICUVersion", nullptr}, - {0x4360eb8a25122eee, "GlobalizationNative_StartsWith", nullptr}, - {0x4bd4b1c0803c8c55, "GlobalizationNative_GetLocaleName", nullptr}, - {0x4f22643b9509cc12, "GlobalizationNative_IsNormalized", nullptr}, - {0x507983f11ffec7a8, "GlobalizationNative_GetTimeZoneDisplayName", nullptr}, - {0x56e982948d00f10d, "GlobalizationNative_IndexOf", nullptr}, - {0x635327a9b09a910d, "GlobalizationNative_NormalizeString", nullptr}, - {0x6ac3aeecfc75bfad, "GlobalizationNative_GetSortVersion", nullptr}, - {0x77ca6a148e5a51d9, "GlobalizationNative_IanaIdToWindowsId", nullptr}, - {0x7a4d912694906c9c, "GlobalizationNative_ToUnicode", nullptr}, - {0x7e5fa2f70891c7fe, "GlobalizationNative_ChangeCaseTurkish", nullptr}, - {0xa193402ff5140ac1, "GlobalizationNative_GetCalendarInfo", nullptr}, - {0xa831a683f743e417, "GlobalizationNative_WindowsIdToIanaId", nullptr}, - {0xac5c6a70d140a4bf, "GlobalizationNative_GetLocaleTimeFormat", nullptr}, - {0xb81236cd1fe85cc9, "GlobalizationNative_GetLatestJapaneseEra", nullptr}, - {0xb95350c7ec77bc72, "GlobalizationNative_ChangeCase", nullptr}, - {0xc287daf58054a21d, "GlobalizationNative_EndsWith", nullptr}, - {0xc8b772178f955d87, "GlobalizationNative_GetSortHandle", nullptr}, - {0xd0899515dfe85287, "GlobalizationNative_LoadICU", nullptr}, - {0xd185dfe303ab91dd, "GlobalizationNative_CompareString", nullptr}, - {0xd5264d57a926edfb, "GlobalizationNative_InitICUFunctions", nullptr}, - {0xd995e71361e6ed2e, "GlobalizationNative_IsPredefinedLocale", nullptr}, - {0xe072da8f2d921f53, "GlobalizationNative_GetDefaultLocaleName", nullptr}, - {0xea21aa1f2b2a671c, "GlobalizationNative_LastIndexOf", nullptr}, - {0xee4dd111dc8d98f3, "GlobalizationNative_GetJapaneseEraStartDate", nullptr}, - {0xf2d074e0aeca51ce, "GlobalizationNative_GetLocales", nullptr}, - {0xf3693f3cadb9b6f4, "GlobalizationNative_EnumCalendarInfo", nullptr}, - {0xf63fa2bfce5c4f80, "GlobalizationNative_GetLocaleInfoGroupingSizes", nullptr}, - {0xfa21f0a127c9dce9, "GlobalizationNative_ChangeCaseInvariant", nullptr}, - {0xfacf02f439426705, "GlobalizationNative_CloseSortHandle", nullptr}, - }}; - - std::array system_crypto_android_pinvokes {{ - {0x375a0e90c77ca35, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, - {0x47302bd7e277183, "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", nullptr}, - {0x598db66ca39c41f, "AndroidCryptoNative_EcKeyUpRef", nullptr}, - {0x656cac62ccc9e3c, "AndroidCryptoNative_X509GetContentType", nullptr}, - {0x690c4347972024f, "AndroidCryptoNative_Aes256Gcm", nullptr}, - {0x7b5579ab0499b1f, "AndroidCryptoNative_RsaSize", nullptr}, - {0xcaba893801c6a6f, "AndroidCryptoNative_Aes256Ecb", nullptr}, - {0xcbe6d3d22131194, "AndroidCryptoNative_SetRsaParameters", nullptr}, - {0x1027786cdd9a3e9c, "AndroidCryptoNative_Aes192Cbc", nullptr}, - {0x1d1bb0528d517729, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, - {0x1e6228e955989698, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, - {0x1f45ac9d3c6b1554, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, - {0x1f7d2360a1cdcbff, "AndroidCryptoNative_SSLStreamCreate", nullptr}, - {0x218fce505a140c55, "AndroidCryptoNative_EcDsaVerify", nullptr}, - {0x23ac2a4c4d1c744e, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, - {0x267c94097a3bf1f3, "AndroidCryptoNative_CipherDestroy", nullptr}, - {0x2b45d7cdf6e8e0c7, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, - {0x2c7e5e179cc917cb, "AndroidCryptoNative_DsaSizeSignature", nullptr}, - {0x2fdcf708ff792105, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, - {0x31027564deeb71b0, "AndroidCryptoNative_Aes128Cbc", nullptr}, - {0x3f19a16a3230b551, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, - {0x401935ffc3454bb1, "AndroidCryptoNative_X509PublicKey", nullptr}, - {0x40bfa1211f5f6f9c, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, - {0x41b6e7f32da99fa9, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, - {0x41c169fb0e30a390, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, - {0x420718c398131a55, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, - {0x43741165a5ba60d5, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, - {0x4845e1c76265acc9, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, - {0x4a7272ac9d117f2d, "AndroidCryptoNative_EcKeyDestroy", nullptr}, - {0x4d6361e5095cff36, "AndroidCryptoNative_DsaSign", nullptr}, - {0x4d74053b37e582fa, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, - {0x501daf7e3a890220, "AndroidCryptoNative_X509ChainBuild", nullptr}, - {0x52fc107ebdb6fcc7, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, - {0x5fd29ac523ff6e3d, "AndroidCryptoNative_SSLStreamRelease", nullptr}, - {0x5ffae3c8023a80b8, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, - {0x648a9b317bc64fe0, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, - {0x66e049fe27bf91ea, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, - {0x67a8868ef592a3fd, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, - {0x67a9b5bbce322f8c, "AndroidCryptoNative_Des3Cbc", nullptr}, - {0x6a59d9242cd31785, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, - {0x6dbd90e9cc86310b, "AndroidCryptoNative_CipherFinalEx", nullptr}, - {0x6dfd40c2dd0d7382, "AndroidCryptoNative_RsaUpRef", nullptr}, - {0x6f990f1f7bc80630, "AndroidCryptoNative_RsaCreate", nullptr}, - {0x70f907b97d3fe059, "AndroidCryptoNative_Aes192Ccm", nullptr}, - {0x7150f0eb40797bb3, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, - {0x7356b141407d261e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, - {0x74ec4a8d869776ad, "AndroidCryptoNative_Aes128Ccm", nullptr}, - {0x758dfbf057da0da0, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, - {0x7975d1d7029cf1a3, "AndroidCryptoNative_Aes128Gcm", nullptr}, - {0x79f5c24afbd04af1, "AndroidCryptoNative_Aes256Cbc", nullptr}, - {0x7a37e0d077f2dfe5, "AndroidCryptoNative_DsaGenerateKey", nullptr}, - {0x7d5273ad530e7298, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, - {0x7fa96d0284954375, "AndroidCryptoNative_X509Decode", nullptr}, - {0x813bedf08c3388d4, "AndroidCryptoNative_Aes128Cfb8", nullptr}, - {0x84cc0301870c37ce, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, - {0x868e09dc7dfea364, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, - {0x870191ad244b8069, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, - {0x87019b7831c0c34c, "AndroidCryptoNative_Aes192Gcm", nullptr}, - {0x87c447e7f873cff0, "AndroidCryptoNative_X509ChainValidate", nullptr}, - {0x9039632237d70ae7, "AndroidCryptoNative_NewGlobalReference", nullptr}, - {0x9161ade1206fd86e, "AndroidCryptoNative_Aes256Cfb128", nullptr}, - {0x9167a072639a7c95, "AndroidCryptoNative_Aes256Ccm", nullptr}, - {0x91f065ec0d3aec55, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, - {0x95a0e2fc5c0cb49e, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, - {0x9991a277809ef205, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, - {0x9aab07f824659d3e, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, - {0x9e79166979634030, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, - {0x9edddf30d660eff4, "AndroidCryptoNative_Aes192Ecb", nullptr}, - {0xa308025a784497df, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, - {0xa56954e28eb9a9c9, "AndroidCryptoNative_Des3Cfb8", nullptr}, - {0xa5eda72b95fe78c3, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, - {0xa93eb533acf7564d, "AndroidCryptoNative_DesEcb", nullptr}, - {0xa961e8db31830e16, "AndroidCryptoNative_Aes192Cfb8", nullptr}, - {0xaa8f0f87ae474ffe, "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", nullptr}, - {0xad1a2d6575cdd4e3, "AndroidCryptoNative_SSLStreamWrite", nullptr}, - {0xae82e9ceae24192d, "AndroidCryptoNative_Pbkdf2", nullptr}, - {0xb0df46ff09c57741, "AndroidCryptoNative_GetRsaParameters", nullptr}, - {0xb1c394b9992bd67d, "AndroidCryptoNative_EcDsaSign", nullptr}, - {0xb1ff12f3bd735982, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, - {0xb4996dd1aba38200, "AndroidCryptoNative_EcDsaSize", nullptr}, - {0xb575ec01a7a79f8f, "AndroidCryptoNative_DesCfb8", nullptr}, - {0xb66be1550d27bfb4, "AndroidCryptoNative_GetECCurveParameters", nullptr}, - {0xbd5a0be2f7904089, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, - {0xbdbbd2898347c0d1, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, - {0xc11cd661db8be230, "AndroidCryptoNative_Des3Cfb64", nullptr}, - {0xc2d5e1c465b2f5b6, "AndroidCryptoNative_DsaSizeP", nullptr}, - {0xc3145e336c38379b, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, - {0xc7815e0476511544, "AndroidCryptoNative_X509Encode", nullptr}, - {0xc8a52a8b6d96b32b, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, - {0xca48c3927c202794, "AndroidCryptoNative_GetECKeyParameters", nullptr}, - {0xcb4bcdafdc81d116, "AndroidCryptoNative_CipherCreatePartial", nullptr}, - {0xcc433093c073719e, "AndroidCryptoNative_SSLStreamRead", nullptr}, - {0xce9f8a6ac705faa5, "AndroidCryptoNative_X509DecodeCollection", nullptr}, - {0xd5c063a90ae882c1, "AndroidCryptoNative_CipherIsSupported", nullptr}, - {0xd7d818c7640598dc, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, - {0xd7f1a8f616897ace, "AndroidCryptoNative_Aes256Cfb8", nullptr}, - {0xd9bd0b370726ce34, "AndroidCryptoNative_CipherReset", nullptr}, - {0xda4898a26933f73d, "AndroidCryptoNative_DsaVerify", nullptr}, - {0xdbb4752ed23670f0, "AndroidCryptoNative_DesCbc", nullptr}, - {0xdc780005b0d39711, "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", nullptr}, - {0xdd4c03f06ce96e04, "AndroidCryptoNative_RsaDestroy", nullptr}, - {0xdde06993f87d6ffc, "AndroidCryptoNative_Aes128Cfb128", nullptr}, - {0xde1e22dd097f799c, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, - {0xde259001bf54e6f1, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, - {0xdec5c7544d2c8cb1, "AndroidCryptoNative_GetDsaParameters", nullptr}, - {0xdfede2defd776f7e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, - {0xe059239741e0011a, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, - {0xe0f34ce89fd38aef, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, - {0xe604fca300068c0c, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, - {0xeab45239fb3f138d, "AndroidCryptoNative_GetBigNumBytes", nullptr}, - {0xeff5d014640ae969, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, - {0xf1577384f409ea85, "AndroidCryptoNative_BigNumToBinary", nullptr}, - {0xf4dea312f71c5ff2, "AndroidCryptoNative_Aes128Ecb", nullptr}, - {0xf57f81262f07542c, "AndroidCryptoNative_Des3Ecb", nullptr}, - {0xf7b334768844b502, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, - {0xf85b8ffeba9b06c1, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, - {0xf96bc1e7e15e69f2, "AndroidCryptoNative_CipherUpdate", nullptr}, - {0xf970881d4fa83e07, "AndroidCryptoNative_CipherCreate", nullptr}, - {0xf9c3d216226b3355, "AndroidCryptoNative_CipherSetTagLength", nullptr}, - {0xfa2669c25616a8ff, "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", nullptr}, - {0xfaa7766eaa2c54a5, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, - {0xfc0bad2b1528000f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, - {0xfcdeea476953780c, "AndroidCryptoNative_Aes192Cfb128", nullptr}, - {0xfd2cdd99f11de76c, "AndroidCryptoNative_EcKeyGetSize", nullptr}, - {0xfd4f2784ec1c98aa, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, - {0xfe3dd06281f7cd1f, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, - }}; - - std::array system_io_compression_pinvokes {{ - {0x99f2ee02463000, "CompressionNative_Crc32", nullptr}, - {0x403e1bc0b3baba84, "CompressionNative_Inflate", nullptr}, - {0xafe3d21bbaa71464, "CompressionNative_DeflateEnd", nullptr}, - {0xc10e411c989a9314, "CompressionNative_Deflate", nullptr}, - {0xca001af79c0d7a8b, "CompressionNative_InflateEnd", nullptr}, - {0xcd5d8a63493f5e38, "CompressionNative_InflateInit2_", nullptr}, - {0xea5e6653389b924a, "CompressionNative_DeflateInit2_", nullptr}, - }}; - - template [[gnu::noinline, gnu::flatten]] - PinvokeEntry* find_pinvoke_binary_search (std::array data, hash_t hash) - { - auto equal = [](PinvokeEntry const& entry, hash_t key) -> bool { return entry.hash == key; }; - auto less_than = [](PinvokeEntry const& entry, hash_t key) -> bool { return entry.hash < key; }; - ssize_t idx = Search::binary_search (hash, data.data (), NEntries); - if (idx >= 0) { - return &data[idx]; - } - - return nullptr; - } -#endif - // - // These functions will eventually reside in the generated portion of code - // - void* find_system_native_entry (hash_t entrypoint_hash) - { -// log_debug (LOG_ASSEMBLY, "Looking up System.Native p/invoke"); -#if INTPTR_MAX == INT64_MAX - switch (entrypoint_hash) { - case 0x38afc8bfe830b: return reinterpret_cast(&SystemNative_Bind ); - case 0x190fe65d8736dcb: return reinterpret_cast(&SystemNative_TryGetIPPacketInformation ); - case 0x1c8b86562ad5772: return reinterpret_cast(&SystemNative_Receive ); - case 0x202543f28ecaf06: return reinterpret_cast(&SystemNative_Abort ); - case 0x25abeafa88904a2: return reinterpret_cast(&SystemNative_SetPosixSignalHandler ); - case 0x33158212a812caf: return reinterpret_cast(&SystemNative_GetEstimatedTcpConnectionCount ); - case 0x3511e36d0a6c1b5: return reinterpret_cast(&SystemNative_LockFileRegion ); - case 0x37b9dd562235e42: return reinterpret_cast(&SystemNative_MSync ); - case 0x3a5df4793dd3230: return reinterpret_cast(&SystemNative_INotifyInit ); - case 0x3d24547fa4fc31b: return reinterpret_cast(&SystemNative_GetUInt64OSThreadId ); - case 0x581df5b0a00c422: return reinterpret_cast(&SystemNative_SetRLimit ); - case 0x5b5ab451ff38f8e: return reinterpret_cast(&SystemNative_GetMaximumAddressSize ); - case 0x6861b5336291d12: return reinterpret_cast(&SystemNative_PathConf ); - case 0x6a1f4deffa02c30: return reinterpret_cast(&SystemNative_LowLevelMonitor_Acquire ); - case 0x7ce8a9b967dd269: return reinterpret_cast(&SystemNative_Read ); - case 0x8352ae4bba2b83b: return reinterpret_cast(&SystemNative_SetSendTimeout ); - case 0x98bd27a7461321d: return reinterpret_cast(&SystemNative_Dup ); - case 0xa906c14ca5834bc: return reinterpret_cast(&SystemNative_GetEUid ); - case 0xac9f9c1abb62a92: return reinterpret_cast(&SystemNative_Log ); - case 0xadb2441bcfcdfe9: return reinterpret_cast(&SystemNative_CreateThread ); - case 0xafbf5c69d1badc0: return reinterpret_cast(&SystemNative_SetTerminalInvalidationHandler ); - case 0xba897b7abe67b16: return reinterpret_cast(&SystemNative_FcntlSetPipeSz ); - case 0xc305c22ce7ab8a0: return reinterpret_cast(&SystemNative_SetSockOpt ); - case 0xc79e924361c15ca: return reinterpret_cast(&SystemNative_RealPath ); - case 0xef8dd67e25bac53: return reinterpret_cast(&SystemNative_GetWindowSize ); - case 0xfa0899cf8d00a87: return reinterpret_cast(&SystemNative_MkDir ); - case 0xfe7079441ac127e: return reinterpret_cast(&SystemNative_CreateSocketEventPort ); - case 0x10d733abd1fd94bb: return reinterpret_cast(&SystemNative_TryChangeSocketEventRegistration ); - case 0x114b8384553f5418: return reinterpret_cast(&SystemNative_GetSystemTimeAsTicks ); - case 0x119a38c3e288a233: return reinterpret_cast(&SystemNative_SNPrintF_1S ); - case 0x11b6f4f0aafeda95: return reinterpret_cast(&SystemNative_LowLevelMonitor_TimedWait ); - case 0x11cc73f2926d4064: return reinterpret_cast(&SystemNative_ConfigureTerminalForChildProcess ); - case 0x121bc483ac26f5f8: return reinterpret_cast(&SystemNative_GetGroupName ); - case 0x12d65f9f65b01497: return reinterpret_cast(&SystemNative_GetRawSockOpt ); - case 0x12eaf09505dc19fd: return reinterpret_cast(&SystemNative_FStat ); - case 0x13577369f5ec4b0a: return reinterpret_cast(&SystemNative_GetActiveTcpConnectionInfos ); - case 0x1399413d8a7d9dd8: return reinterpret_cast(&SystemNative_GetAddressFamily ); - case 0x13a1c2de7fb2519f: return reinterpret_cast(&SystemNative_CloseSocketEventPort ); - case 0x146cd1dc4fb2ba58: return reinterpret_cast(&SystemNative_LChflagsCanSetHiddenFlag ); - case 0x176e22ea7c580dae: return reinterpret_cast(&SystemNative_ReadDirR ); - case 0x185f5d25252c3c72: return reinterpret_cast(&SystemNative_FAllocate ); - case 0x18d6b5e9fec9b0dc: return reinterpret_cast(&SystemNative_Connectx ); - case 0x18f7da5f584b5b59: return reinterpret_cast(&SystemNative_PReadV ); - case 0x1948a0cf88329c2f: return reinterpret_cast(&SystemNative_HandleNonCanceledPosixSignal ); - case 0x1ac95b02f23933cc: return reinterpret_cast(&SystemNative_CanGetHiddenFlag ); - case 0x1d4dcbc06728e689: return reinterpret_cast(&SystemNative_Close ); - case 0x1d6d4278ffbbab77: return reinterpret_cast(&SystemNative_Pipe ); - case 0x1d8d6a688fc5bfb3: return reinterpret_cast(&SystemNative_SendFile ); - case 0x1f1c61a157636aad: return reinterpret_cast(&SystemNative_Stat ); - case 0x1f849e45a3014a9f: return reinterpret_cast(&SystemNative_GetIPv6Address ); - case 0x1f9361fc7b624c1b: return reinterpret_cast(&SystemNative_LowLevelMonitor_Wait ); - case 0x2291e0ba4e1b55b0: return reinterpret_cast(&SystemNative_LStat ); - case 0x24f840f903a26ded: return reinterpret_cast(&SystemNative_ConvertErrorPalToPlatform ); - case 0x24ff74e427d0626e: return reinterpret_cast(&SystemNative_GetErrNo ); - case 0x254905036a0061cf: return reinterpret_cast(&SystemNative_CreateSocketEventBuffer ); - case 0x255c4a2e297fd9f5: return reinterpret_cast(&SystemNative_INotifyAddWatch ); - case 0x27f3d9266af2b315: return reinterpret_cast(&SystemNative_GetIPv4Address ); - case 0x2925953889c48cab: return reinterpret_cast(&SystemNative_CreateNetworkChangeListenerSocket ); - case 0x2a49948ae20571cb: return reinterpret_cast(&SystemNative_SchedGetAffinity ); - case 0x2c8da1192c5d7d2b: return reinterpret_cast(&SystemNative_FLock ); - case 0x2d64b1ac218cf29e: return reinterpret_cast(&SystemNative_AlignedRealloc ); - case 0x2e429d96a9fc92bd: return reinterpret_cast(&SystemNative_InitializeTerminalAndSignalHandling ); - case 0x301c465c1ac0adf9: return reinterpret_cast(&SystemNative_MProtect ); - case 0x3319a5483b3cc1fc: return reinterpret_cast(&SystemNative_GetRLimit ); - case 0x3424ffcb69ecef57: return reinterpret_cast(&SystemNative_Unlink ); - case 0x346a9bb11364833c: return reinterpret_cast(&SystemNative_DrainAutoreleasePool ); - case 0x35169e67cc0f8529: return reinterpret_cast(&SystemNative_GetIPv6MulticastOption ); - case 0x359205b4a10fa780: return reinterpret_cast(&SystemNative_LowLevelMonitor_Destroy ); - case 0x36128eed665b1923: return reinterpret_cast(&SystemNative_ShmUnlink ); - case 0x364dcf65ae63adff: return reinterpret_cast(&SystemNative_GetSocketErrorOption ); - case 0x3757b327944abb54: return reinterpret_cast(&SystemNative_EnablePosixSignalHandling ); - case 0x38b4bd21127ceffd: return reinterpret_cast(&SystemNative_StrErrorR ); - case 0x38c7de719e8ae69d: return reinterpret_cast(&SystemNative_RmDir ); - case 0x391bbbb9bbde4455: return reinterpret_cast(&SystemNative_SetIPv4MulticastOption ); - case 0x3a7245f3ea476bf7: return reinterpret_cast(&SystemNative_SNPrintF ); - case 0x3ae92e4198427b0d: return reinterpret_cast(&SystemNative_ReadLink ); - case 0x3e0de839e6cfa6e5: return reinterpret_cast(&SystemNative_Accept ); - case 0x3e7cf9a4789a31c7: return reinterpret_cast(&SystemNative_FChflags ); - case 0x3f49b6278f04ae84: return reinterpret_cast(&SystemNative_Disconnect ); - case 0x3fba15600bf0f229: return reinterpret_cast(&SystemNative_SetEUid ); - case 0x41c1f2c9153639af: return reinterpret_cast(&SystemNative_FUTimens ); - case 0x42339dd2717504d9: return reinterpret_cast(&SystemNative_GetLingerOption ); - case 0x42783107bf2935ec: return reinterpret_cast(&SystemNative_FreeHostEntry ); - case 0x42eb0578a9d62b78: return reinterpret_cast(&SystemNative_GetFormatInfoForMountPoint ); - case 0x44ccb27979f980ce: return reinterpret_cast(&SystemNative_AlignedAlloc ); - case 0x44f1a5c46033eec2: return reinterpret_cast(&SystemNative_SysLog ); - case 0x483b434d7b089c7e: return reinterpret_cast(&SystemNative_Write ); - case 0x484a3a445bdb14fc: return reinterpret_cast(&SystemNative_GetOSArchitecture ); - case 0x4909639a9d87bdb5: return reinterpret_cast(&SystemNative_AlignedFree ); - case 0x49e3ba95feb79c6c: return reinterpret_cast(&SystemNative_SetAddressFamily ); - case 0x4b00795bbeea6f60: return reinterpret_cast(&SystemNative_SetIPv6Address ); - case 0x4be7ceca50f3298c: return reinterpret_cast(&SystemNative_LowLevelMonitor_Create ); - case 0x4bec4a1d7dfd4cf7: return reinterpret_cast(&SystemNative_GetUnixRelease ); - case 0x4bfff22801b209ca: return reinterpret_cast(&SystemNative_LChflags ); - case 0x4c22cc4f2b1dab26: return reinterpret_cast(&SystemNative_SetPriority ); - case 0x509ff12da4e77259: return reinterpret_cast(&SystemNative_GetSocketAddressSizes ); - case 0x523240c01d14ad50: return reinterpret_cast(&SystemNative_GetPeerID ); - case 0x52794f1118d32f08: return reinterpret_cast(&SystemNative_GetUnixVersion ); - case 0x5381564d2c06c0a3: return reinterpret_cast(&SystemNative_SysConf ); - case 0x556bc89d2d4dfc85: return reinterpret_cast(&SystemNative_GetDeviceIdentifiers ); - case 0x5592a052ceb4caf6: return reinterpret_cast(&SystemNative_GetProcessPath ); - case 0x55fe2620f63d83d8: return reinterpret_cast(&SystemNative_SetDelayedSigChildConsoleConfigurationHandler ); - case 0x574d77a68ec3e488: return reinterpret_cast(&SystemNative_GetEnv ); - case 0x583db0344a1cd715: return reinterpret_cast(&SystemNative_GetActiveUdpListeners ); - case 0x5908581fe73717f0: return reinterpret_cast(&SystemNative_InterfaceNameToIndex ); - case 0x5a305cf2a314d6a6: return reinterpret_cast(&SystemNative_FTruncate ); - case 0x5e53b688fede3216: return reinterpret_cast(&SystemNative_GetControlCharacters ); - case 0x5fa62856bdbba9c0: return reinterpret_cast(&SystemNative_GetPort ); - case 0x600b4418896f7808: return reinterpret_cast(&SystemNative_Exit ); - case 0x6089f0c8112eb3d9: return reinterpret_cast(&SystemNative_InitializeConsoleBeforeRead ); - case 0x613307e537d462db: return reinterpret_cast(&SystemNative_GetReadDirRBufferSize ); - case 0x61bacd7170fd8c9b: return reinterpret_cast(&SystemNative_SchedSetAffinity ); - case 0x61f3ce1b18b20d6f: return reinterpret_cast(&SystemNative_GetNativeIPInterfaceStatistics ); - case 0x62351df42d842942: return reinterpret_cast(&SystemNative_GetSignalForBreak ); - case 0x6393d30aceaa6df2: return reinterpret_cast(&SystemNative_PWriteV ); - case 0x6448f0806bd3a338: return reinterpret_cast(&SystemNative_FreeEnviron ); - case 0x650eddee76c6b8da: return reinterpret_cast(&SystemNative_GetHostName ); - case 0x652badfba5d61929: return reinterpret_cast(&SystemNative_FcntlSetFD ); - case 0x67d2cd86792b1d0c: return reinterpret_cast(&SystemNative_Realloc ); - case 0x67e9d60481f4be06: return reinterpret_cast(&SystemNative_PlatformSupportsDualModeIPv4PacketInfo ); - case 0x68df81a8fb5bf442: return reinterpret_cast(&SystemNative_GetSockOpt ); - case 0x68f3fe6083c0355b: return reinterpret_cast(&SystemNative_GetLoadLibraryError ); - case 0x69ad99fac0467f64: return reinterpret_cast(&SystemNative_Link ); - case 0x6b9097385aa77917: return reinterpret_cast(&SystemNative_FSync ); - case 0x6b9bce16ba8e845f: return reinterpret_cast(&SystemNative_Malloc ); - case 0x6bc18fbbbf267e2a: return reinterpret_cast(&SystemNative_ReceiveSocketError ); - case 0x6e2c1caff08e6e2d: return reinterpret_cast(&SystemNative_ReadStdin ); - case 0x6ee05d5e8650e56c: return reinterpret_cast(&SystemNative_DisablePosixSignalHandling ); - case 0x729afe37cdb8ae8f: return reinterpret_cast(&SystemNative_Connect ); - case 0x730ae9a7469a7321: return reinterpret_cast(&SystemNative_GetAllMountPoints ); - case 0x742da00b2dbf435d: return reinterpret_cast(&SystemNative_LoadLibrary ); - case 0x7559feb379d38da5: return reinterpret_cast(&SystemNative_GetTimeZoneData ); - case 0x7d7ee4bce74d4de9: return reinterpret_cast(&SystemNative_GetDomainSocketSizes ); - case 0x7e1766c6df3ad261: return reinterpret_cast(&SystemNative_MUnmap ); - case 0x7e4bdf46d4ff9f11: return reinterpret_cast(&SystemNative_MkNod ); - case 0x7ec328b6ba9eab8a: return reinterpret_cast(&SystemNative_WaitForSocketEvents ); - case 0x84c8a7489b37fea0: return reinterpret_cast(&SystemNative_GetPlatformSignalNumber ); - case 0x8502eeba98158e79: return reinterpret_cast(&SystemNative_FcntlSetIsNonBlocking ); - case 0x8530d37777969db6: return reinterpret_cast(&SystemNative_SetKeypadXmit ); - case 0x85d0033bc38bb4bb: return reinterpret_cast(&SystemNative_MAdvise ); - case 0x889350f209555ecb: return reinterpret_cast(&SystemNative_MkdTemp ); - case 0x88a08b60b80c70cc: return reinterpret_cast(&SystemNative_FChMod ); - case 0x8bcabce135063bed: return reinterpret_cast(&SystemNative_OpenDir ); - case 0x8df448aee6e8fa5e: return reinterpret_cast(&SystemNative_WaitPidExitedNoHang ); - case 0x8e96cb02418947cc: return reinterpret_cast(&SystemNative_FcntlGetPipeSz ); - case 0x8fb6ed14ee0256bc: return reinterpret_cast(&SystemNative_GetTimestamp ); - case 0x8ffe2d950d138c01: return reinterpret_cast(&SystemNative_SchedGetCpu ); - case 0x93a8bec488055608: return reinterpret_cast(&SystemNative_GetPwNamR ); - case 0x95a4cb8563cc6b14: return reinterpret_cast(&SystemNative_ShmOpen ); - case 0x9856fa59ed936b73: return reinterpret_cast(&SystemNative_GetSid ); - case 0x996ada1c038aabba: return reinterpret_cast(&SystemNative_MksTemps ); - case 0x99a840c495204202: return reinterpret_cast(&SystemNative_GetBytesAvailable ); - case 0x9aa9eaee3dd8b23b: return reinterpret_cast(&SystemNative_GetIPv4MulticastOption ); - case 0x9aaaad33b28af82f: return reinterpret_cast(&SystemNative_SetSignalForBreak ); - case 0x9c3e8b890033819a: return reinterpret_cast(&SystemNative_FcntlCanGetSetPipeSz ); - case 0x9c832cd7fcbf2de0: return reinterpret_cast(&SystemNative_MkFifo ); - case 0x9d2cb31282abd3d9: return reinterpret_cast(&SystemNative_GetNetworkInterfaces ); - case 0x9e25ebf4f61cc299: return reinterpret_cast(&SystemNative_ChDir ); - case 0x9fb01da1222e905a: return reinterpret_cast(&SystemNative_IsATty ); - case 0xa1e881a63614507e: return reinterpret_cast(&SystemNative_INotifyRemoveWatch ); - case 0xa2254fea4d8b6909: return reinterpret_cast(&SystemNative_MMap ); - case 0xa2d7790a850024c0: return reinterpret_cast(&SystemNative_GetNumRoutes ); - case 0xa302613a430248b8: return reinterpret_cast(&SystemNative_GetGroups ); - case 0xa56532a23755cd87: return reinterpret_cast(&SystemNative_StdinReady ); - case 0xa89ec9958d999483: return reinterpret_cast(&SystemNative_GetCwd ); - case 0xa8bdc3e7ee898dfc: return reinterpret_cast(&SystemNative_Shutdown ); - case 0xabdcf2f74d210f35: return reinterpret_cast(&SystemNative_GetCryptographicallySecureRandomBytes ); - case 0xac11eab9d9c31b01: return reinterpret_cast(&SystemNative_UTimensat ); - case 0xac7725c652a5fb5b: return reinterpret_cast(&SystemNative_CopyFile ); - case 0xad228cdc4edb11d6: return reinterpret_cast(&SystemNative_CloseDir ); - case 0xadc6889903a2d6f4: return reinterpret_cast(&SystemNative_Rename ); - case 0xae320903718eb45d: return reinterpret_cast(&SystemNative_MapTcpState ); - case 0xaf9706efc72c3904: return reinterpret_cast(&SystemNative_SetIPv6MulticastOption ); - case 0xafd9f6338cdbadd4: return reinterpret_cast(&SystemNative_GetHostEntryForName ); - case 0xb0b66a7145de350d: return reinterpret_cast(&SystemNative_Access ); - case 0xb0e18377ed603e0b: return reinterpret_cast(&SystemNative_GetGroupList ); - case 0xb361006446f560e8: return reinterpret_cast(&SystemNative_LogError ); - case 0xb600c44028c1743d: return reinterpret_cast(&SystemNative_Socket ); - case 0xb632e9bc6f7be0a9: return reinterpret_cast(&SystemNative_GetSockName ); - case 0xb6540b73eff28747: return reinterpret_cast(&SystemNative_SetRawSockOpt ); - case 0xb6ab9abf7887911f: return reinterpret_cast(&SystemNative_ReadEvents ); - case 0xb73c597de01bc0b2: return reinterpret_cast(&SystemNative_GetPwUidR ); - case 0xb78af5975603cd20: return reinterpret_cast(&SystemNative_Sync ); - case 0xb7bbbe2c16a565c6: return reinterpret_cast(&SystemNative_Calloc ); - case 0xbb3343826d504870: return reinterpret_cast(&SystemNative_GetBootTimeTicks ); - case 0xbb5e970ecb6745da: return reinterpret_cast(&SystemNative_SymLink ); - case 0xbbd20cce92ec2c12: return reinterpret_cast(&SystemNative_FcntlGetFD ); - case 0xbcd9e53d2d288094: return reinterpret_cast(&SystemNative_GetNameInfo ); - case 0xbd89ef4df5486744: return reinterpret_cast(&SystemNative_Send ); - case 0xbdd3128e77381b01: return reinterpret_cast(&SystemNative_EnumerateInterfaceAddresses ); - case 0xc00ebc097b776c1f: return reinterpret_cast(&SystemNative_GetPriority ); - case 0xc036b23d88fad91b: return reinterpret_cast(&SystemNative_iOSSupportVersion ); - case 0xc1c679eefc134d31: return reinterpret_cast(&SystemNative_LowLevelMonitor_Release ); - case 0xc3c10021b10ba455: return reinterpret_cast(&SystemNative_GetEGid ); - case 0xc3fe9394fe1f3f02: return reinterpret_cast(&SystemNative_GetSocketType ); - case 0xc560d9947ab2a34d: return reinterpret_cast(&SystemNative_RegisterForSigChld ); - case 0xc5bed971846027de: return reinterpret_cast(&SystemNative_GetCpuUtilization ); - case 0xc69433678dd341ca: return reinterpret_cast(&SystemNative_ForkAndExecProcess ); - case 0xc7ae1b8d93af5d73: return reinterpret_cast(&SystemNative_ChMod ); - case 0xc7d536c0e7eb3fe2: return reinterpret_cast(&SystemNative_FreeSocketEventBuffer ); - case 0xc87a5ee4869035c6: return reinterpret_cast(&SystemNative_UninitializeConsoleAfterRead ); - case 0xc93df58ae5457bfd: return reinterpret_cast(&SystemNative_GetControlMessageBufferSize ); - case 0xc956e528f995739c: return reinterpret_cast(&SystemNative_ReceiveMessage ); - case 0xcaae6d345ba32c7b: return reinterpret_cast(&SystemNative_Kill ); - case 0xcaec08aa13779f7f: return reinterpret_cast(&SystemNative_GetEnviron ); - case 0xcbbb90469d28cded: return reinterpret_cast(&SystemNative_SearchPath ); - case 0xcc43d880192dd6ff: return reinterpret_cast(&SystemNative_ConvertErrorPlatformToPal ); - case 0xcc788c0474c3e178: return reinterpret_cast(&SystemNative_LSeek ); - case 0xcdcb014df9a6eae2: return reinterpret_cast(&SystemNative_SetPort ); - case 0xce36e2e1a139a020: return reinterpret_cast(&SystemNative_GetDefaultTimeZone ); - case 0xce6ddfe40fed99d9: return reinterpret_cast(&SystemNative_PRead ); - case 0xd392d6ed5dcc111c: return reinterpret_cast(&SystemNative_GetDomainName ); - case 0xd55437b16dc84f3b: return reinterpret_cast(&SystemNative_GetIPv4GlobalStatistics ); - case 0xd88be8f9e9f28e90: return reinterpret_cast(&SystemNative_GetIcmpv4GlobalStatistics ); - case 0xd8976692c4c68818: return reinterpret_cast(&SystemNative_GetEstimatedUdpListenerCount ); - case 0xda05c57c78aa6706: return reinterpret_cast(&SystemNative_LowLevelMonitor_Signal_Release ); - case 0xda38bffa1d16cdd6: return reinterpret_cast(&SystemNative_SetLingerOption ); - case 0xda6b3192974ca60e: return reinterpret_cast(&SystemNative_Open ); - case 0xdab5eb45815daabc: return reinterpret_cast(&SystemNative_GetAtOutOfBandMark ); - case 0xdae32aac0c0d305c: return reinterpret_cast(&SystemNative_ReadProcessStatusInfo ); - case 0xdbee22594fa8c585: return reinterpret_cast(&SystemNative_CreateAutoreleasePool ); - case 0xdf650444c8af0763: return reinterpret_cast(&SystemNative_FcntlGetIsNonBlocking ); - case 0xe0a170d2b947a8fc: return reinterpret_cast(&SystemNative_SendMessage ); - case 0xe0a601fd89d9b279: return reinterpret_cast(&SystemNative_SetErrNo ); - case 0xe1930d112ce74c9e: return reinterpret_cast(&SystemNative_TryGetUInt32OSThreadId ); - case 0xe20c29fb8b19da7b: return reinterpret_cast(&SystemNative_Listen ); - case 0xe36a157177b2db08: return reinterpret_cast(&SystemNative_GetNonCryptographicallySecureRandomBytes ); - case 0xe44f737a5bebdd90: return reinterpret_cast(&SystemNative_SetIPv4Address ); - case 0xe582a4a60bb74c35: return reinterpret_cast(&SystemNative_GetProcAddress ); - case 0xe6838f2add787bfe: return reinterpret_cast(&SystemNative_FreeLibrary ); - case 0xe73aeaf9e3a10343: return reinterpret_cast(&SystemNative_PWrite ); - case 0xe78ff100d1d73d99: return reinterpret_cast(&SystemNative_SetReceiveTimeout ); - case 0xe853ecfe4d402ed0: return reinterpret_cast(&SystemNative_Poll ); - case 0xeaafb7963ceb9bf4: return reinterpret_cast(&SystemNative_GetTcpGlobalStatistics ); - case 0xec67e4076662c2de: return reinterpret_cast(&SystemNative_GetDefaultSearchOrderPseudoHandle ); - case 0xef71ee101b3ece96: return reinterpret_cast(&SystemNative_GetIcmpv6GlobalStatistics ); - case 0xf0045895a9043221: return reinterpret_cast(&SystemNative_SearchPath_TempDirectory ); - case 0xf0658a22dd5ede19: return reinterpret_cast(&SystemNative_SNPrintF_1I ); - case 0xf0ec052da6c5fa70: return reinterpret_cast(&SystemNative_EnumerateGatewayAddressesForInterface ); - case 0xf2c7fa39bf166188: return reinterpret_cast(&SystemNative_Free ); - case 0xf38b47e43f352491: return reinterpret_cast(&SystemNative_GetUdpGlobalStatistics ); - case 0xf6ede5d5d8729315: return reinterpret_cast(&SystemNative_WaitIdAnyExitedNoHangNoWait ); - case 0xf870179a8d8d1872: return reinterpret_cast(&SystemNative_PosixFAdvise ); - case 0xf8c983dd21ef9fe6: return reinterpret_cast(&SystemNative_GetPid ); - case 0xfa26b86cedf66721: return reinterpret_cast(&SystemNative_Sysctl ); - case 0xfb3e394cc613f202: return reinterpret_cast(&SystemNative_GetPeerName ); - case 0xfbb57319454b1074: return reinterpret_cast(&SystemNative_GetSpaceInfoForMountPoint ); - case 0xff28b3bec4f32a2c: return reinterpret_cast(&SystemNative_GetFileSystemType ); - } -#endif - return nullptr; - } - -#if INTPTR_MAX == INT64_MAX - template - void find_entry_benchmark (const char *label, std::array const& data) - { - log_debug (LOG_ASSEMBLY, "%s search benchmark, %zu entries", label, data.size ()); - - hash_t first = data[0].hash; - hash_t middle = data[data.size () / 2].hash; - hash_t last = data[data.size () - 1].hash; - size_t index; - PinvokeEntry *entry; - void *ptr; - - timing_period elapsed; - auto log_elapsed = [&elapsed](const char *label) { - timing_diff diff (elapsed); - log_debug (LOG_ASSEMBLY, "%s; elapsed: %lis:%lu::%lu", label, diff.sec, diff.ms, diff.ns); - }; - - elapsed.mark_start (); - entry = find_pinvoke_binary_search (data, first); - elapsed.mark_end (); - log_elapsed ( "BINARY: find first entry"); - - elapsed.reset (); - elapsed.mark_start (); - entry = find_pinvoke_binary_search (data, middle); - elapsed.mark_end (); - log_elapsed ("BINARY: find middle entry"); - - elapsed.reset (); - elapsed.mark_start (); - entry = find_pinvoke_binary_search (data, last); - elapsed.mark_end (); - log_elapsed ("BINARY: find last entry"); - - elapsed.reset (); - elapsed.mark_start (); - ptr = linear_search (first); - elapsed.mark_end (); - log_elapsed ("LINEAR: find first entry"); - - elapsed.reset (); - elapsed.mark_start (); - ptr = linear_search (middle); - elapsed.mark_end (); - log_elapsed ("LINEAR: find middle entry"); - - elapsed.reset (); - elapsed.mark_start (); - ptr = linear_search (last); - elapsed.mark_end (); - log_elapsed ("LINEAR: find last entry"); - } - - void find_system_native_entry_benchmark () - { - find_entry_benchmark ("System.Native", system_native_pinvokes); - } -#endif - - void* find_internal_entry (hash_t entrypoint_hash) - { -// log_debug (LOG_ASSEMBLY, "Looking up internal p/invoke"); - -#if INTPTR_MAX == INT64_MAX - switch (entrypoint_hash) { - case 0x452e23128e42f0a: return reinterpret_cast(&monodroid_get_log_categories); - case 0xa50ce5de13bf8b5: return reinterpret_cast(&_monodroid_timezone_get_default_id); - case 0x19055d65edfd668e: return reinterpret_cast(&_monodroid_get_network_interface_up_state); - case 0x2b3b0ca1d14076da: return reinterpret_cast(&monodroid_get_dylib); - case 0x2fbe68718cf2510d: return reinterpret_cast(&_monodroid_get_identity_hash_code); - case 0x3ade4348ac8ce0fa: return reinterpret_cast(&_monodroid_freeifaddrs); - case 0x3b2467e7eadd4a6a: return reinterpret_cast(&_monodroid_lref_log_new); - case 0x3b8097af56b5361f: return reinterpret_cast(&monodroid_log_traces); - case 0x3c5532ecdab53f89: return reinterpret_cast(&set_world_accessable); - case 0x423c8f539a2c56d2: return reinterpret_cast(&_monodroid_lookup_replacement_type); - case 0x4b1956138764939a: return reinterpret_cast(&_monodroid_gref_log_new); - case 0x4d5b5b488f736058: return reinterpret_cast(&path_combine); - case 0x5a2614d15e2fdc2e: return reinterpret_cast(&monodroid_strdup_printf); - case 0x5f0b4e426eff086b: return reinterpret_cast(&_monodroid_detect_cpu_and_architecture); - case 0x709af13cbfbe2e75: return reinterpret_cast(&monodroid_clear_gdb_wait); - case 0x70ae32c9a4f1ad2c: return reinterpret_cast(&monodroid_strsplit); - case 0x70fc9bab8d56666d: return reinterpret_cast(&create_public_directory); - case 0x78514771a67ad724: return reinterpret_cast(&monodroid_strfreev); - case 0x9099a4b95e3c3a89: return reinterpret_cast(&_monodroid_lref_log_delete); - case 0x958cdb6fd9d1b67b: return reinterpret_cast(&monodroid_dylib_mono_new); - case 0xa6ec846592d99536: return reinterpret_cast(&_monodroid_weak_gref_delete); - case 0xa7f58f3ee428cc6b: return reinterpret_cast(&_monodroid_gref_log_delete); - case 0xae3df96dda0143bd: return reinterpret_cast(&_monodroid_gref_log); - case 0xb6222d90af401865: return reinterpret_cast(&_monodroid_weak_gref_get); - case 0xb8306f71b963cd3d: return reinterpret_cast(&monodroid_log); - case 0xbc90bafd5ff9c99e: return reinterpret_cast(&_monodroid_get_dns_servers); - case 0xbe5a300beec69c35: return reinterpret_cast(&monodroid_get_system_property); - case 0xbfbb924fbe190616: return reinterpret_cast(&monodroid_dylib_mono_free); - case 0xc2a21d3f6c8ccc24: return reinterpret_cast(&_monodroid_lookup_replacement_method_info); - case 0xc5b4690e13898fa3: return reinterpret_cast(&monodroid_timing_start); - case 0xcc873ea8493d1dd5: return reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix); - case 0xce439cfbe29dec11: return reinterpret_cast(&_monodroid_get_android_api_level); - case 0xd1e121b94ea63f2e: return reinterpret_cast(&_monodroid_gref_get); - case 0xd5151b00eb33d85e: return reinterpret_cast(&monodroid_TypeManager_get_java_class_name); - case 0xda517ef392b6a888: return reinterpret_cast(&java_interop_free); - case 0xe27b9849b7e982cb: return reinterpret_cast(&_monodroid_max_gref_get); - case 0xe370a0d91cd63bc0: return reinterpret_cast(&_monodroid_getifaddrs); - case 0xe78f1161604ae672: return reinterpret_cast(&send_uninterrupted); - case 0xe86307aac9a2631a: return reinterpret_cast(&_monodroid_weak_gref_new); - case 0xebc2c68e10075cc9: return reinterpret_cast(&monodroid_fopen); - case 0xee83e38e479aeff1: return reinterpret_cast(&_monodroid_counters_dump); - case 0xf3048baf83034541: return reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing); - case 0xf41c48df6f9be476: return reinterpret_cast(&monodroid_free); - case 0xf5a918ef520db207: return reinterpret_cast(&monodroid_timing_stop); - case 0xf5ed87b004005892: return reinterpret_cast(&_monodroid_get_network_interface_supports_multicast); - case 0xf8798f762db15bba: return reinterpret_cast(&recv_uninterrupted); - case 0xfa90326712e7e7c4: return reinterpret_cast(&java_interop_strdup); - case 0xfdc17c4ea8335ffd: return reinterpret_cast(&monodroid_get_namespaced_system_property); - case 0xff010b3140f54d3f: return reinterpret_cast(&monodroid_dylib_mono_init); - } -#endif - return nullptr; - } - -#if INTPTR_MAX == INT64_MAX - void find_internal_benchmark () - { - find_entry_benchmark ("Internal", internal_pinvokes); - } -#endif - - void* find_system_globalization_entry (hash_t entrypoint_hash) - { -// log_debug (LOG_ASSEMBLY, "Looking up System.Globalization p/invoke"); -#if INTPTR_MAX == INT64_MAX - switch (entrypoint_hash) { - case 0x10f8526b1edfc3: return reinterpret_cast(&GlobalizationNative_GetLocaleInfoInt ); - case 0xe7e93cf9237e1f2: return reinterpret_cast(&GlobalizationNative_ToAscii ); - case 0x18580a4592ed1ea6: return reinterpret_cast(&GlobalizationNative_GetSortKey ); - case 0x1f72f52873ced9c9: return reinterpret_cast(&GlobalizationNative_InitOrdinalCasingPage ); - case 0x2178ba302d0c5f1c: return reinterpret_cast(&GlobalizationNative_GetCalendars ); - case 0x32e594690358a960: return reinterpret_cast(&GlobalizationNative_GetLocaleInfoString ); - case 0x40d61d78487edb08: return reinterpret_cast(&GlobalizationNative_GetICUVersion ); - case 0x4360eb8a25122eee: return reinterpret_cast(&GlobalizationNative_StartsWith ); - case 0x4bd4b1c0803c8c55: return reinterpret_cast(&GlobalizationNative_GetLocaleName ); - case 0x4f22643b9509cc12: return reinterpret_cast(&GlobalizationNative_IsNormalized ); - case 0x507983f11ffec7a8: return reinterpret_cast(&GlobalizationNative_GetTimeZoneDisplayName ); - case 0x56e982948d00f10d: return reinterpret_cast(&GlobalizationNative_IndexOf ); - case 0x635327a9b09a910d: return reinterpret_cast(&GlobalizationNative_NormalizeString ); - case 0x6ac3aeecfc75bfad: return reinterpret_cast(&GlobalizationNative_GetSortVersion ); - case 0x77ca6a148e5a51d9: return reinterpret_cast(&GlobalizationNative_IanaIdToWindowsId ); - case 0x7a4d912694906c9c: return reinterpret_cast(&GlobalizationNative_ToUnicode ); - case 0x7e5fa2f70891c7fe: return reinterpret_cast(&GlobalizationNative_ChangeCaseTurkish ); - case 0xa193402ff5140ac1: return reinterpret_cast(&GlobalizationNative_GetCalendarInfo ); - case 0xa831a683f743e417: return reinterpret_cast(&GlobalizationNative_WindowsIdToIanaId ); - case 0xac5c6a70d140a4bf: return reinterpret_cast(&GlobalizationNative_GetLocaleTimeFormat ); - case 0xb81236cd1fe85cc9: return reinterpret_cast(&GlobalizationNative_GetLatestJapaneseEra ); - case 0xb95350c7ec77bc72: return reinterpret_cast(&GlobalizationNative_ChangeCase ); - case 0xc287daf58054a21d: return reinterpret_cast(&GlobalizationNative_EndsWith ); - case 0xc8b772178f955d87: return reinterpret_cast(&GlobalizationNative_GetSortHandle ); - case 0xd0899515dfe85287: return reinterpret_cast(&GlobalizationNative_LoadICU ); - case 0xd185dfe303ab91dd: return reinterpret_cast(&GlobalizationNative_CompareString ); - case 0xd5264d57a926edfb: return reinterpret_cast(&GlobalizationNative_InitICUFunctions ); - case 0xd995e71361e6ed2e: return reinterpret_cast(&GlobalizationNative_IsPredefinedLocale ); - case 0xe072da8f2d921f53: return reinterpret_cast(&GlobalizationNative_GetDefaultLocaleName ); - case 0xea21aa1f2b2a671c: return reinterpret_cast(&GlobalizationNative_LastIndexOf ); - case 0xee4dd111dc8d98f3: return reinterpret_cast(&GlobalizationNative_GetJapaneseEraStartDate ); - case 0xf2d074e0aeca51ce: return reinterpret_cast(&GlobalizationNative_GetLocales ); - case 0xf3693f3cadb9b6f4: return reinterpret_cast(&GlobalizationNative_EnumCalendarInfo ); - case 0xf63fa2bfce5c4f80: return reinterpret_cast(&GlobalizationNative_GetLocaleInfoGroupingSizes); - case 0xfa21f0a127c9dce9: return reinterpret_cast(&GlobalizationNative_ChangeCaseInvariant ); - case 0xfacf02f439426705: return reinterpret_cast(&GlobalizationNative_CloseSortHandle ); - } -#endif - return nullptr; - } - -#if INTPTR_MAX == INT64_MAX - void find_system_globalization_benchmark () - { - find_entry_benchmark ("System.Globalization", system_globalization_pinvokes); - } -#endif - - void* find_system_security_cryptography_entry (hash_t entrypoint_hash) - { -// log_debug (LOG_ASSEMBLY, "Looking up System.Security.Cryptography p/invoke"); -#if INTPTR_MAX == INT64_MAX - switch (entrypoint_hash) { - case 0x75a0e90c77ca35: return reinterpret_cast(&AndroidCryptoNative_EcKeyCreateByExplicitParameters ); - case 0x47302bd7e277183: return reinterpret_cast(&AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry ); - case 0x598db66ca39c41f: return reinterpret_cast(&AndroidCryptoNative_EcKeyUpRef ); - case 0x656cac62ccc9e3c: return reinterpret_cast(&AndroidCryptoNative_X509GetContentType ); - case 0x690c4347972024f: return reinterpret_cast(&AndroidCryptoNative_Aes256Gcm ); - case 0x7b5579ab0499b1f: return reinterpret_cast(&AndroidCryptoNative_RsaSize ); - case 0xcaba893801c6a6f: return reinterpret_cast(&AndroidCryptoNative_Aes256Ecb ); - case 0xcbe6d3d22131194: return reinterpret_cast(&AndroidCryptoNative_SetRsaParameters ); - case 0x1027786cdd9a3e9c: return reinterpret_cast(&AndroidCryptoNative_Aes192Cbc ); - case 0x1d1bb0528d517729: return reinterpret_cast(&AndroidCryptoNative_SSLGetSupportedProtocols ); - case 0x1e6228e955989698: return reinterpret_cast(&AndroidCryptoNative_EcKeyCreateByOid ); - case 0x1f45ac9d3c6b1554: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetCipherSuite ); - case 0x1f7d2360a1cdcbff: return reinterpret_cast(&AndroidCryptoNative_SSLStreamCreate ); - case 0x218fce505a140c55: return reinterpret_cast(&AndroidCryptoNative_EcDsaVerify ); - case 0x23ac2a4c4d1c744e: return reinterpret_cast(&AndroidCryptoNative_X509ChainGetCertificateCount ); - case 0x267c94097a3bf1f3: return reinterpret_cast(&AndroidCryptoNative_CipherDestroy ); - case 0x2b45d7cdf6e8e0c7: return reinterpret_cast(&AndroidCryptoNative_X509StoreDeleteEntry ); - case 0x2c7e5e179cc917cb: return reinterpret_cast(&AndroidCryptoNative_DsaSizeSignature ); - case 0x2fdcf708ff792105: return reinterpret_cast(&AndroidCryptoNative_SSLStreamVerifyHostname ); - case 0x31027564deeb71b0: return reinterpret_cast(&AndroidCryptoNative_Aes128Cbc ); - case 0x3f19a16a3230b551: return reinterpret_cast(&AndroidCryptoNative_ChaCha20Poly1305 ); - case 0x401935ffc3454bb1: return reinterpret_cast(&AndroidCryptoNative_X509PublicKey ); - case 0x40bfa1211f5f6f9c: return reinterpret_cast(&AndroidCryptoNative_EcKeyGetCurveName ); - case 0x41b6e7f32da99fa9: return reinterpret_cast(&AndroidCryptoNative_X509ChainDestroyContext ); - case 0x41c169fb0e30a390: return reinterpret_cast(&AndroidCryptoNative_X509ChainGetErrorCount ); - case 0x420718c398131a55: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetProtocol ); - case 0x43741165a5ba60d5: return reinterpret_cast(&AndroidCryptoNative_CipherUpdateAAD ); - case 0x4845e1c76265acc9: return reinterpret_cast(&AndroidCryptoNative_X509StoreEnumerateCertificates ); - case 0x4a7272ac9d117f2d: return reinterpret_cast(&AndroidCryptoNative_EcKeyDestroy ); - case 0x4d6361e5095cff36: return reinterpret_cast(&AndroidCryptoNative_DsaSign ); - case 0x4d74053b37e582fa: return reinterpret_cast(&AndroidCryptoNative_X509ChainCreateContext ); - case 0x501daf7e3a890220: return reinterpret_cast(&AndroidCryptoNative_X509ChainBuild ); - case 0x52fc107ebdb6fcc7: return reinterpret_cast(&AndroidCryptoNative_X509StoreRemoveCertificate ); - case 0x5fd29ac523ff6e3d: return reinterpret_cast(&AndroidCryptoNative_SSLStreamRelease ); - case 0x5ffae3c8023a80b8: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetPeerCertificate ); - case 0x648a9b317bc64fe0: return reinterpret_cast(&AndroidCryptoNative_RsaGenerateKeyEx ); - case 0x66e049fe27bf91ea: return reinterpret_cast(&AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration ); - case 0x67a8868ef592a3fd: return reinterpret_cast(&AndroidCryptoNative_SSLStreamShutdown ); - case 0x67a9b5bbce322f8c: return reinterpret_cast(&AndroidCryptoNative_Des3Cbc ); - case 0x6a59d9242cd31785: return reinterpret_cast(&AndroidCryptoNative_RsaPrivateDecrypt ); - case 0x6dbd90e9cc86310b: return reinterpret_cast(&AndroidCryptoNative_CipherFinalEx ); - case 0x6dfd40c2dd0d7382: return reinterpret_cast(&AndroidCryptoNative_RsaUpRef ); - case 0x6f990f1f7bc80630: return reinterpret_cast(&AndroidCryptoNative_RsaCreate ); - case 0x70f907b97d3fe059: return reinterpret_cast(&AndroidCryptoNative_Aes192Ccm ); - case 0x7150f0eb40797bb3: return reinterpret_cast(&AndroidCryptoNative_SSLStreamCreateWithCertificates ); - case 0x7356b141407d261e: return reinterpret_cast(&AndroidCryptoNative_EcdhDeriveKey ); - case 0x74ec4a8d869776ad: return reinterpret_cast(&AndroidCryptoNative_Aes128Ccm ); - case 0x758dfbf057da0da0: return reinterpret_cast(&AndroidCryptoNative_DsaSignatureFieldSize ); - case 0x7975d1d7029cf1a3: return reinterpret_cast(&AndroidCryptoNative_Aes128Gcm ); - case 0x79f5c24afbd04af1: return reinterpret_cast(&AndroidCryptoNative_Aes256Cbc ); - case 0x7a37e0d077f2dfe5: return reinterpret_cast(&AndroidCryptoNative_DsaGenerateKey ); - case 0x7d5273ad530e7298: return reinterpret_cast(&AndroidCryptoNative_X509StoreOpenDefault ); - case 0x7fa96d0284954375: return reinterpret_cast(&AndroidCryptoNative_X509Decode ); - case 0x813bedf08c3388d4: return reinterpret_cast(&AndroidCryptoNative_Aes128Cfb8 ); - case 0x84cc0301870c37ce: return reinterpret_cast(&AndroidCryptoNative_SSLStreamSetTargetHost ); - case 0x868e09dc7dfea364: return reinterpret_cast(&AndroidCryptoNative_RsaSignPrimitive ); - case 0x870191ad244b8069: return reinterpret_cast(&AndroidCryptoNative_RegisterRemoteCertificateValidationCallback ); - case 0x87019b7831c0c34c: return reinterpret_cast(&AndroidCryptoNative_Aes192Gcm ); - case 0x87c447e7f873cff0: return reinterpret_cast(&AndroidCryptoNative_X509ChainValidate ); - case 0x9039632237d70ae7: return reinterpret_cast(&AndroidCryptoNative_NewGlobalReference ); - case 0x9161ade1206fd86e: return reinterpret_cast(&AndroidCryptoNative_Aes256Cfb128 ); - case 0x9167a072639a7c95: return reinterpret_cast(&AndroidCryptoNative_Aes256Ccm ); - case 0x91f065ec0d3aec55: return reinterpret_cast(&AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey ); - case 0x95a0e2fc5c0cb49e: return reinterpret_cast(&AndroidCryptoNative_SSLStreamSetApplicationProtocols ); - case 0x9991a277809ef205: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetApplicationProtocol ); - case 0x9aab07f824659d3e: return reinterpret_cast(&AndroidCryptoNative_DsaKeyCreateByExplicitParameters ); - case 0x9e79166979634030: return reinterpret_cast(&AndroidCryptoNative_CipherSetKeyAndIV ); - case 0x9edddf30d660eff4: return reinterpret_cast(&AndroidCryptoNative_Aes192Ecb ); - case 0xa308025a784497df: return reinterpret_cast(&AndroidCryptoNative_SSLStreamSetEnabledProtocols ); - case 0xa56954e28eb9a9c9: return reinterpret_cast(&AndroidCryptoNative_Des3Cfb8 ); - case 0xa5eda72b95fe78c3: return reinterpret_cast(&AndroidCryptoNative_X509ChainGetErrors ); - case 0xa93eb533acf7564d: return reinterpret_cast(&AndroidCryptoNative_DesEcb ); - case 0xa961e8db31830e16: return reinterpret_cast(&AndroidCryptoNative_Aes192Cfb8 ); - case 0xaa8f0f87ae474ffe: return reinterpret_cast(&AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry ); - case 0xad1a2d6575cdd4e3: return reinterpret_cast(&AndroidCryptoNative_SSLStreamWrite ); - case 0xae82e9ceae24192d: return reinterpret_cast(&AndroidCryptoNative_Pbkdf2 ); - case 0xb0df46ff09c57741: return reinterpret_cast(&AndroidCryptoNative_GetRsaParameters ); - case 0xb1c394b9992bd67d: return reinterpret_cast(&AndroidCryptoNative_EcDsaSign ); - case 0xb1ff12f3bd735982: return reinterpret_cast(&AndroidCryptoNative_AeadCipherFinalEx ); - case 0xb4996dd1aba38200: return reinterpret_cast(&AndroidCryptoNative_EcDsaSize ); - case 0xb575ec01a7a79f8f: return reinterpret_cast(&AndroidCryptoNative_DesCfb8 ); - case 0xb66be1550d27bfb4: return reinterpret_cast(&AndroidCryptoNative_GetECCurveParameters ); - case 0xbd5a0be2f7904089: return reinterpret_cast(&AndroidCryptoNative_X509StoreAddCertificate ); - case 0xbdbbd2898347c0d1: return reinterpret_cast(&AndroidCryptoNative_SSLStreamHandshake ); - case 0xc11cd661db8be230: return reinterpret_cast(&AndroidCryptoNative_Des3Cfb64 ); - case 0xc2d5e1c465b2f5b6: return reinterpret_cast(&AndroidCryptoNative_DsaSizeP ); - case 0xc3145e336c38379b: return reinterpret_cast(&AndroidCryptoNative_SSLStreamGetPeerCertificates ); - case 0xc7815e0476511544: return reinterpret_cast(&AndroidCryptoNative_X509Encode ); - case 0xc8a52a8b6d96b32b: return reinterpret_cast(&AndroidCryptoNative_X509ExportPkcs7 ); - case 0xca48c3927c202794: return reinterpret_cast(&AndroidCryptoNative_GetECKeyParameters ); - case 0xcb4bcdafdc81d116: return reinterpret_cast(&AndroidCryptoNative_CipherCreatePartial ); - case 0xcc433093c073719e: return reinterpret_cast(&AndroidCryptoNative_SSLStreamRead ); - case 0xce9f8a6ac705faa5: return reinterpret_cast(&AndroidCryptoNative_X509DecodeCollection ); - case 0xd5c063a90ae882c1: return reinterpret_cast(&AndroidCryptoNative_CipherIsSupported ); - case 0xd7d818c7640598dc: return reinterpret_cast(&AndroidCryptoNative_X509ChainGetCertificates ); - case 0xd7f1a8f616897ace: return reinterpret_cast(&AndroidCryptoNative_Aes256Cfb8 ); - case 0xd9bd0b370726ce34: return reinterpret_cast(&AndroidCryptoNative_CipherReset ); - case 0xda4898a26933f73d: return reinterpret_cast(&AndroidCryptoNative_DsaVerify ); - case 0xdbb4752ed23670f0: return reinterpret_cast(&AndroidCryptoNative_DesCbc ); - case 0xdc780005b0d39711: return reinterpret_cast(&AndroidCryptoNative_X509StoreGetPrivateKeyEntry ); - case 0xdd4c03f06ce96e04: return reinterpret_cast(&AndroidCryptoNative_RsaDestroy ); - case 0xdde06993f87d6ffc: return reinterpret_cast(&AndroidCryptoNative_Aes128Cfb128 ); - case 0xde1e22dd097f799c: return reinterpret_cast(&AndroidCryptoNative_CipherSetNonceLength ); - case 0xde259001bf54e6f1: return reinterpret_cast(&AndroidCryptoNative_SSLStreamIsLocalCertificateUsed ); - case 0xdec5c7544d2c8cb1: return reinterpret_cast(&AndroidCryptoNative_GetDsaParameters ); - case 0xdfede2defd776f7e: return reinterpret_cast(&AndroidCryptoNative_X509ChainSetCustomTrustStore ); - case 0xe059239741e0011a: return reinterpret_cast(&AndroidCryptoNative_EcKeyCreateByKeyParameters ); - case 0xe0f34ce89fd38aef: return reinterpret_cast(&AndroidCryptoNative_RsaPublicEncrypt ); - case 0xe604fca300068c0c: return reinterpret_cast(&AndroidCryptoNative_CipherCtxSetPadding ); - case 0xeab45239fb3f138d: return reinterpret_cast(&AndroidCryptoNative_GetBigNumBytes ); - case 0xeff5d014640ae969: return reinterpret_cast(&AndroidCryptoNative_DeleteGlobalReference ); - case 0xf1577384f409ea85: return reinterpret_cast(&AndroidCryptoNative_BigNumToBinary ); - case 0xf4dea312f71c5ff2: return reinterpret_cast(&AndroidCryptoNative_Aes128Ecb ); - case 0xf57f81262f07542c: return reinterpret_cast(&AndroidCryptoNative_Des3Ecb ); - case 0xf7b334768844b502: return reinterpret_cast(&AndroidCryptoNative_X509StoreContainsCertificate ); - case 0xf85b8ffeba9b06c1: return reinterpret_cast(&AndroidCryptoNative_X509StoreEnumerateTrustedCertificates ); - case 0xf96bc1e7e15e69f2: return reinterpret_cast(&AndroidCryptoNative_CipherUpdate ); - case 0xf970881d4fa83e07: return reinterpret_cast(&AndroidCryptoNative_CipherCreate ); - case 0xf9c3d216226b3355: return reinterpret_cast(&AndroidCryptoNative_CipherSetTagLength ); - case 0xfa2669c25616a8ff: return reinterpret_cast(&AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry ); - case 0xfaa7766eaa2c54a5: return reinterpret_cast(&AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo ); - case 0xfc0bad2b1528000f: return reinterpret_cast(&AndroidCryptoNative_RsaVerificationPrimitive ); - case 0xfcdeea476953780c: return reinterpret_cast(&AndroidCryptoNative_Aes192Cfb128 ); - case 0xfd2cdd99f11de76c: return reinterpret_cast(&AndroidCryptoNative_EcKeyGetSize ); - case 0xfd4f2784ec1c98aa: return reinterpret_cast(&AndroidCryptoNative_SSLStreamRequestClientAuthentication ); - case 0xfe3dd06281f7cd1f: return reinterpret_cast(&AndroidCryptoNative_SSLStreamInitialize ); - } -#endif - return nullptr; - } - -#if INTPTR_MAX == INT64_MAX - void find_system_security_cryptography_benchmark () - { - find_entry_benchmark ("System.Security.Cryptography", system_crypto_android_pinvokes); - } -#endif - - void* find_system_io_compression_entry (hash_t entrypoint_hash) - { -// log_debug (LOG_ASSEMBLY, "Looking up System.IO.Compression p/invoke"); - -#if INTPTR_MAX == INT64_MAX - switch (entrypoint_hash) { - case 0x99f2ee02463000: return reinterpret_cast(&CompressionNative_Crc32 ); - case 0x403e1bc0b3baba84: return reinterpret_cast(&CompressionNative_Inflate ); - case 0xafe3d21bbaa71464: return reinterpret_cast(&CompressionNative_DeflateEnd ); - case 0xc10e411c989a9314: return reinterpret_cast(&CompressionNative_Deflate ); - case 0xca001af79c0d7a8b: return reinterpret_cast(&CompressionNative_InflateEnd ); - case 0xcd5d8a63493f5e38: return reinterpret_cast(&CompressionNative_InflateInit2_ ); - case 0xea5e6653389b924a: return reinterpret_cast(&CompressionNative_DeflateInit2_ ); - } -#endif - return nullptr; - } - -#if INTPTR_MAX == INT64_MAX - void find_system_io_compression_benchmark () - { - find_entry_benchmark ("System.IO.Compression", system_io_compression_pinvokes); - } -#endif - - extern "C" - [[gnu::noinline]] - void* find_pinvoke (hash_t library_name_hash, hash_t entrypoint_hash, bool& known_library) - { - // Order of `case` statements should be roughly sorted by the (projected) frequency of calls from the - // managed land. - switch (library_name_hash) { - // `libSystem.Native` and `xa-internal-api` are both used during startup, put them first - case system_native_library_hash: - return find_system_native_entry (entrypoint_hash); - - case xa_internal_api_library_hash: - case java_interop_library_hash: - return find_internal_entry (entrypoint_hash); - - case system_globalization_native_library_hash: - return find_system_globalization_entry (entrypoint_hash); - - case system_security_cryptography_native_android_library_hash: - return find_system_security_cryptography_entry (entrypoint_hash); - - case system_io_compression_native_library_hash: - return find_system_io_compression_entry (entrypoint_hash); - } - - known_library = false; - return nullptr; - } -} - -namespace { - bool benchmarks_done = false; -} +// +// This is generated during application build (see obj/${CONFIGURATION}/${RID}/android/pinvoke_preserve.*.ll) +// +extern "C" void* find_pinvoke (hash_t library_name_hash, hash_t entrypoint_hash, bool &known_library); [[gnu::flatten]] void* @@ -1603,22 +18,6 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha log_debug (LOG_ASSEMBLY, __PRETTY_FUNCTION__); log_debug (LOG_ASSEMBLY, "library_name == '%s'; entrypoint_name == '%s'", library_name, entrypoint_name); - bool known_library = true; -#if INTPTR_MAX == INT64_MAX - if (!benchmarks_done) { - benchmarks_done = true; - - if (FastTiming::enabled ()) { - find_system_io_compression_benchmark (); - find_system_globalization_benchmark (); - find_internal_benchmark (); - find_system_security_cryptography_benchmark (); - find_system_native_entry_benchmark (); - } - } - known_library = true; -#endif - if (library_name == nullptr || entrypoint_name == nullptr) { return nullptr; } @@ -1627,7 +26,7 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); log_debug (LOG_ASSEMBLY, "library_name_hash == 0x%zx; entrypoint_hash == 0x%zx", library_name_hash, entrypoint_hash); - //bool known_library = true; + bool known_library = true; void *pinvoke_ptr = find_pinvoke (library_name_hash, entrypoint_hash, known_library); if (pinvoke_ptr != nullptr) { return pinvoke_ptr; From 81d2c3a0e5086cdb17c823ccfc271e15af575202 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 9 Sep 2024 21:13:28 +0200 Subject: [PATCH 30/53] Hide almost all the exported symbols --- .../Tasks/GetNativeRuntimeComponents.cs | 13 +++-- .../Utilities/KnownMetadata.cs | 3 +- .../Utilities/NativeLinker.cs | 56 +++++++++++-------- .../Utilities/NativeRuntimeComponents.cs | 10 +++- 4 files changed, 53 insertions(+), 29 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs index e33e8ebc4de..27690f8c89c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs @@ -90,11 +90,16 @@ void MakeArchiveItem (NativeRuntimeComponents.Archive archive, List a { foreach (ITaskItem resolvedArchive in ResolvedNativeArchives) { string fileName = Path.GetFileName (resolvedArchive.ItemSpec); - if (String.Compare (fileName, archive.Name, StringComparison.OrdinalIgnoreCase) == 0) { - ITaskItem newItem = DoMakeItem ("_ResolvedNativeArchive", resolvedArchive, uniqueAbis); - newItem.SetMetadata (KnownMetadata.LinkWholeArchive, archive.WholeArchive.ToString ()); - archives.Add (newItem); + if (String.Compare (fileName, archive.Name, StringComparison.OrdinalIgnoreCase) != 0) { + continue; + } + + ITaskItem newItem = DoMakeItem ("_ResolvedNativeArchive", resolvedArchive, uniqueAbis); + newItem.SetMetadata (KnownMetadata.NativeLinkWholeArchive, archive.WholeArchive.ToString ()); + if (archive.DontExportSymbols) { + newItem.SetMetadata (KnownMetadata.NativeDontExportSymbols, "true"); } + archives.Add (newItem); } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs b/src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs index 014cd2cddd0..0918aba990d 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/KnownMetadata.cs @@ -3,6 +3,7 @@ namespace Xamarin.Android.Tasks; static class KnownMetadata { public const string Abi = "Abi"; - public const string LinkWholeArchive = "LinkWholeArchive"; + public const string NativeLinkWholeArchive = "LinkWholeArchive"; public const string RuntimeIdentifier = "RuntimeIdentifier"; + public const string NativeDontExportSymbols = "DontExportSymbols"; } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index 9c6ecc2de66..a46041dae44 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -114,31 +114,36 @@ public bool Link (ITaskItem outputLibraryPath, List objectFiles, List string libBaseName = Path.GetFileNameWithoutExtension (outputLibraryPath.ItemSpec); string respFilePath = Path.Combine (intermediateDir, $"ld.{libBaseName}.{abi}.rsp"); - using (var sw = new StreamWriter (File.Open (respFilePath, FileMode.Create, FileAccess.Write, FileShare.Read), new UTF8Encoding (false))) { - foreach (string arg in standardArgs) { - sw.WriteLine (arg); - } + using var sw = new StreamWriter (File.Open (respFilePath, FileMode.Create, FileAccess.Write, FileShare.Read), new UTF8Encoding (false)); + foreach (string arg in standardArgs) { + sw.WriteLine (arg); + } - foreach (string arg in extraArgs) { - sw.WriteLine (arg); - } + foreach (string arg in extraArgs) { + sw.WriteLine (arg); + } - if (StripDebugSymbols && !SaveDebugSymbols) { - sw.WriteLine ("-s"); - } + if (StripDebugSymbols && !SaveDebugSymbols) { + sw.WriteLine ("-s"); + } - WriteFilesToResponseFile (sw, linkStartFiles); - WriteFilesToResponseFile (sw, objectFiles); - WriteFilesToResponseFile (sw, archives); + var excludeExportsLibs = new List (); + WriteFilesToResponseFile (sw, linkStartFiles); + WriteFilesToResponseFile (sw, objectFiles); + WriteFilesToResponseFile (sw, archives); - foreach (ITaskItem libItem in libraries) { - sw.WriteLine ($"-l{libItem.ItemSpec}"); - } + if (excludeExportsLibs.Count > 0) { + string libs = String.Join (",", excludeExportsLibs); + sw.WriteLine ($"--exclude-libs={libs}"); + } - WriteFilesToResponseFile (sw, linkEndFiles); - sw.Flush (); + foreach (ITaskItem libItem in libraries) { + sw.WriteLine ($"-l{libItem.ItemSpec}"); } + WriteFilesToResponseFile (sw, linkEndFiles); + sw.Flush (); + var ldArgs = new List { $"@{respFilePath}", "-o", @@ -163,6 +168,10 @@ void WriteFilesToResponseFile (StreamWriter sw, List files) foreach (ITaskItem file in files) { bool wholeArchive = IncludeWholeArchive (file); + if (ExcludeFromExports (file)) { + excludeExportsLibs.Add (Path.GetFileName (file.ItemSpec)); + } + if (wholeArchive) { sw.Write ("--whole-archive "); } @@ -178,15 +187,18 @@ void WriteFilesToResponseFile (StreamWriter sw, List files) } } - bool IncludeWholeArchive (ITaskItem item) + bool IncludeWholeArchive (ITaskItem item) => ParseBooleanMetadata (item, KnownMetadata.NativeLinkWholeArchive); + bool ExcludeFromExports (ITaskItem item) => ParseBooleanMetadata (item, KnownMetadata.NativeDontExportSymbols); + + bool ParseBooleanMetadata (ITaskItem item, string metadata) { - string? wholeArchive = item.GetMetadata (KnownMetadata.LinkWholeArchive); - if (String.IsNullOrEmpty (wholeArchive)) { + string? value = item.GetMetadata (metadata); + if (String.IsNullOrEmpty (value)) { return false; } // Purposefully not calling TryParse, let it throw and let us know if the value isn't a boolean. - return Boolean.Parse (wholeArchive); + return Boolean.Parse (value); } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index e2e92594513..8c29c38069c 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -12,6 +12,7 @@ internal class Archive public readonly string Name; public bool Include => shouldInclude (this); public readonly bool WholeArchive; + public bool DontExportSymbols { get; set; } Func shouldInclude; @@ -31,6 +32,7 @@ public MonoComponentArchive (string name, string componentName, Func Date: Mon, 9 Sep 2024 21:34:25 +0200 Subject: [PATCH 31/53] Hide `find_pinvoke` --- .../Utilities/PreservePinvokesNativeAssemblyGenerator.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs index 275b61387f2..0a5d08c7828 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs @@ -192,6 +192,7 @@ void AddFindPinvoke (LlvmIrModule module, List components, bool is var func = new LlvmIrFunction (sig, MakeFindPinvokeAttributeSet (module)) { CallingConvention = LlvmIrCallingConvention.Fastcc, + Visibility = LlvmIrVisibility.Hidden, }; LlvmIrLocalVariable retval = func.CreateLocalVariable (typeof(IntPtr), "retval"); var state = new ConstructionState { From 2db6296e1aa9c101d39e86454bad96079f4e91c0 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 10 Sep 2024 11:37:21 +0200 Subject: [PATCH 32/53] Don't enable runtime linking in debug builds It seems `$(AndroidIncludeDebugSymbols)` isn't defined yet by the time `src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets` is evaluated, so we need to move `$(_AndroidEnableNativeRuntimeLinking)` to src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets in order to disable linking in Debug builds. --- .../targets/Microsoft.Android.Sdk.DefaultProperties.targets | 3 --- src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets index 40ead43dd58..f4b2c338709 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets @@ -52,9 +52,6 @@ When changing this default, change the value of `DefaultZipAlignment` in `src/Xamarin.Android.Build.Tasks/Tasks/AndroidZipAlign.cs` as well --> 16 - - - <_AndroidEnableNativeRuntimeLinking Condition=" '$(_AndroidEnableNativeRuntimeLinking)' == '' and '$(AndroidIncludeDebugSymbols)' != 'true' ">true diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 9279e151ad3..d215888cea3 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -327,6 +327,9 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. False <_AndroidUseMarshalMethods Condition=" '$(AndroidIncludeDebugSymbols)' == 'True' ">False <_AndroidUseMarshalMethods Condition=" '$(AndroidIncludeDebugSymbols)' != 'True' ">$(AndroidEnableMarshalMethods) + + + <_AndroidEnableNativeRuntimeLinking Condition=" '$(_AndroidEnableNativeRuntimeLinking)' == '' and '$(AndroidIncludeDebugSymbols)' != 'true' ">true From 18e8f4c5860d7eddf8ecf57a89cbd5dd100c1d23 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 10 Sep 2024 17:39:59 +0200 Subject: [PATCH 33/53] Temporarily include `libunwind.a` from the NDK toolchain MonoVM requires `libunwind.a` on x86_64. Until the requirement is removed, we'll include the archive. https://github.com/dotnet/runtime/pull/107615 --- .../create-packs/Microsoft.Android.Runtime.proj | 4 ++++ .../xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs | 11 ++++++++++- .../Utilities/NativeRuntimeComponents.cs | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index b6515f43e23..6290f8fc4b7 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -54,6 +54,10 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\crtbegin_so.o" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\crtend_so.o" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libclang_rt.builtins-*-android.a" /> + + + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libunwind.a" /> + diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs b/build-tools/xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs index 832127fdb85..0ec32b455f9 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_Android_SDK_NDK.cs @@ -197,9 +197,18 @@ bool CopyRedistributableFiles (Context context) BuildAndroidPlatforms.NdkMinimumAPI.ToString (CultureInfo.InvariantCulture) ); + string clangArch = Configurables.Defaults.AbiToClangArch[abi]; CopyFile (abi, crtFilesPath, "crtbegin_so.o"); CopyFile (abi, crtFilesPath, "crtend_so.o"); - CopyFile (abi, clangLibPath, $"libclang_rt.builtins-{Configurables.Defaults.AbiToClangArch[abi]}-android.a"); + CopyFile (abi, clangLibPath, $"libclang_rt.builtins-{clangArch}-android.a"); + + // Yay, consistency + if (String.Compare (clangArch, "i686", StringComparison.Ordinal) == 0) { + clangArch = "i386"; + } + + // Remove once https://github.com/dotnet/runtime/pull/107615 is merged and released + CopyFile (abi, Path.Combine (clangLibPath, clangArch), "libunwind.a"); } return true; diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index 8c29c38069c..7374c92e776 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -102,6 +102,11 @@ public NativeRuntimeComponents (ITaskItem[] monoComponents) new ClangBuiltinsArchive ("arm"), new ClangBuiltinsArchive ("i686"), new ClangBuiltinsArchive ("x86_64"), + + // Remove once https://github.com/dotnet/runtime/pull/107615 is merged and released + new Archive ("libunwind.a") { + DontExportSymbols = true, + }, }; // Just the base names of libraries to link into the unified runtime. Must have all the dependencies of all the static archives we From a9b5e3b1518d0452e97f26df5b5ef609b70ea137 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 10 Sep 2024 21:20:00 +0200 Subject: [PATCH 34/53] Use the right version of the LLVM toolchain --- build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs index 3e97615f823..20a10099129 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs @@ -16,6 +16,7 @@ namespace Xamarin.Android.Prepare partial class Configurables { const string BinutilsVersion = "L_18.1.6-8.0.0-1"; + const string MicrosoftOpenJDK17Version = "17.0.12"; const string MicrosoftOpenJDK17Release = "17.0.12"; const string MicrosoftOpenJDK17RootDirName = "jdk-17.0.12+7"; From 3daf433c5391fd6d74903237fa8ead0356d783ff Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 11 Sep 2024 16:03:39 +0200 Subject: [PATCH 35/53] Tweak some tests to run with the unified runtime --- .../Xamarin.Android.Build.Tests/BuildTest2.cs | 5 +++- .../EnvironmentContentTests.cs | 9 +++--- .../Utilities/EnvironmentHelper.cs | 26 ++++++++++++----- .../Tests/BundleToolTests.cs | 29 ++++++++++++------- 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs index 058269ceaa4..dbc61a84604 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs @@ -156,6 +156,9 @@ public void BuildReleaseArm64 ([Values (false, true)] bool forms) proj.SetProperty ("LinkerDumpDependencies", "True"); proj.SetProperty ("AndroidUseAssemblyStore", "False"); + // Make sure that we never use native runtime linking mode in this test. It would generate false negatives in the apkdesc checks. + proj.SetProperty ("_AndroidEnableNativeRuntimeLinking", "False"); + var flavor = (forms ? "XForms" : "Simple") + "DotNet"; var apkDescFilename = $"BuildReleaseArm64{flavor}.apkdesc"; var apkDescReference = "reference.apkdesc"; @@ -319,7 +322,7 @@ public void XA1037PropertyDeprecatedWarning (string property, string value, bool XamarinAndroidProject proj = isBindingProject ? new XamarinAndroidBindingProject () : new XamarinAndroidApplicationProject (); proj.IsRelease = isRelease; proj.SetProperty (property, value); - + using (ProjectBuilder b = isBindingProject ? CreateDllBuilder (Path.Combine ("temp", TestName)) : CreateApkBuilder (Path.Combine ("temp", TestName))) { Assert.IsTrue (b.Build (proj), "Build should have succeeded."); Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, $"The '{property}' MSBuild property is deprecated and will be removed"), diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs index 1d8ff21e199..f35edc43576 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs @@ -15,7 +15,7 @@ public class EnvironmentContentTests : BaseTest { [Test] [NonParallelizable] - public void BuildApplicationWithMonoEnvironment ([Values ("", "Normal", "Offline")] string sequencePointsMode) + public void BuildApplicationWithMonoEnvironment ([Values ("", "Normal", "Offline")] string sequencePointsMode, [Values(false, true)] bool useNativeRuntimeLinkingMode) { const string supportedAbis = "armeabi-v7a;x86"; @@ -38,6 +38,7 @@ public void BuildApplicationWithMonoEnvironment ([Values ("", "Normal", "Offline string linkSkip = "FormsViewGroup"; app.SetProperty ("AndroidLinkSkip", linkSkip); app.SetProperty ("_AndroidSequencePointsMode", sequencePointsMode); + app.SetProperty ("_AndroidEnableNativeRuntimeLinking", useNativeRuntimeLinkingMode.ToString ()); app.SetAndroidSupportedAbis (supportedAbis); using (var libb = CreateDllBuilder (Path.Combine ("temp", TestName, lib.ProjectName))) using (var appb = CreateApkBuilder (Path.Combine ("temp", TestName, app.ProjectName))) { @@ -57,7 +58,7 @@ public void BuildApplicationWithMonoEnvironment ([Values ("", "Normal", "Offline if (!String.IsNullOrEmpty (sequencePointsMode)) Assert.IsTrue (monoDebugVar.IndexOf ("gen-compact-seq-points", StringComparison.Ordinal) >= 0, "The values from Mono.env should have been merged into environment"); - EnvironmentHelper.AssertValidEnvironmentSharedLibrary (intermediateOutputDir, AndroidSdkPath, AndroidNdkPath, supportedAbis); + EnvironmentHelper.AssertValidEnvironmentSharedLibrary (intermediateOutputDir, AndroidSdkPath, AndroidNdkPath, supportedAbis, useNativeRuntimeLinkingMode); var assemblyDir = Path.Combine (Root, appb.ProjectDirectory, app.IntermediateOutputPath, "android", "assets"); var rp = new ReaderParameters { ReadSymbols = false }; @@ -75,7 +76,7 @@ public void BuildApplicationWithMonoEnvironment ([Values ("", "Normal", "Offline } [Test] - public void CheckMonoDebugIsAddedToEnvironment ([Values ("", "Normal", "Offline")] string sequencePointsMode) + public void CheckMonoDebugIsAddedToEnvironment ([Values ("", "Normal", "Offline")] string sequencePointsMode, [Values(false, true)] bool useNativeRuntimeLinkingMode) { const string supportedAbis = "armeabi-v7a;x86"; @@ -101,7 +102,7 @@ public void CheckMonoDebugIsAddedToEnvironment ([Values ("", "Normal", "Offline" Assert.AreEqual ("gen-compact-seq-points", monoDebugVar, "environment should contain MONO_DEBUG=gen-compact-seq-points"); } - EnvironmentHelper.AssertValidEnvironmentSharedLibrary (intermediateOutputDir, AndroidSdkPath, AndroidNdkPath, supportedAbis); + EnvironmentHelper.AssertValidEnvironmentSharedLibrary (intermediateOutputDir, AndroidSdkPath, AndroidNdkPath, supportedAbis, useNativeRuntimeLinkingMode); } } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs index 075f0154f98..600da664c9c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs @@ -456,7 +456,7 @@ public static List GatherEnvironmentFiles (string outputDirecto return environmentFiles; } - public static void AssertValidEnvironmentSharedLibrary (string outputDirectoryRoot, string sdkDirectory, string ndkDirectory, string supportedAbis) + public static void AssertValidEnvironmentSharedLibrary (string outputDirectoryRoot, string sdkDirectory, string ndkDirectory, string supportedAbis, bool nativeRuntimeLinkingModeEnabled) { NdkTools ndk = NdkTools.Create (ndkDirectory); MonoAndroidHelper.AndroidSdk = new AndroidSdkInfo ((arg1, arg2) => {}, sdkDirectory, ndkDirectory, AndroidSdkResolver.GetJavaSdkPath ()); @@ -487,15 +487,25 @@ public static void AssertValidEnvironmentSharedLibrary (string outputDirectoryRo throw new Exception ("Unsupported Android target architecture ABI: " + abi); } - string envSharedLibrary = Path.Combine (outputDirectoryRoot, "app_shared_libraries", abi, "libxamarin-app.so"); - Assert.IsTrue (File.Exists (envSharedLibrary), $"Application environment SharedLibrary '{envSharedLibrary}' must exist"); + if (!nativeRuntimeLinkingModeEnabled) { + string envSharedLibrary = Path.Combine (outputDirectoryRoot, "app_shared_libraries", abi, "libxamarin-app.so"); + Assert.IsTrue (File.Exists (envSharedLibrary), $"Application environment SharedLibrary '{envSharedLibrary}' must exist"); - // API level doesn't matter in this case - var readelf = ndk.GetToolPath ("readelf", arch, 0); - if (!File.Exists (readelf)) { - readelf = ndk.GetToolPath ("llvm-readelf", arch, 0); + // API level doesn't matter in this case + var readelf = ndk.GetToolPath ("readelf", arch, 0); + if (!File.Exists (readelf)) { + readelf = ndk.GetToolPath ("llvm-readelf", arch, 0); + } + AssertSharedLibraryHasRequiredSymbols (envSharedLibrary, readelf); + } else { + string runtimeLibrary = Path.Combine (outputDirectoryRoot, "app_shared_libraries", abi, "libmonodroid-unified.so"); + Assert.IsTrue (File.Exists (runtimeLibrary), $"Application dynamically linked (unified) runtime library '{runtimeLibrary}' must exist"); + + runtimeLibrary = Path.Combine (outputDirectoryRoot, "app_shared_libraries", abi, "libmonodroid-unified.dbg.so"); + Assert.IsTrue (File.Exists (runtimeLibrary), $"Application dynamically linked (unified) runtime library '{runtimeLibrary}' debug symbols must exist"); + + // We can't verify fields in this mode, the symbols aren't exported. } - AssertSharedLibraryHasRequiredSymbols (envSharedLibrary, readelf); } } diff --git a/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs b/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs index 6c61f9fbe70..7edb08ad754 100644 --- a/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs @@ -136,7 +136,7 @@ string [] ListArchiveContents (string archive, bool usesAssembliesBlob) } [Test] - public void BaseZip () + public void BaseZip ([Values(false, true)] bool useNativeRuntimeLinkingMode) { var baseZip = Path.Combine (intermediate, "android", "bin", "base.zip"); var contents = ListArchiveContents (baseZip, usesAssemblyBlobs); @@ -177,15 +177,19 @@ public void BaseZip () } expectedFiles.Add ($"lib/{abi}/libmonodroid.so"); - expectedFiles.Add ($"lib/{abi}/libmonosgen-2.0.so"); - expectedFiles.Add ($"lib/{abi}/libxamarin-app.so"); + if (!useNativeRuntimeLinkingMode) { + // None of these exist if dynamic native runtime linking is enabled + expectedFiles.Add ($"lib/{abi}/libmonosgen-2.0.so"); + expectedFiles.Add ($"lib/{abi}/libxamarin-app.so"); + expectedFiles.Add ($"lib/{abi}/libSystem.IO.Compression.Native.so"); + expectedFiles.Add ($"lib/{abi}/libSystem.Native.so"); + } + if (usesAssemblyBlobs) { expectedFiles.Add ($"{blobEntryPrefix}{abi}/lib_System.Private.CoreLib.dll.so"); } else { expectedFiles.Add ($"lib/{abi}/lib_System.Private.CoreLib.dll.so"); } - expectedFiles.Add ($"lib/{abi}/libSystem.IO.Compression.Native.so"); - expectedFiles.Add ($"lib/{abi}/libSystem.Native.so"); } foreach (var expected in expectedFiles) { CollectionAssert.Contains (contents, expected, $"`{baseZip}` did not contain `{expected}`"); @@ -193,7 +197,7 @@ public void BaseZip () } [Test] - public void AppBundle () + public void AppBundle ([Values(false, true)] bool useNativeRuntimeLinkingMode) { var aab = Path.Combine (intermediate, "android", "bin", $"{app.PackageName}.aab"); FileAssert.Exists (aab); @@ -237,15 +241,20 @@ public void AppBundle () } expectedFiles.Add ($"base/lib/{abi}/libmonodroid.so"); - expectedFiles.Add ($"base/lib/{abi}/libmonosgen-2.0.so"); - expectedFiles.Add ($"base/lib/{abi}/libxamarin-app.so"); + + if (!useNativeRuntimeLinkingMode) { + // None of these exist if dynamic native runtime linking is enabled + expectedFiles.Add ($"base/lib/{abi}/libmonosgen-2.0.so"); + expectedFiles.Add ($"base/lib/{abi}/libxamarin-app.so"); + expectedFiles.Add ($"base/lib/{abi}/libSystem.IO.Compression.Native.so"); + expectedFiles.Add ($"base/lib/{abi}/libSystem.Native.so"); + } + if (usesAssemblyBlobs) { expectedFiles.Add ($"{blobEntryPrefix}{abi}/lib_System.Private.CoreLib.dll.so"); } else { expectedFiles.Add ($"base/lib/{abi}/lib_System.Private.CoreLib.dll.so"); } - expectedFiles.Add ($"base/lib/{abi}/libSystem.IO.Compression.Native.so"); - expectedFiles.Add ($"base/lib/{abi}/libSystem.Native.so"); } foreach (var expected in expectedFiles) { CollectionAssert.Contains (contents, expected, $"`{aab}` did not contain `{expected}`"); From 2f38764e1415e35f4c6b96f467a09294e4ea75f9 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 11 Sep 2024 21:18:07 +0200 Subject: [PATCH 36/53] Instant run is no more --- src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index d215888cea3..9745b0c5f35 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1622,7 +1622,6 @@ because xbuild doesn't support framework reference assemblies. Condition=" '$(_AndroidEnableNativeRuntimeLinking)' == 'true' " BuildTargetAbis="@(_BuildTargetAbis)" NativeSourcesDir="$(_NativeAssemblySourceDir)" - InstantRunEnabled="$(_InstantRunEnabled)" Debug="$(AndroidIncludeDebugSymbols)" Mode="runtime_linking"> From 6c1c742ba951af68ec01772cab1a56dccf43a168 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Thu, 12 Sep 2024 14:45:04 +0200 Subject: [PATCH 37/53] Try to fix some tests --- .../EnvironmentContentTests.cs | 1 + .../IncrementalBuildTest.cs | 58 ++++++++++++++----- .../Tests/BundleToolTests.cs | 28 +++++++-- 3 files changed, 69 insertions(+), 18 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs index f35edc43576..82cc5fb78a4 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs @@ -84,6 +84,7 @@ public void CheckMonoDebugIsAddedToEnvironment ([Values ("", "Normal", "Offline" IsRelease = true, }; proj.SetProperty ("_AndroidSequencePointsMode", sequencePointsMode); + proj.SetProperty ("_AndroidEnableNativeRuntimeLinking", useNativeRuntimeLinkingMode.ToString ()); proj.SetAndroidSupportedAbis (supportedAbis); using (var b = CreateApkBuilder ()) { Assert.IsTrue (b.Build (proj), "Build should have succeeded."); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs index a06312f2fb3..94876152e62 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs @@ -958,8 +958,29 @@ public void CasingOnJavaLangObject () } } + static object[] GenerateJavaStubsAndAssemblyData () => new object[] { + new object[] { + true, // isRelease + true, // useNativeRuntimeLinkingMode + }, + + new object[] { + true, // isRelease + false, // useNativeRuntimeLinkingMode + }, + + new object[] { + false, // isRelease + false, // useNativeRuntimeLinkingMode + }, + + // Configuration for debug build and native runtime linking is not used, since + // runtime linking happens only in release builds + }; + [Test] - public void GenerateJavaStubsAndAssembly ([Values (true, false)] bool isRelease) + [TestCaseSource (nameof (GenerateJavaStubsAndAssemblyData))] + public void GenerateJavaStubsAndAssembly (bool isRelease, bool useNativeRuntimeLinkingMode) { var targets = new [] { "_GenerateJavaStubs", @@ -968,6 +989,7 @@ public void GenerateJavaStubsAndAssembly ([Values (true, false)] bool isRelease) var proj = new XamarinAndroidApplicationProject { IsRelease = isRelease, }; + proj.SetProperty ("_AndroidEnableNativeRuntimeLinking", useNativeRuntimeLinkingMode.ToString ()); proj.SetAndroidSupportedAbis ("armeabi-v7a"); proj.OtherBuildItems.Add (new AndroidItem.AndroidEnvironment ("Foo.txt") { TextContent = () => "Foo=Bar", @@ -978,7 +1000,7 @@ public void GenerateJavaStubsAndAssembly ([Values (true, false)] bool isRelease) foreach (var target in targets) { Assert.IsFalse (b.Output.IsTargetSkipped (target), $"`{target}` should *not* be skipped!"); } - AssertAssemblyFilesInFileWrites (proj, b); + AssertAssemblyFilesInFileWrites (proj, b, useNativeRuntimeLinkingMode); // Change C# file and AndroidEvironment file proj.MainActivity += Environment.NewLine + "// comment"; @@ -988,30 +1010,40 @@ public void GenerateJavaStubsAndAssembly ([Values (true, false)] bool isRelease) foreach (var target in targets) { Assert.IsFalse (b.Output.IsTargetSkipped (target), $"`{target}` should *not* be skipped!"); } - AssertAssemblyFilesInFileWrites (proj, b); + AssertAssemblyFilesInFileWrites (proj, b, useNativeRuntimeLinkingMode); // No changes Assert.IsTrue (b.Build (proj), "third build should have succeeded."); foreach (var target in targets) { Assert.IsTrue (b.Output.IsTargetSkipped (target), $"`{target}` should be skipped!"); } - AssertAssemblyFilesInFileWrites (proj, b); + AssertAssemblyFilesInFileWrites (proj, b, useNativeRuntimeLinkingMode); } } - readonly string [] ExpectedAssemblyFiles = new [] { - Path.Combine ("android", "environment.armeabi-v7a.o"), - Path.Combine ("android", "environment.armeabi-v7a.ll"), - Path.Combine ("android", "typemaps.armeabi-v7a.o"), - Path.Combine ("android", "typemaps.armeabi-v7a.ll"), - Path.Combine ("app_shared_libraries", "armeabi-v7a", "libxamarin-app.so") - }; + List GetExpectedAssemblyFiles (bool useNativeRuntimeLinkingMode) + { + var ret = new List { + Path.Combine ("android", "environment.armeabi-v7a.o"), + Path.Combine ("android", "environment.armeabi-v7a.ll"), + Path.Combine ("android", "typemaps.armeabi-v7a.o"), + Path.Combine ("android", "typemaps.armeabi-v7a.ll") + }; + + if (useNativeRuntimeLinkingMode) { + ret.Add (Path.Combine ("app_shared_libraries", "armeabi-v7a", "libmonodroid-unified.so")); + } else { + ret.Add (Path.Combine ("app_shared_libraries", "armeabi-v7a", "libxamarin-app.so")); + } + + return ret; + } - void AssertAssemblyFilesInFileWrites (XamarinAndroidApplicationProject proj, ProjectBuilder b) + void AssertAssemblyFilesInFileWrites (XamarinAndroidApplicationProject proj, ProjectBuilder b, bool useNativeRuntimeLinkingMode) { var intermediate = Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath); var lines = File.ReadAllLines (Path.Combine (intermediate, $"{proj.ProjectName}.csproj.FileListAbsolute.txt")); - foreach (var file in ExpectedAssemblyFiles) { + foreach (var file in GetExpectedAssemblyFiles (useNativeRuntimeLinkingMode)) { var path = Path.Combine (intermediate, file); CollectionAssert.Contains (lines, path, $"{file} is not in FileWrites!"); FileAssert.Exists (path); diff --git a/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs b/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs index 7edb08ad754..246f1a0ccd9 100644 --- a/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs @@ -15,8 +15,23 @@ namespace Xamarin.Android.Build.Tests public class BundleToolTests : DeviceTest { static readonly object[] FixtureArgs = { - new object[] { false }, - new object[] { true }, + new object[] { + false, // useAssemblyBlobs + false, // useNativeRuntimeLinkingMode + }, + + new object[] { + true, // useAssemblyBlobs + false, // useNativeRuntimeLinkingMode + }, + + new object[] { + true, // useAssemblyBlobs + true, // useNativeRuntimeLinkingMode + }, + + // There's no point in testing further combinations of the two parameters, the tests + // wouldn't actually differ. }; static readonly string [] Abis = new [] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" }; @@ -26,6 +41,7 @@ public class BundleToolTests : DeviceTest string intermediate; string bin; bool usesAssemblyBlobs; + bool useNativeRuntimeLinkingMode; // Disable split by language const string BuildConfig = @"{ @@ -46,9 +62,10 @@ public class BundleToolTests : DeviceTest } }"; - public BundleToolTests (bool usesAssemblyBlobs) + public BundleToolTests (bool usesAssemblyBlobs, bool useNativeRuntimeLinkingMode) { this.usesAssemblyBlobs = usesAssemblyBlobs; + this.useNativeRuntimeLinkingMode = useNativeRuntimeLinkingMode; } [OneTimeSetUp] @@ -97,6 +114,7 @@ public void OneTimeSetUp () app.SetAndroidSupportedAbis (Abis); app.SetProperty ("AndroidBundleConfigurationFile", "buildConfig.json"); app.SetProperty ("AndroidUseAssemblyStore", usesAssemblyBlobs.ToString ()); + app.SetProperty ("_AndroidEnableNativeRuntimeLinking", useNativeRuntimeLinkingMode.ToString ()); libBuilder = CreateDllBuilder (Path.Combine (path, lib.ProjectName), cleanupOnDispose: true); Assert.IsTrue (libBuilder.Build (lib), "Library build should have succeeded."); @@ -136,7 +154,7 @@ string [] ListArchiveContents (string archive, bool usesAssembliesBlob) } [Test] - public void BaseZip ([Values(false, true)] bool useNativeRuntimeLinkingMode) + public void BaseZip () { var baseZip = Path.Combine (intermediate, "android", "bin", "base.zip"); var contents = ListArchiveContents (baseZip, usesAssemblyBlobs); @@ -197,7 +215,7 @@ public void BaseZip ([Values(false, true)] bool useNativeRuntimeLinkingMode) } [Test] - public void AppBundle ([Values(false, true)] bool useNativeRuntimeLinkingMode) + public void AppBundle () { var aab = Path.Combine (intermediate, "android", "bin", $"{app.PackageName}.aab"); FileAssert.Exists (aab); From a0c671f7472b6bc6e28e6dccafcb47c3941ee6e7 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Fri, 13 Sep 2024 13:02:59 +0200 Subject: [PATCH 38/53] _LinkNativeRuntime must be called earlier Otherwise `` in `_CompileNativeAssemblySources` won't actually get written to the cache and the `GenerateJavaStubsAndAssembly` test fails. --- src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 9745b0c5f35..04acabd6083 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1880,6 +1880,7 @@ because xbuild doesn't support framework reference assemblies. <_CompileToDalvikDependsOnTargets> _CompileJava; _CreateApplicationSharedLibraries; + _LinkNativeRuntime; _GetMonoPlatformJarPath; _GetLibraryImports; _SetProguardMappingFileProperty; From 6f06c21483dbd2fa445890a8de0eec6a2879e4f2 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Fri, 13 Sep 2024 17:58:19 +0200 Subject: [PATCH 39/53] Post-rebase fixups --- src/native/monodroid/internal-pinvokes.cc | 9 --------- src/native/runtime-base/internal-pinvokes.hh | 3 +++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/native/monodroid/internal-pinvokes.cc b/src/native/monodroid/internal-pinvokes.cc index bf56ee0530b..0df3d868715 100644 --- a/src/native/monodroid/internal-pinvokes.cc +++ b/src/native/monodroid/internal-pinvokes.cc @@ -132,15 +132,6 @@ _monodroid_gc_wait_for_bridge_processing () mono_gc_wait_for_bridge_processing (); } -<<<<<<< HEAD -======= -int -_monodroid_get_android_api_level () -{ - return monodroidRuntime.get_android_api_level (); -} - ->>>>>>> badc53112 (Let's see what breaks) void monodroid_clear_gdb_wait () { diff --git a/src/native/runtime-base/internal-pinvokes.hh b/src/native/runtime-base/internal-pinvokes.hh index e8370cbec55..b9175ee4ee3 100644 --- a/src/native/runtime-base/internal-pinvokes.hh +++ b/src/native/runtime-base/internal-pinvokes.hh @@ -15,6 +15,9 @@ extern "C" { int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); + mono_bool _monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up); + mono_bool _monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast); + int _monodroid_get_dns_servers (void **dns_servers_array); unsigned int monodroid_get_log_categories (); int monodroid_get_system_property (const char *name, char **value); int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix); From 71749a990f90245c3d3300e032f658b558a1ea7b Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Fri, 13 Sep 2024 19:15:44 +0200 Subject: [PATCH 40/53] Don't ignore method-less types when scanning They might contain nested types with interesting methods. Doh. --- .../Utilities/PinvokeScanner.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs index f06e90bc1a5..bbce0e6acdb 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PinvokeScanner.cs @@ -67,6 +67,12 @@ void Scan (AndroidTargetArch targetArch, AssemblyDefinition assembly, HashSet pinvokeCache, List pinvokes) { + if (type.HasNestedTypes) { + foreach (TypeDefinition nestedType in type.NestedTypes) { + Scan (targetArch, nestedType, pinvokeCache, pinvokes); + } + } + if (!type.HasMethods) { return; } @@ -87,13 +93,5 @@ void Scan (AndroidTargetArch targetArch, TypeDefinition type, HashSet pi pinvokeCache.Add (key); pinvokes.Add (pinfo); } - - if (!type.HasNestedTypes) { - return; - } - - foreach (TypeDefinition nestedType in type.NestedTypes) { - Scan (targetArch, nestedType, pinvokeCache, pinvokes); - } } } From 6776200dbbef922301c424b10d2d10cb88cf9d32 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Mon, 16 Sep 2024 16:48:45 +0200 Subject: [PATCH 41/53] Let's see if this works --- .../LlvmIrGenerator/LlvmIrGenerator.cs | 45 ++++++++++++++++++- .../LlvmIrGenerator/TypeUtilities.cs | 2 +- .../Utilities/NativeRuntimeComponents.cs | 10 +++-- ...PreservePinvokesNativeAssemblyGenerator.cs | 20 ++++++++- src/native/monodroid/CMakeLists.txt | 5 +++ src/native/monodroid/monodroid-glue.cc | 3 ++ src/native/pinvoke-override/dynamic.cc | 39 +++++++++++++--- .../pinvoke-override/pinvoke-override-api.hh | 5 ++- src/native/pinvoke-override/precompiled.cc | 2 +- 9 files changed, 114 insertions(+), 17 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs index 7844a917192..a45fce3fcd9 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrGenerator.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Globalization; +using System.Reflection; using System.IO; using System.Text; @@ -248,6 +249,12 @@ void WriteGlobalVariables (GeneratorWriteContext context) } } + void WriteVariableReference (GeneratorWriteContext context, LlvmIrVariableReference variable) + { + context.Output.Write (variable.Global ? '@' : '%'); + context.Output.Write (variable.Name); + } + void WriteGlobalVariableStart (GeneratorWriteContext context, LlvmIrGlobalVariable variable) { if (!String.IsNullOrEmpty (variable.Comment)) { @@ -355,6 +362,10 @@ ulong GetAggregateValueElementCount (GeneratorWriteContext context, Type type, o return (uint)((ICollection)value).Count; } + if (type.ImplementsInterface (typeof(ICollection<>))) { + return (ulong)GetCollectionOfTCount (type, value); + } + throw new InvalidOperationException ($"Internal error: should never get here"); } @@ -732,6 +743,11 @@ public void WriteValue (GeneratorWriteContext context, Type type, object? value) throw new NotSupportedException ($"Internal error: array of type {type} is unsupported"); } + if (type == typeof (LlvmIrVariableReference) || type.IsSubclassOf (typeof (LlvmIrVariableReference))) { + WriteVariableReference (context, (LlvmIrVariableReference)value); + return; + } + throw new NotSupportedException ($"Internal error: value type '{type}' is unsupported"); } @@ -940,8 +956,19 @@ void WriteArrayValue (GeneratorWriteContext context, LlvmIrVariable variable) list.Add (kvp.Value); } entries = list; - } else { + } else if (variable.Type.ImplementsInterface (typeof (ICollection))) { entries = (ICollection)variable.Value; + } else if (variable.Type.ImplementsInterface (typeof (ICollection<>))) { + // This is slow and messy, but should work for a wide range of types without us having to add + // any explicit support + Type elementType = variable.Type.GetArrayElementType (); + int elementCount = GetCollectionOfTCount (variable.Type, variable.Value); + Array array = Array.CreateInstance (elementType, elementCount); + MethodInfo copyTo = variable.Type.GetMethod ("CopyTo", new Type[] { array.GetType (), typeof (int) }); + copyTo.Invoke (variable.Value, new object[] { array, (int)0 }); + entries = array; + } else { + throw new NotSupportedException ($"Unsupported array value type '{variable.Type}'"); } if (entries.Count == 0) { @@ -1617,5 +1644,21 @@ public static string QuoteString (byte[] bytes, int byteCount, out ulong stringS return QuoteStringNoEscape (sb.ToString ()); } + + static int GetCollectionOfTCount (Type type, object instance) + { + if (!type.ImplementsInterface (typeof (ICollection<>))) { + throw new ArgumentException ("Must implement the ICollection interface", nameof (type)); + } + + PropertyInfo countProperty = type.GetProperty ("Count"); + var ret = (int)countProperty.GetValue (instance); + + if (ret < 0) { + throw new InvalidOperationException ($"Collection count is negative: {ret}"); + } + + return ret; + } } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/TypeUtilities.cs b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/TypeUtilities.cs index 8865238bff0..eec6dd7a771 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/TypeUtilities.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/TypeUtilities.cs @@ -178,7 +178,7 @@ public static bool IsArray (this Type t) // TODO: cache results here // IDictionary is a special case for name:value string arrays which we use for some constructs. - return (t.ImplementsInterface (typeof(ICollection<>)) && t.ImplementsInterface (typeof(ICollection))) || + return (t.ImplementsInterface (typeof(ICollection<>)) || t.ImplementsInterface (typeof(ICollection))) || t.ImplementsInterface (typeof(IDictionary)); } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index 7374c92e776..4ef62494619 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -10,17 +10,19 @@ class NativeRuntimeComponents internal class Archive { public readonly string Name; + public readonly string JniOnLoadName; public bool Include => shouldInclude (this); public readonly bool WholeArchive; public bool DontExportSymbols { get; set; } Func shouldInclude; - public Archive (string name, Func? include = null, bool wholeArchive = false) + public Archive (string name, Func? include = null, bool wholeArchive = false, string? jniOnLoadName = null) { Name = name; shouldInclude = include == null ? ((Archive arch) => true) : include; WholeArchive = wholeArchive; + JniOnLoadName = jniOnLoadName; } } @@ -52,8 +54,8 @@ public AndroidArchive (string name) sealed class BclArchive : Archive { - public BclArchive (string name, bool wholeArchive = false) - : base (name, wholeArchive: wholeArchive) + public BclArchive (string name, bool wholeArchive = false, string? jniOnLoadName = null) + : base (name, wholeArchive: wholeArchive, jniOnLoadName: jniOnLoadName) { DontExportSymbols = true; } @@ -87,7 +89,7 @@ public NativeRuntimeComponents (ITaskItem[] monoComponents) new BclArchive ("libSystem.Globalization.Native.a"), new BclArchive ("libSystem.IO.Compression.Native.a"), new BclArchive ("libSystem.Native.a"), - new BclArchive ("libSystem.Security.Cryptography.Native.Android.a"), + new BclArchive ("libSystem.Security.Cryptography.Native.Android.a", jniOnLoadName: "AndroidCryptoNative_InitLibraryOnLoad"), // .NET for Android new AndroidArchive ("libpinvoke-override-dynamic-release.a"), diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs index 0a5d08c7828..8363cd925c4 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs @@ -100,7 +100,8 @@ protected override void Construct (LlvmIrModule module) } Log.LogDebugMessage (" Looking for enabled native components"); - var componentNames = new List (); + var componentNames = new HashSet (StringComparer.Ordinal); + var jniOnLoadNames = new HashSet (StringComparer.Ordinal); var nativeComponents = new NativeRuntimeComponents (monoComponents); foreach (NativeRuntimeComponents.Archive archiveItem in nativeComponents.KnownArchives) { if (!archiveItem.Include) { @@ -109,6 +110,9 @@ protected override void Construct (LlvmIrModule module) Log.LogDebugMessage ($" {archiveItem.Name}"); componentNames.Add (archiveItem.Name); + if (!String.IsNullOrEmpty (archiveItem.JniOnLoadName)) { + jniOnLoadNames.Add (archiveItem.JniOnLoadName); + } } if (componentNames.Count == 0) { @@ -116,6 +120,18 @@ protected override void Construct (LlvmIrModule module) return; } + module.AddGlobalVariable ("__jni_on_load_handler_count", (uint)jniOnLoadNames.Count, LlvmIrVariableOptions.GlobalConstant); + var jniOnLoadPointers = new List (); + foreach (string name in jniOnLoadNames) { + jniOnLoadPointers.Add (new LlvmIrGlobalVariableReference (name)); + + // Just a dummy declaration, we don't care about the arguments + var funcSig = new LlvmIrFunctionSignature (name, returnType: typeof(void)); + var _ = module.DeclareExternalFunction (funcSig); + } + module.AddGlobalVariable ("__jni_on_load_handlers", jniOnLoadPointers, LlvmIrVariableOptions.GlobalConstant); + module.AddGlobalVariable ("__jni_on_load_handler_names", jniOnLoadNames, LlvmIrVariableOptions.GlobalConstant); + bool is64Bit = state.TargetArch switch { AndroidTargetArch.Arm64 => true, AndroidTargetArch.X86_64 => true, @@ -304,7 +320,7 @@ LlvmIrFunctionAttributeSet MakeFindPinvokeAttributeSet (LlvmIrModule module) // Returns `true` for all p/invokes that we know are part of our set of components, otherwise returns `false`. // Returning `false` merely means that the p/invoke isn't in any of BCL or our code and therefore we shouldn't // care. It doesn't mean the p/invoke will be removed in any way. - bool MustPreserve (PinvokeScanner.PinvokeEntryInfo pinfo, List components) + bool MustPreserve (PinvokeScanner.PinvokeEntryInfo pinfo, ICollection components) { if (String.Compare ("xa-internal-api", pinfo.LibraryName, StringComparison.Ordinal) == 0) { return true; diff --git a/src/native/monodroid/CMakeLists.txt b/src/native/monodroid/CMakeLists.txt index 9733766892b..c7aa57e03f5 100644 --- a/src/native/monodroid/CMakeLists.txt +++ b/src/native/monodroid/CMakeLists.txt @@ -149,6 +149,11 @@ if(BUILD_STATIC_LIBRARY) ${XAMARIN_MONODROID_SOURCES} ) set_static_library_suffix(${XAMARIN_MONO_ANDROID_STATIC_LIB}) + target_compile_definitions( + ${XAMARIN_MONO_ANDROID_STATIC_LIB} + PRIVATE + DYNAMIC_RUNTIME_LINKING + ) endif() macro(lib_target_options TARGET_NAME) diff --git a/src/native/monodroid/monodroid-glue.cc b/src/native/monodroid/monodroid-glue.cc index cd8d899a35d..61ec4f388ee 100644 --- a/src/native/monodroid/monodroid-glue.cc +++ b/src/native/monodroid/monodroid-glue.cc @@ -351,6 +351,9 @@ MonodroidRuntime::Java_JNI_OnLoad (JavaVM *vm, [[maybe_unused]] void *reserved) vm->GetEnv ((void**)&env, JNI_VERSION_1_6); osBridge.initialize_on_onload (vm, env); +#if defined(DYNAMIC_RUNTIME_LINKING) + PinvokeOverride::handle_jni_on_load (vm, reserved); +#endif return JNI_VERSION_1_6; } diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc index 7f87681e86c..4c7941484c8 100644 --- a/src/native/pinvoke-override/dynamic.cc +++ b/src/native/pinvoke-override/dynamic.cc @@ -1,4 +1,5 @@ #include +#include #define PINVOKE_OVERRIDE_INLINE [[gnu::noinline]] #include "pinvoke-override-api-impl.hh" @@ -9,17 +10,26 @@ using namespace xamarin::android::internal; // // This is generated during application build (see obj/${CONFIGURATION}/${RID}/android/pinvoke_preserve.*.ll) // -extern "C" void* find_pinvoke (hash_t library_name_hash, hash_t entrypoint_hash, bool &known_library); +using JniOnLoadHandler = jint (*) (JavaVM *vm, void *reserved); + +extern "C" { + void* find_pinvoke (hash_t library_name_hash, hash_t entrypoint_hash, bool &known_library); + + extern const uint32_t __jni_on_load_handler_count; + extern const JniOnLoadHandler __jni_on_load_handlers[]; + extern const char* __jni_on_load_handler_names[]; +} [[gnu::flatten]] void* -PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) +PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) noexcept { log_debug (LOG_ASSEMBLY, __PRETTY_FUNCTION__); log_debug (LOG_ASSEMBLY, "library_name == '%s'; entrypoint_name == '%s'", library_name, entrypoint_name); - if (library_name == nullptr || entrypoint_name == nullptr) { - return nullptr; + if (library_name == nullptr || entrypoint_name == nullptr) [[unlikely]] { + log_fatal (LOG_ASSEMBLY, "Both library name ('%s') and entry point name ('%s') must be specified", library_name, entrypoint_name); + Helpers::abort_application (); } hash_t library_name_hash = xxhash::hash (library_name, strlen (library_name)); @@ -28,7 +38,8 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha bool known_library = true; void *pinvoke_ptr = find_pinvoke (library_name_hash, entrypoint_hash, known_library); - if (pinvoke_ptr != nullptr) { + if (pinvoke_ptr != nullptr) [[likely]] { + log_debug (LOG_ASSEMBLY, "pinvoke_ptr == %p", pinvoke_ptr); return pinvoke_ptr; } @@ -39,12 +50,26 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha // the find* functions didn't know its hash), but we cannot be sure of that so we'll try to load it. pinvoke_ptr = dlsym (RTLD_DEFAULT, entrypoint_name); if (pinvoke_ptr == nullptr) { - log_warn (LOG_ASSEMBLY, "Unable to load p/invoke entry '%s/%s' from the unified runtime DSO", library_name, entrypoint_name); + log_fatal (LOG_ASSEMBLY, "Unable to load p/invoke entry '%s/%s' from the unified runtime DSO", library_name, entrypoint_name); + Helpers::abort_application (); } return pinvoke_ptr; } log_debug (LOG_ASSEMBLY, "p/invoke not from a known library, slow path taken."); - return handle_other_pinvoke_request (library_name, library_name_hash, entrypoint_name, entrypoint_hash);; + pinvoke_ptr = handle_other_pinvoke_request (library_name, library_name_hash, entrypoint_name, entrypoint_hash);; + log_debug (LOG_ASSEMBLY, "foreign library pinvoke_ptr == %p", pinvoke_ptr); + return pinvoke_ptr; +} + +void PinvokeOverride::handle_jni_on_load (JavaVM *vm, void *reserved) noexcept +{ + if (__jni_on_load_handler_count == 0) { + return; + } + + for (uint32_t i = 0; i < __jni_on_load_handler_count; i++) { + __jni_on_load_handlers[i] (vm, reserved); + } } diff --git a/src/native/pinvoke-override/pinvoke-override-api.hh b/src/native/pinvoke-override/pinvoke-override-api.hh index 445f8cccf0b..5ac5b449a8e 100644 --- a/src/native/pinvoke-override/pinvoke-override-api.hh +++ b/src/native/pinvoke-override/pinvoke-override-api.hh @@ -2,6 +2,8 @@ #include +#include + #include "cppcompat.hh" #include "xxhash.hh" @@ -75,7 +77,8 @@ namespace xamarin::android { static void* fetch_or_create_pinvoke_map_entry (std::string const& library_name, std::string const& entrypoint_name, hash_t entrypoint_name_hash, pinvoke_api_map_ptr api_map, bool need_lock) noexcept; static PinvokeEntry* find_pinvoke_address (hash_t hash, const PinvokeEntry *entries, size_t entry_count) noexcept; static void* handle_other_pinvoke_request (const char *library_name, hash_t library_name_hash, const char *entrypoint_name, hash_t entrypoint_name_hash) noexcept; - static void* monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name); + static void* monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) noexcept; + static void handle_jni_on_load (JavaVM *vm, void *reserved) noexcept; private: static xamarin::android::mutex pinvoke_map_write_lock; diff --git a/src/native/pinvoke-override/precompiled.cc b/src/native/pinvoke-override/precompiled.cc index 1c84095080a..0b57f105169 100644 --- a/src/native/pinvoke-override/precompiled.cc +++ b/src/native/pinvoke-override/precompiled.cc @@ -9,7 +9,7 @@ using namespace xamarin::android; [[gnu::flatten]] void* -PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) +PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) noexcept { if (library_name == nullptr || entrypoint_name == nullptr) { return nullptr; From dd9fbba4077485b5423925ac9f9d1628d14beab9 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 17 Sep 2024 14:09:18 +0200 Subject: [PATCH 42/53] Mono.Android-Tests might work now --- ...icrosoft.Android.Sdk.NativeRuntime.targets | 2 ++ .../Tasks/GetNativeRuntimeComponents.cs | 14 +++++++++++ .../Tasks/LinkNativeRuntime.cs | 6 ++++- .../Utilities/NativeLinker.cs | 8 ++++++- .../Utilities/NativeRuntimeComponents.cs | 19 ++++++++++++++- ...PreservePinvokesNativeAssemblyGenerator.cs | 23 +++++++++++++++---- src/native/pinvoke-override/dynamic.cc | 10 ++++++++ 7 files changed, 75 insertions(+), 7 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets index 1fb3f06d397..7731480d2f9 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets @@ -32,6 +32,7 @@ Contains code to build and link the native runtime at application build time. + @@ -48,6 +49,7 @@ Contains code to build and link the native runtime at application build time. NativeObjectFiles="@(_NativeAssemblyTarget)" NativeLinkStartFiles="@(_NativeLinkStartFiles)" NativeLinkEndFiles="@(_NativeLinkEndFiles)" + NativeSymbolsToExport="@(_NativeSymbolsToExport)" LinkLibraries="@(_RequiredLinkLibraries)" OutputRuntimes="@(_UnifiedNativeRuntime)" SupportedAbis="@(_BuildTargetAbis)" diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs index 27690f8c89c..0f6587035f0 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetNativeRuntimeComponents.cs @@ -32,19 +32,33 @@ public class GetNativeRuntimeComponents : AndroidTask [Output] public ITaskItem[] LinkEndFiles { get; set; } + // TODO: more research, for now it seems `--export-dynamic-symbol=name` options generated from + // this array don't work as expected. + [Output] + public ITaskItem[] NativeSymbolsToExport { get; set; } + public override bool RunTask () { var components = new NativeRuntimeComponents (MonoComponents); var uniqueAbis = new HashSet (StringComparer.OrdinalIgnoreCase); var archives = new List (); + var symbolsToExport = new List (); foreach (NativeRuntimeComponents.Archive archiveItem in components.KnownArchives) { if (!archiveItem.Include) { continue; } MakeArchiveItem (archiveItem, archives, uniqueAbis); + if (archiveItem.SymbolsToPreserve == null || archiveItem.SymbolsToPreserve.Count == 0) { + continue; + } + + foreach (string symbolName in archiveItem.SymbolsToPreserve) { + MakeLibItem (symbolName, symbolsToExport, uniqueAbis); + } } NativeArchives = archives.ToArray (); + NativeSymbolsToExport = symbolsToExport.ToArray (); var items = new List (); foreach (string lib in components.NativeLibraries) { diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs index d0092855d47..034066c77b6 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs @@ -36,6 +36,9 @@ public class LinkNativeRuntime : AsyncTask [Required] public ITaskItem[] NativeLinkEndFiles { get; set; } + [Required] + public ITaskItem[] NativeSymbolsToExport { get; set; } + [Required] public ITaskItem[] OutputRuntimes { get; set; } @@ -68,7 +71,8 @@ void LinkRuntime (ITaskItem abiItem) GetAbiItems (NativeArchives, "_SelectedNativeArchive", abi), GetAbiItems (LinkLibraries, "_RequiredLinkLibraries", abi), GetAbiItems (NativeLinkStartFiles, "_NativeLinkStartFiles", abi), - GetAbiItems (NativeLinkEndFiles, "_NativeLinkEndFiles", abi) + GetAbiItems (NativeLinkEndFiles, "_NativeLinkEndFiles", abi), + GetAbiItems (NativeSymbolsToExport, "_NativeSymbolsToExport", abi) ); } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index a46041dae44..8e8b5b2ec29 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -100,7 +100,7 @@ public NativeLinker (TaskLoggingHelper log, string abi, string soname, string bi } public bool Link (ITaskItem outputLibraryPath, List objectFiles, List archives, List libraries, - List linkStartFiles, List linkEndFiles) + List linkStartFiles, List linkEndFiles, ICollection? exportDynamicSymbols = null) { log.LogDebugMessage ($"Linking: {outputLibraryPath}"); EnsureCorrectAbi (outputLibraryPath); @@ -132,6 +132,12 @@ public bool Link (ITaskItem outputLibraryPath, List objectFiles, List WriteFilesToResponseFile (sw, objectFiles); WriteFilesToResponseFile (sw, archives); + if (exportDynamicSymbols != null && exportDynamicSymbols.Count > 0) { + foreach (ITaskItem symbolItem in exportDynamicSymbols) { + sw.WriteLine ($"--export-dynamic-symbol={symbolItem.ItemSpec}"); + } + } + if (excludeExportsLibs.Count > 0) { string libs = String.Join (",", excludeExportsLibs); sw.WriteLine ($"--exclude-libs={libs}"); diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs index 4ef62494619..b75e80d3977 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs @@ -14,6 +14,7 @@ internal class Archive public bool Include => shouldInclude (this); public readonly bool WholeArchive; public bool DontExportSymbols { get; set; } + public HashSet? SymbolsToPreserve { get; set; } Func shouldInclude; @@ -89,7 +90,23 @@ public NativeRuntimeComponents (ITaskItem[] monoComponents) new BclArchive ("libSystem.Globalization.Native.a"), new BclArchive ("libSystem.IO.Compression.Native.a"), new BclArchive ("libSystem.Native.a"), - new BclArchive ("libSystem.Security.Cryptography.Native.Android.a", jniOnLoadName: "AndroidCryptoNative_InitLibraryOnLoad"), + new BclArchive ("libSystem.Security.Cryptography.Native.Android.a", jniOnLoadName: "AndroidCryptoNative_InitLibraryOnLoad") { + SymbolsToPreserve = new (StringComparer.Ordinal) { + // This isn't referenced directly by any code in libSystem.Security.Cryptography.Native.Android. It is instead + // referenced by the Java code shipped with the component (`DotnetProxyTrustManager`), as a native Java method: + // + // static native boolean verifyRemoteCertificate(long sslStreamProxyHandle); + // + // Therefore we must reference it explicitly + "Java_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate" + }, + + // For now, we have to export all the symbols from this archive because we need the above `Java_net*` symbol to be + // externally visible, and the linker's `--exclude-libs` flag works on the archive (.a) level. + // + // TODO: use `llvm-ar` to extract the relevant object file and link it separately? + DontExportSymbols = false, + }, // .NET for Android new AndroidArchive ("libpinvoke-override-dynamic-release.a"), diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs index 8363cd925c4..4517518ce72 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs @@ -102,6 +102,7 @@ protected override void Construct (LlvmIrModule module) Log.LogDebugMessage (" Looking for enabled native components"); var componentNames = new HashSet (StringComparer.Ordinal); var jniOnLoadNames = new HashSet (StringComparer.Ordinal); + var symbolsToExplicitlyPreserve = new HashSet (); var nativeComponents = new NativeRuntimeComponents (monoComponents); foreach (NativeRuntimeComponents.Archive archiveItem in nativeComponents.KnownArchives) { if (!archiveItem.Include) { @@ -113,6 +114,15 @@ protected override void Construct (LlvmIrModule module) if (!String.IsNullOrEmpty (archiveItem.JniOnLoadName)) { jniOnLoadNames.Add (archiveItem.JniOnLoadName); } + + if (archiveItem.SymbolsToPreserve == null || archiveItem.SymbolsToPreserve.Count == 0) { + continue; + } + + foreach (string symbolName in archiveItem.SymbolsToPreserve) { + symbolsToExplicitlyPreserve.Add (new LlvmIrGlobalVariableReference (symbolName)); + DeclareDummyFunction (module, symbolName); + } } if (componentNames.Count == 0) { @@ -124,13 +134,11 @@ protected override void Construct (LlvmIrModule module) var jniOnLoadPointers = new List (); foreach (string name in jniOnLoadNames) { jniOnLoadPointers.Add (new LlvmIrGlobalVariableReference (name)); - - // Just a dummy declaration, we don't care about the arguments - var funcSig = new LlvmIrFunctionSignature (name, returnType: typeof(void)); - var _ = module.DeclareExternalFunction (funcSig); + DeclareDummyFunction (module, name); } module.AddGlobalVariable ("__jni_on_load_handlers", jniOnLoadPointers, LlvmIrVariableOptions.GlobalConstant); module.AddGlobalVariable ("__jni_on_load_handler_names", jniOnLoadNames, LlvmIrVariableOptions.GlobalConstant); + module.AddGlobalVariable ("__explicitly_preserved_symbols", symbolsToExplicitlyPreserve, LlvmIrVariableOptions.GlobalConstant); bool is64Bit = state.TargetArch switch { AndroidTargetArch.Arm64 => true, @@ -360,4 +368,11 @@ bool Matches (string libraryName, string componentName) return String.Compare (libraryName, componentName, StringComparison.Ordinal) == 0; } } + + static void DeclareDummyFunction (LlvmIrModule module, string name) + { + // Just a dummy declaration, we don't care about the arguments + var funcSig = new LlvmIrFunctionSignature (name, returnType: typeof(void)); + var _ = module.DeclareExternalFunction (funcSig); + } } diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc index 4c7941484c8..97111118621 100644 --- a/src/native/pinvoke-override/dynamic.cc +++ b/src/native/pinvoke-override/dynamic.cc @@ -18,6 +18,7 @@ extern "C" { extern const uint32_t __jni_on_load_handler_count; extern const JniOnLoadHandler __jni_on_load_handlers[]; extern const char* __jni_on_load_handler_names[]; + extern const void* __explicitly_preserved_symbols[]; } [[gnu::flatten]] @@ -72,4 +73,13 @@ void PinvokeOverride::handle_jni_on_load (JavaVM *vm, void *reserved) noexcept for (uint32_t i = 0; i < __jni_on_load_handler_count; i++) { __jni_on_load_handlers[i] (vm, reserved); } + + // This is just to reference the generated array, all we need from it is to be there + // TODO: see if there's an attribute we can use to make the linker keep the symbol instead. + // void *first_ptr = __explicitly_preserved_symbols; + // if (first_ptr == nullptr) { + // // This will never actually be logged, since by the time this function is called we haven't initialized + // // logging categories yet. It's here just to have some code in the if statement body. + // log_debug (LOG_ASSEMBLY, "No explicitly preserved symbols"); + // } } From 0025d34517c8a77af0010c70866fda95db6b26aa Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 17 Sep 2024 17:24:01 +0200 Subject: [PATCH 43/53] This might fix the GenerateJavaStubsAndAssembly test --- .../Microsoft.Android.Sdk.NativeRuntime.targets | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets index 7731480d2f9..983186b7411 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeRuntime.targets @@ -10,7 +10,8 @@ Contains code to build and link the native runtime at application build time. - + <_UnifiedNativeRuntime Include="$(_AndroidApplicationSharedLibraryPath)%(_BuildTargetAbis.Identity)\libmonodroid-unified.so"> %(_BuildTargetAbis.Identity) @@ -53,7 +54,10 @@ Contains code to build and link the native runtime at application build time. LinkLibraries="@(_RequiredLinkLibraries)" OutputRuntimes="@(_UnifiedNativeRuntime)" SupportedAbis="@(_BuildTargetAbis)" - SaveDebugSymbols="true" - /> + SaveDebugSymbols="true" /> + + + + From 4dee5991e04ce51dc4efd3696cb75baf0c672ea9 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 18 Sep 2024 11:40:55 +0200 Subject: [PATCH 44/53] AOT profiling won't work with dynamic runtime linking Unconditionally disable dynamic linking in the AOT profiling test --- tests/MSBuildDeviceIntegration/Tests/AotProfileTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/MSBuildDeviceIntegration/Tests/AotProfileTests.cs b/tests/MSBuildDeviceIntegration/Tests/AotProfileTests.cs index bbc15d40d64..a0451b4bd71 100644 --- a/tests/MSBuildDeviceIntegration/Tests/AotProfileTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/AotProfileTests.cs @@ -33,6 +33,12 @@ public void BuildBasicApplicationAndAotProfileIt () }; proj.SetAndroidSupportedAbis (DeviceAbi); + // Currently, AOT profiling won't work with dynamic runtime linking because the `libmono-profiler-aot.so` library from + // the `mono.aotprofiler.android` package depends on `libmonosgen-2.0.so` which, when dynamic linking is enabled, simply + // doesn't exist (it's linked statically into `libmonodroid.so`). AOT profiler would have to have a static library in + // the nuget in order for us to support profiling in this mode. + proj.SetProperty ("_AndroidEnableNativeRuntimeLinking", "False"); + // TODO: only needed in .NET 6+ // See https://github.com/dotnet/runtime/issues/56989 proj.PackageReferences.Add (KnownPackages.Mono_AotProfiler_Android); From d216289430ae85915f50abcf9ea06636981e3726 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 1 Oct 2024 12:35:35 +0200 Subject: [PATCH 45/53] Fix some post-rebase errors --- src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 04acabd6083..f4534c164be 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1522,7 +1522,7 @@ because xbuild doesn't support framework reference assemblies. LinkingEnabled="$(_LinkingEnabled)" HaveMultipleRIDs="$(_HaveMultipleRIDs)" IntermediateOutputDirectory="$(IntermediateOutputPath)" - Environments="@(_EnvironmentFiles)"> + Environments="@(_EnvironmentFiles)" EnableNativeRuntimeLinking="$(_AndroidEnableNativeRuntimeLinking)"> From cb678cfd517d071e5c552003162b22a11dd8a5aa Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 2 Oct 2024 17:43:04 +0200 Subject: [PATCH 46/53] Don't package BCL libraries when linking dynamically --- .../Tasks/ProcessNativeLibraries.cs | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ProcessNativeLibraries.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessNativeLibraries.cs index d37962b0162..bf5f8169595 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ProcessNativeLibraries.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessNativeLibraries.cs @@ -22,6 +22,19 @@ public class ProcessNativeLibraries : AndroidTask "libxamarin-debug-app-helper", }; + // Please keep the list sorted. Any new runtime libraries that are added upstream need to be mentioned here. + static readonly HashSet KnownRuntimeNativeLibraries = new (StringComparer.OrdinalIgnoreCase) { + "libSystem.Globalization.Native.so", + "libSystem.IO.Compression.Native.so", + "libSystem.Native.so", + "libSystem.Security.Cryptography.Native.Android.so", + "libmono-component-debugger.so", + "libmono-component-diagnostics_tracing.so", + "libmono-component-hot_reload.so", + "libmono-component-marshal-ilgen.so", + "libmonosgen-2.0.so", + }; + /// /// Assumed to be .so files only /// @@ -93,12 +106,27 @@ public override bool RunTask () continue; } - output.Add (library); + if (!IgnoreLibraryWhenLinkingRuntime (library)) { + output.Add (library); + } } OutputLibraries = output.ToArray (); return !Log.HasLoggedErrors; } + + bool IgnoreLibraryWhenLinkingRuntime (ITaskItem libItem) + { + // We ignore all the shared libraries coming from the runtime packages, as they are all linked into our runtime and + // need not be packaged. + string packageId = libItem.GetMetadata ("NuGetPackageId"); + if (packageId.StartsWith ("Microsoft.NETCore.App.Runtime.Mono.android-", StringComparison.OrdinalIgnoreCase)) { + return true; + } + + // Should `NuGetPackageId` be empty, we check the libs by name, as the last resort. + return KnownRuntimeNativeLibraries.Contains (Path.GetFileName (libItem.ItemSpec)); + } } } From f25989fc2a7a3a4ee0bd080e03beca87c4a065ba Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 2 Oct 2024 18:00:32 +0200 Subject: [PATCH 47/53] Add some debug messages --- src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs index 9438acbd6ad..49aa7d3cae8 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs @@ -689,6 +689,7 @@ private void AddNativeLibraries (ArchiveFileList files, string [] supportedAbis) Item = v, }); + Log.LogDebugMessage ("BuildApk: adding framework native libraries"); AddNativeLibraries (files, supportedAbis, frameworkLibs); var libs = NativeLibraries.Concat (BundleNativeLibraries ?? Enumerable.Empty ()) @@ -702,6 +703,7 @@ private void AddNativeLibraries (ArchiveFileList files, string [] supportedAbis) } ); + Log.LogDebugMessage ("BuildApk: adding other native libraries"); AddNativeLibraries (files, supportedAbis, libs); if (String.IsNullOrWhiteSpace (CheckedBuild)) @@ -802,6 +804,7 @@ private void AddAdditionalNativeLibraries (ArchiveFileList files, string [] supp void AddNativeLibrary (ArchiveFileList files, string path, string abi, string archiveFileName, ITaskItem? taskItem = null) { + Log.LogDebugMessage ($"BuildApk: adding native library '{path}'; abi '{abi}'; archiveFileName '{archiveFileName}'"); string fileName = string.IsNullOrEmpty (archiveFileName) ? Path.GetFileName (path) : archiveFileName; var item = (filePath: path, archivePath: MakeArchiveLibPath (abi, fileName)); if (files.Any (x => x.archivePath == item.archivePath)) { From fd0406e2365036260947ad4d8a0560569646560d Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Thu, 3 Oct 2024 10:28:26 +0200 Subject: [PATCH 48/53] Accept all the libs when not linking --- .../Tasks/ProcessNativeLibraries.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ProcessNativeLibraries.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessNativeLibraries.cs index bf5f8169595..386909216c6 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ProcessNativeLibraries.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/ProcessNativeLibraries.cs @@ -118,6 +118,10 @@ public override bool RunTask () bool IgnoreLibraryWhenLinkingRuntime (ITaskItem libItem) { + if (!NativeRuntimeLinking) { + return false; + } + // We ignore all the shared libraries coming from the runtime packages, as they are all linked into our runtime and // need not be packaged. string packageId = libItem.GetMetadata ("NuGetPackageId"); From 130514dfba347a2977da25f17bee16e88174ab75 Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Thu, 3 Oct 2024 12:19:10 +0200 Subject: [PATCH 49/53] Make runtime linking an option in the DotNetBuild test Testing just a single configuration, it's enough. --- .../BuildTest.TestCaseSource.cs | 23 +++++++++++++++++++ .../Xamarin.Android.Build.Tests/BuildTest.cs | 14 +++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs index f30f2f2388d..959eb989f47 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs @@ -17,96 +17,119 @@ public partial class BuildTest : BaseTest /* isRelease */ false, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ false, /* aot */ false, /* usesAssemblyStore */ true, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm64", /* isRelease */ false, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-x86", /* isRelease */ false, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-x64", /* isRelease */ false, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ true, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ true, /* aot */ false, /* usesAssemblyStore */ true, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ true, /* aot */ true, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ true, /* aot */ true, /* usesAssemblyStore */ true, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm64", /* isRelease */ true, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ false, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ false, /* aot */ false, /* usesAssemblyStore */ true, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86", /* isRelease */ true, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ true, /* aot */ false, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ true, /* aot */ false, /* usesAssemblyStore */ true, + /* useRuntimeLinking */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ true, /* aot */ true, /* usesAssemblyStore */ false, + /* useRuntimeLinking */ false, + }, + new object [] { + /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", + /* isRelease */ true, + /* aot */ false, + /* usesAssemblyStore */ true, + /* useRuntimeLinking */ true, }, }; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index 8cc76792220..00e310ba055 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -26,8 +26,13 @@ public partial class BuildTest : BaseTest [Category ("SmokeTests")] [TestCaseSource (nameof (DotNetBuildSource))] [NonParallelizable] // On MacOS, parallel /restore causes issues - public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bool usesAssemblyStore) + public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bool usesAssemblyStore, bool useRuntimeLinking) { + if (!isRelease && useRuntimeLinking) { + Assert.Warn ("Dynamic runtime linking is supported only in Release builds, disabling it for this Debug build."); + useRuntimeLinking = false; + } + var proj = new XamarinAndroidApplicationProject { IsRelease = isRelease, EnableDefaultItems = true, @@ -68,6 +73,7 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo .Replace ("//${AFTER_ONCREATE}", @"button.Text = Resource.CancelButton;"); proj.SetProperty ("AndroidUseAssemblyStore", usesAssemblyStore.ToString ()); proj.SetProperty ("RunAOTCompilation", aot.ToString ()); + proj.SetProperty ("_AndroidEnableNativeRuntimeLinking", useRuntimeLinking.ToString ()); proj.OtherBuildItems.Add (new AndroidItem.InputJar ("javaclasses.jar") { BinaryContent = () => ResourceData.JavaSourceJarTestJar, }); @@ -170,7 +176,11 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo helper.AssertContainsEntry ($"assemblies/de-DE/{proj.ProjectName}.resources.dll", shouldContainEntry: expectEmbeddedAssembies); foreach (var abi in rids.Select (AndroidRidAbiHelper.RuntimeIdentifierToAbi)) { helper.AssertContainsEntry ($"lib/{abi}/libmonodroid.so"); - helper.AssertContainsEntry ($"lib/{abi}/libmonosgen-2.0.so"); + + if (!useRuntimeLinking) { + helper.AssertContainsEntry ($"lib/{abi}/libmonosgen-2.0.so"); + } + if (rids.Length > 1) { helper.AssertContainsEntry ($"assemblies/{abi}/System.Private.CoreLib.dll", shouldContainEntry: expectEmbeddedAssembies); } else { From dcf6fb53066a6cf0906ca852861807729572e42a Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Thu, 3 Oct 2024 14:13:18 +0200 Subject: [PATCH 50/53] Don't test dynamic linking in here --- .../Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs index a4ffdb5ca31..61f38a8edd6 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs @@ -413,6 +413,7 @@ public void BuildWithNativeLibraries ([Values (true, false)] bool isRelease) } }; proj.SetRuntimeIdentifiers (["armeabi-v7a", "x86"]); + proj.SetProperty ("_AndroidEnableNativeRuntimeLinking", "False"); var path = Path.Combine (Root, "temp", string.Format ("BuildWithNativeLibraries_{0}", isRelease)); using (var b1 = CreateDllBuilder (Path.Combine (path, dll2.ProjectName))) { Assert.IsTrue (b1.Build (dll2), "Build should have succeeded."); From 3bd5c592cecb04d9430e444a7659e11052473eaf Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 16 Oct 2024 10:46:16 +0200 Subject: [PATCH 51/53] Not needed anymore --- build-tools/create-packs/Microsoft.Android.Runtime.proj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index 6290f8fc4b7..e01e1371b5a 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -42,7 +42,6 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-debug-app-helper.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-native-tracing.so" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libarchive-dso-stub.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libunwind_xamarin-release.a" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libruntime-base-release.a" /> @@ -55,9 +54,6 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\crtend_so.o" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libclang_rt.builtins-*-android.a" /> - - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libunwind.a" /> - From 327687c0c7d370193ec184e8a729fd286aa36d7a Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 16 Oct 2024 11:07:48 +0200 Subject: [PATCH 52/53] Post-rebase fixes --- .../Microsoft.Android.Runtime.proj | 1 - src/native/pinvoke-override/dynamic.cc | 22 ++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index e01e1371b5a..445b761bda4 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -42,7 +42,6 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libmono-android.release.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-debug-app-helper.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxamarin-native-tracing.so" /> - <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libarchive-dso-stub.so" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libunwind_xamarin-release.a" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libruntime-base-release.a" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libxa-java-interop-release.a" /> diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc index 97111118621..0c2219b70da 100644 --- a/src/native/pinvoke-override/dynamic.cc +++ b/src/native/pinvoke-override/dynamic.cc @@ -29,9 +29,15 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha log_debug (LOG_ASSEMBLY, "library_name == '%s'; entrypoint_name == '%s'", library_name, entrypoint_name); if (library_name == nullptr || entrypoint_name == nullptr) [[unlikely]] { - log_fatal (LOG_ASSEMBLY, "Both library name ('%s') and entry point name ('%s') must be specified", library_name, entrypoint_name); - Helpers::abort_application (); - } + Helpers::abort_application ( + LOG_ASSEMBLY, + Util::monodroid_strdup_printf ( + "Both library name ('%s') and entry point name ('%s') must be specified", + library_name, + entrypoint_name + ) + ); + } hash_t library_name_hash = xxhash::hash (library_name, strlen (library_name)); hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); @@ -51,8 +57,14 @@ PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const cha // the find* functions didn't know its hash), but we cannot be sure of that so we'll try to load it. pinvoke_ptr = dlsym (RTLD_DEFAULT, entrypoint_name); if (pinvoke_ptr == nullptr) { - log_fatal (LOG_ASSEMBLY, "Unable to load p/invoke entry '%s/%s' from the unified runtime DSO", library_name, entrypoint_name); - Helpers::abort_application (); + Helpers::abort_application ( + LOG_ASSEMBLY, + Util::monodroid_strdup_printf ( + "Unable to load p/invoke entry '%s/%s' from the unified runtime DSO", + library_name, + entrypoint_name + ) + ); } return pinvoke_ptr; From 81a7369fef8a0b297819adf1cbd583936c8ee77e Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Wed, 16 Oct 2024 14:03:38 +0200 Subject: [PATCH 53/53] Still needed, after all --- build-tools/create-packs/Microsoft.Android.Runtime.proj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index 445b761bda4..a0a99e844c2 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -53,6 +53,9 @@ projects that use the Microsoft.Android framework in .NET 6+. <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\crtend_so.o" /> <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libclang_rt.builtins-*-android.a" /> + + <_AndroidRuntimePackAssets Include="$(MicrosoftAndroidSdkOutDir)lib\$(AndroidRID)\libunwind.a" /> +