Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NativeAOT: Disable AggressiveAttributeTrimming with ILLink (#18545)
In the current setup with NativeAOT, during app build we run both ILLink and ILCompiler in cascade. When `_AggressiveAttributeTrimming` feature switch is set to `true` ILLink removes `IsTrimmable` attribute from assemblies, which means that when we are also running in `TrimMode=partial` (which translates to `--defaultrooting` ILC command-line arguments) ILC trimming is disabled completely. This PR disables `_AggressiveAttributeTrimming` in the first pass ie during trimming by ILLink and enables it in the second trimming pass performed by ILCompiler. Additionally, to workaround ILCompiler incompatibility with `Microsoft.iOS` (and friends) this platform assembly is explicitly rooted when passed to ILCompiler for trimming (this will be fixed once dotnet/runtime#86649 is resolved). Estimated savings: This change reduces the size of the application bundle by `0,58Mb` (or ~4,3% compared to the baseline) | MAUI ios app | Base | This PR | diff (%) | |--------------|-----------|-----------|----------| | SOD (Mb) | 41,93 | 40,5 | -3,4% | | .ipa (Mb) | 13,43 | 12,85 | -4,3% | Fixes: #18479 --------- Co-authored-by: Alex Soto <alex@alexsoto.me>
- Loading branch information
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.