Skip to content

Investigate whether we can remove more attributes in the linker #16678

Description

@rolfbjarne

We should create a list of all the attributes in our platform assembly (sorted by how often they appear), and go through each of them to answer if they're needed.

The investigation and implementation plan are documented in this analysis gist.

Except for attributes that are safe to remove unconditionally, removal must only happen when all these conditions are true:

  • PrepareAssemblies=true
  • PostProcessAssemblies=true
  • The trimmable-static registrar is used

Implementation checklist:

Attributes removed by RemoveAttributesStep should be moved to trimmer xml files like ProtocolMemberAttribute, because the RemoveAttributesStep isn't executed for NativeAOT:

  • Foundation.ProtocolAttribute
  • ObjCRuntime.NativeNameAttribute
  • ObjCRuntime.AdoptsAttribute

Metadata

Metadata

Assignees

No one assigned

    Labels

    app-sizeenhancementThe issue or pull request is an enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions