Skip to content

Commit

Permalink
Add set of attributes that can be trimmed on NAOT (#88718)
Browse files Browse the repository at this point in the history
These are papercuts but since we have the mechanism for this...
  • Loading branch information
MichalStrehovsky authored Jul 13, 2023
1 parent 08de046 commit d08eff5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<linker>

<!-- Internal implementation details that are always fine to strip -->
<assembly fullname="System.Private.CoreLib">
<type fullname="System.Runtime.CompilerServices.IntrinsicAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="System.Runtime.CompilerServices.ForceDictionaryLookupsAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
</assembly>

<assembly fullname="*">
<!-- Internal attributes shared as implementation, so they could be in any assembly -->
<type fullname="System.Runtime.Versioning.NonVersionableAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
</assembly>

<!-- Public attributes that need to be interpreted by the compiler, fine to strip afterwards -->
<assembly fullname="System.Private.CoreLib" feature="System.AggressiveAttributeTrimming" featurevalue="true">
<type fullname="System.Runtime.CompilerServices.DisableRuntimeMarshallingAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="System.Runtime.CompilerServices.CompilationRelaxationsAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
<type fullname="System.Runtime.CompilerServices.RuntimeCompatibilityAttribute">
<attribute internal="RemoveAttributeInstances" />
</type>
</assembly>

</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<ItemGroup>
<ILLinkSubstitutionsXmls Include="ILLink\ILLink.Substitutions.xml" />
<ILLinkLinkAttributesXmls Include="ILLink\ILLink.LinkAttributes.xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)'=='true'">
<ILLinkSubstitutionsXmls Include="ILLink\ILLink.Substitutions.Unix.xml" />
Expand Down

0 comments on commit d08eff5

Please sign in to comment.