diff --git a/tools/dotnet-linker/SetupStep.cs b/tools/dotnet-linker/SetupStep.cs index f224b76bfbb8..eb031d8cab75 100644 --- a/tools/dotnet-linker/SetupStep.cs +++ b/tools/dotnet-linker/SetupStep.cs @@ -85,16 +85,13 @@ protected override void TryProcess () // though we know that sdk assemblies will never have Preserve attributes, user assemblies may have // [assembly: LinkSafe] attributes, which means we treat them as sdk assemblies and those may have // Preserve attributes. - // TODO: LinkSafeAttribute doesn't appear to be handled anywhere. Is this attribute still supported? - // ApplyPreserveAttribute no longer runs on all assemblies. [assembly: Preserve (typeof (SomeAttribute))] will - // no longer give SomeAttribute "Preserve" semantics. MarkHandlers.Add (new DotNetMarkAssemblySubStepDispatcher (new ApplyPreserveAttribute ())); MarkHandlers.Add (new OptimizeGeneratedCodeHandler ()); - // MarkNSObjects will run for all marked assemblies. MarkHandlers.Add (new DotNetMarkAssemblySubStepDispatcher (new MarkNSObjects ())); MarkHandlers.Add (new PreserveSmartEnumConversionsHandler ()); - // TODO: these steps should probably run after mark. + // This step could be run after Mark to avoid tracking all members: + // https://github.com/xamarin/xamarin-macios/issues/11447 pre_mark_substeps.Add (new CollectUnmarkedMembersSubStep ()); pre_mark_substeps.Add (new StoreAttributesStep ()); diff --git a/tools/linker/ApplyPreserveAttribute.cs b/tools/linker/ApplyPreserveAttribute.cs index cce80d3cad7b..ba65906968a2 100644 --- a/tools/linker/ApplyPreserveAttribute.cs +++ b/tools/linker/ApplyPreserveAttribute.cs @@ -66,6 +66,8 @@ void ProcessAssemblyAttributes (AssemblyDefinition assembly) } } + // In .NET6, ApplyPreserveAttribute no longer runs on all assemblies. + // [assembly: Preserve (typeof (SomeAttribute))] no longer gives SomeAttribute "Preserve" semantics. #if !NET // if the type is a custom attribute then it means we want to preserve what's decorated // with this attribute (not just the attribute alone)