Skip to content

Make apple mobile targets R2R size optimized by default#130128

Open
BrzVlad wants to merge 2 commits into
dotnet:mainfrom
BrzVlad:feature-ios-r2r-size
Open

Make apple mobile targets R2R size optimized by default#130128
BrzVlad wants to merge 2 commits into
dotnet:mainfrom
BrzVlad:feature-ios-r2r-size

Conversation

@BrzVlad

@BrzVlad BrzVlad commented Jul 2, 2026

Copy link
Copy Markdown
Member

Pass --Os which should instruct the compiler to generate compact code. Refactor code to avoid conditional duplication.

Reduces code size by about 1.5%

This change needs to be done in the sdk as well.

BrzVlad added 2 commits July 2, 2026 17:43
Pass `--Os` which should instruct the compiler to generate compact code.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Crossgen2 MSBuild targets to make Apple mobile (iOS/tvOS/simulators/MacCatalyst) ReadyToRun compilation favor smaller code size by default, by adding the Crossgen2 --Os flag and consolidating RID checks into a single helper property.

Changes:

  • Introduces a _IsIOSLikeRid MSBuild property to centralize Apple mobile RID detection.
  • Applies existing iOS-like defaults (disable R2R symbol emission, strip inlining/debug info) using the new helper property.
  • Appends --Os to PublishReadyToRunCrossgen2ExtraArgs for iOS-like RIDs to favor size-optimized codegen.

Comment thread src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets
@AndyAyersMS

Copy link
Copy Markdown
Member

We had two PRs cross which is causing a build break for Wasm. I'll get a PR up shortly.

@AndyAyersMS

Copy link
Copy Markdown
Member

#130131

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants