From b92e9367780b6cdc6bc26827f10a10dca5292c1f Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 11 Feb 2026 14:39:24 +0100 Subject: [PATCH 1/4] [net11.0] Add CoreCLR and R2R framework to post-processing for symbol stripping --- dotnet/targets/Xamarin.Shared.Sdk.targets | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index ca764998a48b..26bc885151b9 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -2585,6 +2585,36 @@ global using nfloat = global::System.Runtime.InteropServices.NFloat%3B + + + + + <_PostProcessingItem + Include="@(_CreatedFrameworksFromDylibs->'$([System.IO.Path]::GetFileName($(AppBundleDir)))/$(_AppFrameworksRelativePath)%(Filename).framework/%(Filename)')"> + Framework + false + true + %(Filename).dSYM + %(Filename).dSYM\Contents\Info.plist + %(Filename).bcsymbolmap + + + <_PostProcessingItem + Include="$([System.IO.Path]::GetFileName('$(AppBundleDir)'))/$(_AppFrameworksRelativePath)$(_R2RFrameworkName).framework/$(_R2RFrameworkName)" Condition="'$(CreateR2RFramework)' == 'true'"> + Framework + false + true + $(_R2RFrameworkName).dSYM + $(_R2RFrameworkName).dSYM\Contents\Info.plist + $(_R2RFrameworkName).bcsymbolmap + + + + From 52f715b5985fd80ad09ec28e88e4c713b6910494 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 12 Feb 2026 13:58:09 +0100 Subject: [PATCH 2/4] [tests] Update expected sizes. --- .../expected/iOS-CoreCLR-Interpreter-size.txt | 38 ++++++++--------- .../expected/iOS-CoreCLR-R2R-size.txt | 42 +++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt index aa17a1e04607..00b8ca2da121 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: 14,891,359 bytes (14,542.3 KB = 14.2 MB) +AppBundleSize: 12,475,325 bytes (12,182.9 KB = 11.9 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 12,587 bytes (12.3 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: 819 bytes (0.8 KB = 0.0 MB) -Frameworks/libcoreclr.framework/libcoreclr: 6,629,392 bytes (6,474.0 KB = 6.3 MB) +Frameworks/libcoreclr.framework/Info.plist: 817 bytes (0.8 KB = 0.0 MB) +Frameworks/libcoreclr.framework/libcoreclr: 5,201,088 bytes (5,079.2 KB = 5.0 MB) Frameworks/libmscordaccore.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libmscordaccore.framework/Info.plist: 831 bytes (0.8 KB = 0.0 MB) -Frameworks/libmscordaccore.framework/libmscordaccore: 2,289,360 bytes (2,235.7 KB = 2.2 MB) +Frameworks/libmscordaccore.framework/Info.plist: 829 bytes (0.8 KB = 0.0 MB) +Frameworks/libmscordaccore.framework/libmscordaccore: 1,815,472 bytes (1,772.9 KB = 1.7 MB) Frameworks/libmscordbi.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libmscordbi.framework/Info.plist: 821 bytes (0.8 KB = 0.0 MB) -Frameworks/libmscordbi.framework/libmscordbi: 1,863,920 bytes (1,820.2 KB = 1.8 MB) +Frameworks/libmscordbi.framework/Info.plist: 819 bytes (0.8 KB = 0.0 MB) +Frameworks/libmscordbi.framework/libmscordbi: 1,408,960 bytes (1,375.9 KB = 1.3 MB) Frameworks/libSystem.Globalization.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/Info.plist: 861 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 110,608 bytes (108.0 KB = 0.1 MB) +Frameworks/libSystem.Globalization.Native.framework/Info.plist: 859 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,792 bytes (107.2 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: 863 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,467,440 bytes (1,433.0 KB = 1.4 MB) +Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 861 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,439,552 bytes (1,405.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: 833 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/libSystem.Native: 163,856 bytes (160.0 KB = 0.2 MB) +Frameworks/libSystem.Native.framework/Info.plist: 831 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Native.framework/libSystem.Native: 162,432 bytes (158.6 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: 859 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,432 bytes (86.4 KB = 0.1 MB) +Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 857 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,400 bytes (86.3 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: 889 bytes (0.9 KB = 0.0 MB) -Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 224,080 bytes (218.8 KB = 0.2 MB) -Info.plist: 1,147 bytes (1.1 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 887 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 195,280 bytes (190.7 KB = 0.2 MB) +Info.plist: 1,145 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: 197,344 bytes (192.7 KB = 0.2 MB) +SizeTestApp: 197,440 bytes (192.8 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) diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt index 8f845db37204..aa768a6dbaf9 100644 --- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt @@ -1,39 +1,39 @@ -AppBundleSize: 24,990,321 bytes (24,404.6 KB = 23.8 MB) +AppBundleSize: 17,067,453 bytes (16,667.4 KB = 16.3 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 13,441 bytes (13.1 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: 819 bytes (0.8 KB = 0.0 MB) -Frameworks/libcoreclr.framework/libcoreclr: 6,629,392 bytes (6,474.0 KB = 6.3 MB) +Frameworks/libcoreclr.framework/Info.plist: 817 bytes (0.8 KB = 0.0 MB) +Frameworks/libcoreclr.framework/libcoreclr: 5,201,088 bytes (5,079.2 KB = 5.0 MB) Frameworks/libmscordaccore.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libmscordaccore.framework/Info.plist: 831 bytes (0.8 KB = 0.0 MB) -Frameworks/libmscordaccore.framework/libmscordaccore: 2,289,360 bytes (2,235.7 KB = 2.2 MB) +Frameworks/libmscordaccore.framework/Info.plist: 829 bytes (0.8 KB = 0.0 MB) +Frameworks/libmscordaccore.framework/libmscordaccore: 1,815,472 bytes (1,772.9 KB = 1.7 MB) Frameworks/libmscordbi.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libmscordbi.framework/Info.plist: 821 bytes (0.8 KB = 0.0 MB) -Frameworks/libmscordbi.framework/libmscordbi: 1,863,920 bytes (1,820.2 KB = 1.8 MB) +Frameworks/libmscordbi.framework/Info.plist: 819 bytes (0.8 KB = 0.0 MB) +Frameworks/libmscordbi.framework/libmscordbi: 1,408,960 bytes (1,375.9 KB = 1.3 MB) Frameworks/libSystem.Globalization.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/Info.plist: 861 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 110,608 bytes (108.0 KB = 0.1 MB) +Frameworks/libSystem.Globalization.Native.framework/Info.plist: 859 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,792 bytes (107.2 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: 863 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,467,440 bytes (1,433.0 KB = 1.4 MB) +Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 861 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,439,552 bytes (1,405.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: 833 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/libSystem.Native: 163,856 bytes (160.0 KB = 0.2 MB) +Frameworks/libSystem.Native.framework/Info.plist: 831 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Native.framework/libSystem.Native: 162,432 bytes (158.6 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: 859 bytes (0.8 KB = 0.0 MB) -Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,432 bytes (86.4 KB = 0.1 MB) +Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 857 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,400 bytes (86.3 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: 889 bytes (0.9 KB = 0.0 MB) -Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 224,080 bytes (218.8 KB = 0.2 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 887 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 195,280 bytes (190.7 KB = 0.2 MB) Frameworks/SizeTestApp.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/SizeTestApp.framework/Info.plist: 822 bytes (0.8 KB = 0.0 MB) -Frameworks/SizeTestApp.framework/SizeTestApp: 9,426,736 bytes (9,205.8 KB = 9.0 MB) -Info.plist: 1,147 bytes (1.1 KB = 0.0 MB) +Frameworks/SizeTestApp.framework/Info.plist: 820 bytes (0.8 KB = 0.0 MB) +Frameworks/SizeTestApp.framework/SizeTestApp: 3,919,936 bytes (3,828.1 KB = 3.7 MB) +Info.plist: 1,145 bytes (1.1 KB = 0.0 MB) Microsoft.iOS.dll: 163,840 bytes (160.0 KB = 0.2 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) -SizeTestApp: 197,424 bytes (192.8 KB = 0.2 MB) +SizeTestApp: 197,488 bytes (192.9 KB = 0.2 MB) SizeTestApp.dll: 73,216 bytes (71.5 KB = 0.1 MB) System.Collections.Immutable.dll: 79,360 bytes (77.5 KB = 0.1 MB) System.Diagnostics.StackTrace.dll: 73,216 bytes (71.5 KB = 0.1 MB) From d57ef2927e3aa7a25c3383b94d7d4f8f66ab4022 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 3 Mar 2026 16:46:22 +0100 Subject: [PATCH 3/4] Simplify a bit. --- dotnet/targets/Xamarin.Shared.Sdk.targets | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 1d2538357ba5..6c06522abbbd 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -2586,29 +2586,25 @@ global using nfloat = global::System.Runtime.InteropServices.NFloat%3B - + + <_CollectItemsForPostProcessingDependsOn> + $(_CollectItemsForPostProcessingDependsOn); + _CollectR2RFrameworksForPostProcessing; + + + <_PostProcessingItem Include="@(_CreatedFrameworksFromDylibs->'$([System.IO.Path]::GetFileName($(AppBundleDir)))/$(_AppFrameworksRelativePath)%(Filename).framework/%(Filename)')"> Framework - false - true - %(Filename).dSYM - %(Filename).dSYM\Contents\Info.plist - %(Filename).bcsymbolmap + %(Filename).framework.dSYM <_PostProcessingItem Include="$([System.IO.Path]::GetFileName('$(AppBundleDir)'))/$(_AppFrameworksRelativePath)$(_R2RFrameworkName).framework/$(_R2RFrameworkName)" Condition="'$(CreateR2RFramework)' == 'true'"> Framework - false - true - $(_R2RFrameworkName).dSYM - $(_R2RFrameworkName).dSYM\Contents\Info.plist - $(_R2RFrameworkName).bcsymbolmap + $(_R2RFrameworkName).framework.dSYM From 0f3e159baa4b02739504320866b3fa3e115b7050 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 4 Mar 2026 09:37:56 +0100 Subject: [PATCH 4/4] Does this work now? --- msbuild/Xamarin.Shared/Xamarin.Shared.targets | 5 ----- 1 file changed, 5 deletions(-) diff --git a/msbuild/Xamarin.Shared/Xamarin.Shared.targets b/msbuild/Xamarin.Shared/Xamarin.Shared.targets index 05979cd87421..3f741127ca5d 100644 --- a/msbuild/Xamarin.Shared/Xamarin.Shared.targets +++ b/msbuild/Xamarin.Shared/Xamarin.Shared.targets @@ -2963,11 +2963,6 @@ Copyright (C) 2018 Microsoft. All rights reserved. %(Filename)%(Extension).bcsymbolmap - - <_PostProcessingItem Condition="$([MSBuild]::ValueOrDefault('%(_PostProcessingItem.NuGetPackageId)', '').StartsWith('Microsoft.NETCore.App.Runtime'))"> - true - - <_PostProcessingAppExtensions Include="@(_AppExtensionPostProcessingItems)" Condition="'%(_AppExtensionPostProcessingItems.IsAppExtension)' == 'true' And '%(_AppExtensionPostProcessingItems.IsXPCService)' != 'true'" /> <_PostProcessingXpcServices Include="@(_AppExtensionPostProcessingItems)" Condition="'%(_AppExtensionPostProcessingItems.IsAppExtension)' == 'true' And '%(_AppExtensionPostProcessingItems.IsXPCService)' == 'true'" />