diff --git a/dotnet/targets/Microsoft.Sdk.R2R.targets b/dotnet/targets/Microsoft.Sdk.R2R.targets index 71c6f4aff0a..2b38ae39547 100644 --- a/dotnet/targets/Microsoft.Sdk.R2R.targets +++ b/dotnet/targets/Microsoft.Sdk.R2R.targets @@ -1,6 +1,7 @@ + @@ -134,24 +135,27 @@ - + <_CreateR2RFrameworkDependsOn> _CollectR2RObjectFilesForLinking; - _PrepareR2RFrameworkCreation; - _CreateR2RFrameworkStructure; - _ForceLinkR2RFramework; - _LinkR2RFramework; + _PrepareR2RModules; + _RegisterR2RNativeReferences; + _CreateR2RModuleFrameworks; + _GenerateR2RModuleRegistration; - - + <_DesktopFramework Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">true @@ -160,81 +164,85 @@ <_R2RFrameworkBinaryInfix Condition="'$(_DesktopFramework)' == 'true'">/Versions/A <_R2RFrameworkResourcesInfix Condition="'$(_DesktopFramework)' == 'true'">/Versions/A/Resources - <_R2RFrameworkIntermediateOutputPath Condition="'$(_R2RFrameworkIntermediateOutputPath)' == ''">$(DeviceSpecificIntermediateOutputPath)r2rframework/ - <_R2RFrameworkName Condition="'$(_R2RFrameworkName)' == ''">$(AssemblyName) - <_R2RFrameworkPath Condition="'$(_R2RFrameworkPath)' == ''">$(_R2RFrameworkIntermediateOutputPath)$(_R2RFrameworkName).framework - <_R2RFrameworkOutput Condition="'$(_R2RFrameworkOutput)' == ''">$(_R2RFrameworkPath)$(_R2RFrameworkBinaryInfix)/$(_R2RFrameworkName) - - <_R2RFrameworkStructureStampFile>$(_R2RFrameworkIntermediateOutputPath)$(_R2RFrameworkName)-structure.stamp - - <_R2RFrameworkInfoPlistPath>$(_R2RFrameworkPath)$(_R2RFrameworkResourcesInfix)/Info.plist + <_R2RModuleIntermediateOutputPath Condition="'$(_R2RModuleIntermediateOutputPath)' == ''">$(DeviceSpecificIntermediateOutputPath)r2rframework/ + <_R2RModuleRegistrationFile>$(_R2RModuleIntermediateOutputPath)r2r_modules.mm + - <_R2RFrameworkDirectories Include="$(_R2RFrameworkPath)" /> - - <_R2RFrameworkInputs Include="@(_R2RObjectFilesForLinking)" /> - <_R2RFrameworkLinkerFlags Include="-dynamiclib" /> - <_R2RFrameworkLinkerFlags Include="-Wl,-dead_strip" /> - <_R2RFrameworkLinkerFlags Include="-Wl,-install_name,@rpath/$(_R2RFrameworkName).framework/$(_R2RFrameworkName)" /> - - <_FrameworkNativeReference Include="$(_R2RFrameworkPath)/$(_R2RFrameworkName)" Kind="Framework" /> + <_R2RModule Include="@(_ReadyToRunObjectFilesToLink)"> + + %(Filename)%(Extension) + + $([System.Text.RegularExpressions.Regex]::Replace ('%(Filename)', '\.r2r$', '')) + + $([System.Text.RegularExpressions.Regex]::Replace ('%(Filename)%(Extension)', '[^a-zA-Z0-9_]', '_')) + + <_R2RModule Update="@(_R2RModule)"> + RTR_HEADER_%(SanitizedName) + %(NativeLinkerInputPath) + %(ShortName).r2r + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r.framework + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r.framework$(_R2RFrameworkBinaryInfix)/%(ShortName).r2r + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r.framework$(_R2RFrameworkResourcesInfix)/Info.plist + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r-structure.stamp + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r-cache.txt + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r-cache.txt.uptodate + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r.dylib + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r-dylib-cache.txt + $(_R2RModuleIntermediateOutputPath)%(ShortName).r2r-dylib-cache.txt.uptodate + + - - <_R2RFrameworkDirectories Include="$(_R2RFrameworkPath)/Versions/A/Resources" /> - - <_R2RFrameworkSymlinks Include="$(_R2RFrameworkPath)/Resources" SymlinkTo="Versions/A/Resources" /> - <_R2RFrameworkSymlinks Include="$(_R2RFrameworkPath)/$(_R2RFrameworkName)" SymlinkTo="Versions/A/$(_R2RFrameworkName)" /> - <_R2RFrameworkSymlinks Include="$(_R2RFrameworkPath)/Versions/Current" SymlinkTo="A" /> + + + + <_FrameworkNativeReference Include="@(_R2RModule->'%(FrameworkPath)/%(FrameworkName)')" Kind="Framework" /> - - - - <_R2RFrameworkCachePath>$(_R2RFrameworkIntermediateOutputPath)cache.txt - <_R2RFrameworkCachePath2>$(_R2RFrameworkCachePath).uptodate - - - <_R2RFrameworkCache Include="@(_R2RFrameworkInputs)" /> - <_R2RFrameworkCache Include="@(_R2RFrameworkLinkerFlags)" /> - <_R2RFrameworkCache Include="$(_R2RFrameworkOutput)" /> - <_R2RFrameworkCache Include="$(_MinimumOSVersion)" /> - - - - - - - - - - + + <_FileNativeReference Include="@(_R2RModule->'%(DylibOutput)')" Kind="Dynamic" /> - + + + + + + - - + - - - + <_CurrentR2RModuleLinkerFlags Remove="@(_CurrentR2RModuleLinkerFlags)" /> + <_CurrentR2RModuleLinkerFlags Include="-dynamiclib" /> + <_CurrentR2RModuleLinkerFlags Include="-Wl,-dead_strip" /> + <_CurrentR2RModuleLinkerFlags Include="-Wl,-alias,_RTR_HEADER,_%(_R2RModule.SymbolName)" /> + <_CurrentR2RModuleLinkerFlags Include="-Wl,-unexported_symbol,_RTR_HEADER" /> + <_CurrentR2RModuleLinkerFlags Include="-Wl,-install_name,@rpath/%(_R2RModule.FrameworkName).framework/%(_R2RModule.FrameworkName)" /> - - - - - - - - - + - - + + MinimumOSVersion="$(_MinimumOSVersion)" + SdkDevPath="$(_SdkDevPath)" + SdkIsSimulator="$(_SdkIsSimulator)" + SdkRoot="$(_SdkRoot)" + TargetArchitectures="$(TargetArchitectures)" + TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)" + /> - + + + + - - - - - <_CreateR2RDylibDependsOn> - _CollectR2RObjectFilesForLinking; - _PrepareR2RDylibCreation; - _ForceLinkR2RDylib; - _LinkR2RDylib; - - - - + - - <_R2RDylibIntermediateOutputPath Condition="'$(_R2RFrameworkIntermediateOutputPath)' == ''">$(DeviceSpecificIntermediateOutputPath)r2rdylib/ - <_R2RDylibName Condition="'$(_R2RDylibName)' == ''">$(AssemblyName) - <_R2RDylibPath Condition="'$(_R2RDylibPath)' == ''">$(_R2RDylibIntermediateOutputPath) - <_R2RDylibOutput Condition="'$(_R2RDylibOutput)' == ''">$(_R2RDylibPath)$(_R2RDylibName).r2r.dylib - - - - <_R2RDylibInputs Include="@(_R2RObjectFilesForLinking)" /> - <_R2RDylibLinkerFlags Include="-dynamiclib" /> - <_R2RDylibLinkerFlags Include="-Wl,-dead_strip" /> - <_R2RDylibLinkerFlags Include="-Wl,-install_name,@rpath/$(_R2RDylibName).r2r.dylib" /> - <_FileNativeReference Include="$(_R2RDylibOutput)" Kind="Dynamic" /> - + - - - <_R2RDylibCachePath>$(_R2RDylibIntermediateOutputPath)cache.txt - <_R2RDylibCachePath2>$(_R2RDylibCachePath).uptodate - + - <_R2RDylibCache Include="@(_R2RDylibInputs)" /> - <_R2RDylibCache Include="@(_R2RDylibLinkerFlags)" /> - <_R2RDylibCache Include="$(_R2RDylibOutput)" /> - <_R2RDylibCache Include="$(_MinimumOSVersion)" /> + <_CurrentR2RDylibLinkerFlags Remove="@(_CurrentR2RDylibLinkerFlags)" /> + <_CurrentR2RDylibLinkerFlags Include="-dynamiclib" /> + <_CurrentR2RDylibLinkerFlags Include="-Wl,-dead_strip" /> + <_CurrentR2RDylibLinkerFlags Include="-Wl,-alias,_RTR_HEADER,_%(_R2RModule.SymbolName)" /> + <_CurrentR2RDylibLinkerFlags Include="-Wl,-unexported_symbol,_RTR_HEADER" /> + <_CurrentR2RDylibLinkerFlags Include="-Wl,-install_name,@rpath/%(_R2RModule.ModuleName)" /> - - - + + MinimumOSVersion="$(_MinimumOSVersion)" + SdkDevPath="$(_SdkDevPath)" + SdkIsSimulator="$(_SdkIsSimulator)" + SdkRoot="$(_SdkRoot)" + TargetArchitectures="$(TargetArchitectures)" + TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)" + /> - + - - + - - + + + + + + <_MainFile Include="$(_R2RModuleRegistrationFile)" /> + + - + - - + - - + + + <_CreateR2RDylibDependsOn> + _CollectR2RObjectFilesForLinking; + _PrepareR2RModules; + _RegisterR2RNativeReferences; + _CreateR2RModuleDylibs; + _GenerateR2RModuleRegistration; + + - + <_PostProcessingItem Include="@(_CreatedFrameworksFromDylibs->'$([System.IO.Path]::GetFileName($(AppBundleDir)))/$(_AppFrameworksRelativePath)%(Filename).framework/%(Filename)')"> Framework + %(Filename) %(Filename).framework.dSYM - + <_PostProcessingItem - Include="$([System.IO.Path]::GetFileName('$(AppBundleDir)'))/$(_AppFrameworksRelativePath)$(_R2RFrameworkName).framework/$(_R2RFrameworkName)" Condition="'$(CreateR2RFramework)' == 'true'"> + Include="@(_R2RModule->'$([System.IO.Path]::GetFileName($(AppBundleDir)))/$(_AppFrameworksRelativePath)%(FrameworkName).framework/%(FrameworkName)')" Condition="'$(CreateR2RFramework)' == 'true'"> Framework - $(_R2RFrameworkName).framework.dSYM + %(_R2RModule.FrameworkName).framework.dSYM diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/GenerateR2RModuleRegistration.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/GenerateR2RModuleRegistration.cs new file mode 100644 index 00000000000..c6f4f11a8fd --- /dev/null +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/GenerateR2RModuleRegistration.cs @@ -0,0 +1,89 @@ +using System.IO; +using System.Linq; +using System.Collections.Generic; +using System.Text; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +using Xamarin.Messaging.Build.Client; + +#nullable enable + +namespace Xamarin.MacDev.Tasks { + public class GenerateR2RModuleRegistration : XamarinTask, ITaskCallback { + + #region Inputs + [Required] + public ITaskItem [] R2RModules { get; set; } = []; + + [Required] + public string OutputFile { get; set; } = ""; + #endregion + + public override bool Execute () + { + if (ShouldExecuteRemotely ()) + return ExecuteRemotely (); + + var sb = new StringBuilder (); + + sb.AppendLine ("#include \"xamarin/xamarin.h\""); + sb.AppendLine (); + + foreach (var module in R2RModules) { + var symbolName = module.GetMetadata ("SymbolName"); + if (string.IsNullOrEmpty (symbolName)) { + Log.LogError ("Missing '{0}' metadata on item '{1}'.", "SymbolName", module.ItemSpec); + continue; + } + sb.AppendLine ($"extern void* {symbolName};"); + } + + sb.AppendLine (); + sb.AppendLine ("static struct xamarin_r2r_module r2r_module_entries [] = {"); + + foreach (var module in R2RModules) { + var moduleName = module.GetMetadata ("ModuleName"); + var symbolName = module.GetMetadata ("SymbolName"); + if (string.IsNullOrEmpty (moduleName)) { + Log.LogError ("Missing '{0}' metadata on item '{1}'.", "ModuleName", module.ItemSpec); + continue; + } + if (string.IsNullOrEmpty (symbolName)) + continue; // already reported above + var escapedModuleName = moduleName.Replace ("\\", "\\\\").Replace ("\"", "\\\""); + sb.AppendLine ($"\t{{ \"{escapedModuleName}\", &{symbolName} }},"); + } + + sb.AppendLine ("};"); + sb.AppendLine (); + + sb.AppendLine ("__attribute__ ((constructor))"); + sb.AppendLine ("static void xamarin_register_r2r_modules ()"); + sb.AppendLine ("{"); + sb.AppendLine ("\txamarin_r2r_modules = r2r_module_entries;"); + sb.AppendLine ("\txamarin_r2r_module_count = sizeof (r2r_module_entries) / sizeof (r2r_module_entries [0]);"); + sb.AppendLine ("}"); + + if (Log.HasLoggedErrors) + return false; + + var content = sb.ToString (); + var outputDir = Path.GetDirectoryName (OutputFile); + if (!string.IsNullOrEmpty (outputDir)) + Directory.CreateDirectory (outputDir); + + if (!File.Exists (OutputFile) || File.ReadAllText (OutputFile) != content) + File.WriteAllText (OutputFile, content); + + return !Log.HasLoggedErrors; + } + + public bool ShouldCopyToBuildServer (ITaskItem item) => false; + + public bool ShouldCreateOutputFile (ITaskItem item) => true; + + public IEnumerable GetAdditionalItemsToBeCopied () => Enumerable.Empty (); + } +} diff --git a/runtime/runtime.m b/runtime/runtime.m index 41fbe8ba926..106650caf60 100644 --- a/runtime/runtime.m +++ b/runtime/runtime.m @@ -80,7 +80,8 @@ enum XamarinNativeLinkMode xamarin_libmono_native_link_mode = XamarinNativeLinkModeStaticObject; const char **xamarin_runtime_libraries = NULL; -void *xamarin_rtr_header = NULL; +struct xamarin_r2r_module *xamarin_r2r_modules = NULL; +int xamarin_r2r_module_count = 0; /* Callbacks */ @@ -2439,9 +2440,17 @@ -(struct NSObjectData*) xamarinGetNSObjectData; if (!context || !data || !context->assembly_path || !context->owner_composite_name) return false; - void* r2r_header = xamarin_rtr_header; + void* r2r_header = NULL; + + for (int i = 0; i < xamarin_r2r_module_count; i++) { + if (strcmp (xamarin_r2r_modules [i].name, context->owner_composite_name) == 0) { + r2r_header = xamarin_r2r_modules [i].header; + break; + } + } + if (r2r_header == NULL) - xamarin_assertion_message ("Failed to find the RTR_HEADER symbol."); + return false; Dl_info info; if (dladdr (r2r_header, &info) == 0) diff --git a/runtime/xamarin/main.h b/runtime/xamarin/main.h index eedfc65f300..d986b6324de 100644 --- a/runtime/xamarin/main.h +++ b/runtime/xamarin/main.h @@ -127,7 +127,14 @@ extern bool xamarin_supports_dynamic_registration; extern const char *xamarin_runtime_configuration_name; extern enum XamarinNativeLinkMode xamarin_libmono_native_link_mode; extern const char** xamarin_runtime_libraries; -extern void *xamarin_rtr_header; + +struct xamarin_r2r_module { + const char *name; + void *header; +}; + +extern struct xamarin_r2r_module *xamarin_r2r_modules; +extern int xamarin_r2r_module_count; typedef void (*xamarin_setup_callback) (); typedef int (*xamarin_extension_main_callback) (int argc, char** argv); diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt index 23f7440c0c0..b160ef8d51e 100644 --- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt @@ -1,36 +1,36 @@ -AppBundleSize: 9,269,302 bytes (9,052.1 KB = 8.8 MB) +AppBundleSize: 9,279,285 bytes (9,061.8 KB = 8.8 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 10,847 bytes (10.6 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) Frameworks/libcoreclr.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libcoreclr.framework/Info.plist: 840 bytes (0.8 KB = 0.0 MB) +Frameworks/libcoreclr.framework/Info.plist: 833 bytes (0.8 KB = 0.0 MB) Frameworks/libcoreclr.framework/libcoreclr: 5,220,544 bytes (5,098.2 KB = 5.0 MB) Frameworks/libSystem.Globalization.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/Info.plist: 882 bytes (0.9 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,232 bytes (106.7 KB = 0.1 MB) +Frameworks/libSystem.Globalization.Native.framework/Info.plist: 875 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,248 bytes (106.7 KB = 0.1 MB) Frameworks/libSystem.IO.Compression.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 884 bytes (0.9 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,431,280 bytes (1,397.7 KB = 1.4 MB) +Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 877 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,431,296 bytes (1,397.8 KB = 1.4 MB) Frameworks/libSystem.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/Info.plist: 854 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/libSystem.Native: 162,128 bytes (158.3 KB = 0.2 MB) +Frameworks/libSystem.Native.framework/Info.plist: 847 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Native.framework/libSystem.Native: 162,224 bytes (158.4 KB = 0.2 MB) Frameworks/libSystem.Net.Security.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 880 bytes (0.9 KB = 0.0 MB) -Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,000 bytes (85.9 KB = 0.1 MB) +Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 873 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,016 bytes (86.0 KB = 0.1 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 910 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 903 bytes (0.9 KB = 0.0 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 194,256 bytes (189.7 KB = 0.2 MB) -Info.plist: 1,168 bytes (1.1 KB = 0.0 MB) +Info.plist: 1,161 bytes (1.1 KB = 0.0 MB) Microsoft.iOS.dll: 98,816 bytes (96.5 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) -SizeTestApp: 195,856 bytes (191.3 KB = 0.2 MB) +SizeTestApp: 196,528 bytes (191.9 KB = 0.2 MB) SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB) System.Collections.Immutable.dll: 14,848 bytes (14.5 KB = 0.0 MB) System.Diagnostics.StackTrace.dll: 8,192 bytes (8.0 KB = 0.0 MB) System.IO.Compression.dll: 22,528 bytes (22.0 KB = 0.0 MB) System.IO.MemoryMappedFiles.dll: 22,016 bytes (21.5 KB = 0.0 MB) -System.Private.CoreLib.dll: 1,566,208 bytes (1,529.5 KB = 1.5 MB) +System.Private.CoreLib.dll: 1,575,424 bytes (1,538.5 KB = 1.5 MB) System.Reflection.Metadata.dll: 84,480 bytes (82.5 KB = 0.1 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt index 465e555c9d1..c5f9e025abc 100644 --- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt @@ -1,33 +1,33 @@ -AppBundleSize: 13,259,253 bytes (12,948.5 KB = 12.6 MB) +AppBundleSize: 13,258,606 bytes (12,947.9 KB = 12.6 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: -_CodeSignature/CodeResources: 11,701 bytes (11.4 KB = 0.0 MB) +_CodeSignature/CodeResources: 11,733 bytes (11.5 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) Frameworks/libcoreclr.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libcoreclr.framework/Info.plist: 841 bytes (0.8 KB = 0.0 MB) +Frameworks/libcoreclr.framework/Info.plist: 797 bytes (0.8 KB = 0.0 MB) Frameworks/libcoreclr.framework/libcoreclr: 5,220,544 bytes (5,098.2 KB = 5.0 MB) Frameworks/libSystem.Globalization.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/Info.plist: 883 bytes (0.9 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,232 bytes (106.7 KB = 0.1 MB) +Frameworks/libSystem.Globalization.Native.framework/Info.plist: 839 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,248 bytes (106.7 KB = 0.1 MB) Frameworks/libSystem.IO.Compression.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 885 bytes (0.9 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,431,280 bytes (1,397.7 KB = 1.4 MB) +Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 841 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,431,296 bytes (1,397.8 KB = 1.4 MB) Frameworks/libSystem.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/Info.plist: 855 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/libSystem.Native: 162,208 bytes (158.4 KB = 0.2 MB) +Frameworks/libSystem.Native.framework/Info.plist: 811 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Native.framework/libSystem.Native: 162,224 bytes (158.4 KB = 0.2 MB) Frameworks/libSystem.Net.Security.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 881 bytes (0.9 KB = 0.0 MB) -Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,000 bytes (85.9 KB = 0.1 MB) +Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 837 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,016 bytes (86.0 KB = 0.1 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 911 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 867 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 194,256 bytes (189.7 KB = 0.2 MB) -Frameworks/SizeTestApp.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/SizeTestApp.framework/Info.plist: 844 bytes (0.8 KB = 0.0 MB) -Frameworks/SizeTestApp.framework/SizeTestApp: 3,963,136 bytes (3,870.2 KB = 3.8 MB) -Info.plist: 1,169 bytes (1.1 KB = 0.0 MB) -Microsoft.iOS.dll: 98,816 bytes (96.5 KB = 0.1 MB) +Frameworks/SizeTestApp.r2r.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) +Frameworks/SizeTestApp.r2r.framework/Info.plist: 809 bytes (0.8 KB = 0.0 MB) +Frameworks/SizeTestApp.r2r.framework/SizeTestApp.r2r: 3,963,184 bytes (3,870.3 KB = 3.8 MB) +Info.plist: 1,125 bytes (1.1 KB = 0.0 MB) +Microsoft.iOS.dll: 98,304 bytes (96.0 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) -SizeTestApp: 196,048 bytes (191.5 KB = 0.2 MB) +SizeTestApp: 196,112 bytes (191.5 KB = 0.2 MB) SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB) System.Collections.Immutable.dll: 13,824 bytes (13.5 KB = 0.0 MB) System.Diagnostics.StackTrace.dll: 7,680 bytes (7.5 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt index 8924c5b7ac3..14f3ba93f50 100644 --- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt @@ -1,14 +1,14 @@ -AppBundleSize: 3,617,184 bytes (3,532.4 KB = 3.4 MB) +AppBundleSize: 3,622,219 bytes (3,537.3 KB = 3.5 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 3,997 bytes (3.9 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,134 bytes (1.1 KB = 0.0 MB) -Microsoft.iOS.dll: 153,088 bytes (149.5 KB = 0.1 MB) +Info.plist: 1,161 bytes (1.1 KB = 0.0 MB) +Microsoft.iOS.dll: 154,112 bytes (150.5 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,405 bytes (1.4 KB = 0.0 MB) -SizeTestApp: 2,391,264 bytes (2,335.2 KB = 2.3 MB) +SizeTestApp: 2,391,632 bytes (2,335.6 KB = 2.3 MB) SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB) -System.Private.CoreLib.aotdata.arm64: 41,392 bytes (40.4 KB = 0.0 MB) -System.Private.CoreLib.dll: 1,003,520 bytes (980.0 KB = 1.0 MB) +System.Private.CoreLib.aotdata.arm64: 41,424 bytes (40.5 KB = 0.0 MB) +System.Private.CoreLib.dll: 1,007,104 bytes (983.5 KB = 1.0 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt index 56605001c70..ab7e736bfc0 100644 --- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt @@ -1,17 +1,17 @@ -AppBundleSize: 9,458,846 bytes (9,237.2 KB = 9.0 MB) +AppBundleSize: 9,458,975 bytes (9,237.3 KB = 9.0 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 5,229 bytes (5.1 KB = 0.0 MB) aot-instances.aotdata.arm64: 818,536 bytes (799.4 KB = 0.8 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,168 bytes (1.1 KB = 0.0 MB) +Info.plist: 1,161 bytes (1.1 KB = 0.0 MB) Microsoft.iOS.aotdata.arm64: 22,888 bytes (22.4 KB = 0.0 MB) -Microsoft.iOS.dll: 49,152 bytes (48.0 KB = 0.0 MB) +Microsoft.iOS.dll: 48,640 bytes (47.5 KB = 0.0 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) -SizeTestApp: 7,333,840 bytes (7,162.0 KB = 7.0 MB) +SizeTestApp: 7,334,528 bytes (7,162.6 KB = 7.0 MB) SizeTestApp.aotdata.arm64: 1,456 bytes (1.4 KB = 0.0 MB) SizeTestApp.dll: 7,168 bytes (7.0 KB = 0.0 MB) -System.Private.CoreLib.aotdata.arm64: 665,552 bytes (650.0 KB = 0.6 MB) +System.Private.CoreLib.aotdata.arm64: 665,512 bytes (649.9 KB = 0.6 MB) System.Private.CoreLib.dll: 537,088 bytes (524.5 KB = 0.5 MB) System.Runtime.aotdata.arm64: 784 bytes (0.8 KB = 0.0 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt index f817b59fd2e..6be9590f601 100644 --- a/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt @@ -1,8 +1,8 @@ -AppBundleSize: 2,486,550 bytes (2,428.3 KB = 2.4 MB) +AppBundleSize: 2,486,702 bytes (2,428.4 KB = 2.4 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 2,589 bytes (2.5 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,169 bytes (1.1 KB = 0.0 MB) +Info.plist: 1,161 bytes (1.1 KB = 0.0 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,808 bytes (1.8 KB = 0.0 MB) -SizeTestApp: 2,480,592 bytes (2,422.5 KB = 2.4 MB) +SizeTestApp: 2,480,752 bytes (2,422.6 KB = 2.4 MB) diff --git a/tools/common/Target.cs b/tools/common/Target.cs index bb864b39db0..33f2b17d52d 100644 --- a/tools/common/Target.cs +++ b/tools/common/Target.cs @@ -344,11 +344,6 @@ void GenerateMainImpl (StringWriter sw, Abi abi) sw.WriteLine (); sw.WriteLine (assembly_externs); - if (app.PublishReadyToRun == true) { - sw.WriteLine ("extern void* RTR_HEADER;"); - sw.WriteLine (); - } - sw.WriteLine ("void xamarin_register_modules_impl ()"); sw.WriteLine ("{"); sw.WriteLine (assembly_aot_modules); @@ -440,8 +435,6 @@ void GenerateMainImpl (StringWriter sw, Abi abi) sw.WriteLine ("\txamarin_runtime_configuration_name = {0};", string.IsNullOrEmpty (app.RuntimeConfigurationFile) ? "NULL" : $"\"{app.RuntimeConfigurationFile}\""); if (app.Registrar == RegistrarMode.ManagedStatic) sw.WriteLine ("\txamarin_set_is_managed_static_registrar (true);"); - if (app.PublishReadyToRun == true) - sw.WriteLine ("\txamarin_rtr_header = &RTR_HEADER;"); sw.WriteLine ("}"); sw.WriteLine (); sw.Write ("int main");