Skip to content

Commit 8f135a2

Browse files
Recognize TrimMode=partial in ILCompiler targets (#71117)
This should root all non-trimmable assemblies, same as TrimmerDefaultAction=copy. We still support consuming ILCompiler through NuGet when targeting .NET 6, so recognize the old thing too. We might want to cut the .NET 6 support close to RC and at that time TrimmerDefaultAction handling can go away. Related: dotnet/linker#2856.
1 parent 6f13196 commit 8f135a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ The .NET Foundation licenses this file to you under the MIT license.
246246
<IlcArg Include="@(_IlcConditionallyRootedAssemblies->'--conditionalroot:%(Identity)')" />
247247
<IlcArg Include="@(_IlcTrimmedAssemblies->'--trim:%(Identity)')" />
248248
<IlcArg Include="@(_IlcNoSingleWarnAssemblies->'--nosinglewarnassembly:%(Filename)')" />
249-
<IlcArg Condition="'$(TrimmerDefaultAction)' == 'copyused' or '$(TrimmerDefaultAction)' == 'copy'" Include="--defaultrooting" />
249+
<IlcArg Condition="'$(TrimmerDefaultAction)' == 'copyused' or '$(TrimmerDefaultAction)' == 'copy' or '$(TrimMode)' == 'partial'" Include="--defaultrooting" />
250250
<IlcArg Include="--resilient" />
251251

252252
<IlcArg Condition="$(IlcDisableReflection) == 'true'" Include="--feature:System.Reflection.IsReflectionExecutionAvailable=false" />

0 commit comments

Comments
 (0)