Make apple mobile targets R2R size optimized by default - #130128
Conversation
Pass `--Os` which should instruct the compiler to generate compact code.
There was a problem hiding this comment.
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
_IsIOSLikeRidMSBuild 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
--OstoPublishReadyToRunCrossgen2ExtraArgsfor iOS-like RIDs to favor size-optimized codegen.
|
We had two PRs cross which is causing a build break for Wasm. I'll get a PR up shortly. |
|
Should android and NAOT and WASM be the same? Also, i assume it'd be better to respect |
|
@MichalPetryka For android it is less relevant since it has less reliance on r2r, using profiled aot by default due to jit fallback, and it is still early for r2r wasm configuration. I agree that |
|
Alternative implementation checking for the |
Pass
--Oswhich 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.