Skip to content

Commit

Permalink
[WIP][dotnet][linker] Enable the sealer optimization
Browse files Browse the repository at this point in the history
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release

Reverts c56b893
Fix #9573

Work-in-progress:
* should be made easier to enable/disable (from user projects)
* the above conditions should be the default (if nothing is specified)
  • Loading branch information
Sebastien Pouliot committed Jun 23, 2021
1 parent c4d5433 commit 09bce94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 3 additions & 0 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@
-->
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --disable-opt unusedtypechecks</_ExtraTrimmerArgs>

<!-- if a release build, not using the JIT (macOS) or the interpreter then the sealer optimization can be used -->
<_ExtraTrimmerArgs Condition="'$(_BundlerDebug)' != 'true' And '$(MtouchInterpreter)' == '' And '$(_PlatformName)' != 'macOS'">$(_ExtraTrimmerArgs) --enable-opt sealer</_ExtraTrimmerArgs>

<!-- We always want the linker to process debug symbols, even when building in Release mode, because the AOT compiler uses the managed debug symbols to output DWARF debugging symbols -->
<TrimmerRemoveSymbols Condition="'$(TrimmerRemoveSymbols)' == ''">false</TrimmerRemoveSymbols>
</PropertyGroup>
Expand Down
9 changes: 0 additions & 9 deletions tests/linker/ios/link all/SealerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public class Subclass : Base, Interface {
[Preserve (AllMembers = true)]
public class SealerTest {

#if !DEBUG && NET
[Ignore ("https://github.com/xamarin/xamarin-macios/issues/9573")]
#endif
[Test]
public void Sealed ()
{
Expand All @@ -62,9 +59,6 @@ public void Sealed ()
#endif
}

#if !DEBUG && NET
[Ignore ("https://github.com/xamarin/xamarin-macios/issues/9573")]
#endif
[Test]
public void Final ()
{
Expand All @@ -85,9 +79,6 @@ public void Final ()
#endif
}

#if !DEBUG && NET
[Ignore ("https://github.com/xamarin/xamarin-macios/issues/9573")]
#endif
[Test]
public void Virtual ()
{
Expand Down

0 comments on commit 09bce94

Please sign in to comment.