Skip to content

NativeAOT doesnt have a way to remove all occurences of an attribute #80466

@tlakollo

Description

@tlakollo

Description

ILLink has the option of using a wildcard * when processing LinkAttributes xml files. This allows removing an attribute existing in System.Private.CoreLib from all input assemblies (including System.Private.CoreLib). The way ILLink does this is by using its context to remember which attribute needs to be removed. NativeAOT doesnt have access to this context that coul allow to remember which attribute needs to be removed from other assemblies, therefore NativeAOT currently does not support the * wildcard

Reproduction Steps

System.Private.CoreLib actually declares a LinkAttributes xml file with this pattern https://github.com/dotnet/runtime/blob/main/src/mono/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.xml#L10-L15

Expected behavior

The attribute is removed from all the assemblies

Actual behavior

The attribute is kept

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions