[mono][ios] Add support for stripping during AOT compilation on iOS (#87728)
authorMilos Kotlar <kotlarmilos@gmail.com>
Mon, 19 Jun 2023 09:09:41 +0000 (11:09 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Jun 2023 09:09:41 +0000 (11:09 +0200)
* Add support for stripping debug symbols and enabling IL stripping during AOT compilation on iOS

src/mono/msbuild/apple/build/AppleBuild.props
src/mono/msbuild/apple/build/AppleBuild.targets
src/mono/sample/iOS/Program.csproj

index 8ec2084..046c341 100644 (file)
@@ -15,7 +15,9 @@
     <UseMonoRuntime>true</UseMonoRuntime>
     <UseMonoJustInterp Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' == 'true'">true</UseMonoJustInterp>
 
-    <!--<ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</ShouldILStrip>-->
+    <StripDebugSymbols Condition="'$(StripDebugSymbols)' == ''" >false</StripDebugSymbols>
+    <!-- Tracking issue: https://github.com/dotnet/runtime/issues/87740 -->
+    <!-- <ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</ShouldILStrip> -->
 
     <_IsLibraryMode Condition="'$(NativeLib)' != ''">true</_IsLibraryMode>
 
index 990269a..d5c1413 100644 (file)
       ProjectName="$(AppName)"
       RuntimeComponents="$(RuntimeComponents)"
       TargetOS="$(TargetOS)"
+      StripSymbolTable="$(StripDebugSymbols)"
       ExcludeFromAppDir="@(_ExcludeFromAppDir)"
       UseConsoleUITemplate="$(UseConsoleUITemplate)">
         <Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" />
index 38d3984..681d661 100644 (file)
@@ -13,6 +13,7 @@
     <PublishTrimmed>true</PublishTrimmed>
     <TrimMode>Link</TrimMode>
     <Optimized Condition="'$(Configuration)' == 'Release'">true</Optimized>
+    <ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</ShouldILStrip>
 
     <EnableDefaultAssembliesToBundle>true</EnableDefaultAssembliesToBundle>
     <AppleGenerateAppBundle>true</AppleGenerateAppBundle>