[clr-ios] Add options to strip inlining and debug info in Crossgen2 on Apple mobile#124604
Conversation
|
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger |
Nit: This is not accurate statement. These sections are usable without JIT as well:
It is fine to lose these features for mobile apps. I am just pointing out that it is not really related to JIT support. |
|
Thanks Jan, updated the description. |
|
/cc: @jkoritzinsky please take a look |
There was a problem hiding this comment.
Pull request overview
Adds new crossgen2 switches to strip inlining/debug information and wires them into the publish pipeline to reduce composite R2R output size for Apple mobile scenarios.
Changes:
- Add
--strip-inlining-info,--strip-debug-info, and--strip-il-bodiesoptions to crossgen2 and plumb them intoNodeFactoryOptimizationFlags. - Conditionally omit R2R inlining/debug sections during image construction when the new strip flags are enabled.
- Auto-enable stripping options for Apple mobile RIDs via MSBuild
PublishReadyToRunCrossgen2ExtraArgs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets | Auto-adds crossgen2 strip flags for Apple mobile RIDs during publish. |
| src/coreclr/tools/aot/crossgen2/Properties/Resources.resx | Adds option descriptions for the new crossgen2 switches. |
| src/coreclr/tools/aot/crossgen2/Program.cs | Plumbs parsed CLI strip flags into NodeFactoryOptimizationFlags. |
| src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs | Defines and registers new CLI options. |
| src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs | Skips emitting inlining/debug R2R sections when strip flags are set. |
| src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMethodILNode.cs | Implements IL body stripping by emitting a minimal stub body for eligible methods. |
You can also share your feedback on Copilot code review. Take the survey.
...tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMethodILNode.cs
Outdated
Show resolved
Hide resolved
...tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMethodILNode.cs
Outdated
Show resolved
Hide resolved
...tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/CopiedMethodILNode.cs
Outdated
Show resolved
Hide resolved
…Apple platforms" This reverts commit 01119c4.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
You can also share your feedback on Copilot code review. Take the survey.
.../tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs
Show resolved
Hide resolved
.../tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review. Take the survey.
…pple mobile RIDs Mirror the changes from dotnet/runtime#124604 to the SDK's copy of Microsoft.NET.CrossGen.targets. For Apple mobile RIDs (ios, tvos, iossimulator, tvossimulator, maccatalyst), pass --strip-inlining-info and --strip-debug-info to crossgen2 by default via PublishReadyToRunCrossgen2ExtraArgs, controllable via PublishReadyToRunStripInliningInfo and PublishReadyToRunStripDebugInfo MSBuild properties. Co-authored-by: Copilot <[email protected]>
Description
This PR adds
--strip-inlining-infoand--strip-debug-infooptions to crossgen2 and auto-enables them for Apple mobile platforms. Stripping these sections reduces the composite R2R dylib size by 2.2 MB in MAUI template app.