Skip to content

Commit

Permalink
Add a custom flag to disable marking of copy assemblies (dotnet/linke…
Browse files Browse the repository at this point in the history
…r#2370)

Enabled by `--custom-data DisableMarkingOfCopyAssemblies=true` on the command line. Assumes that ALL assemblies on the input are in "copy" action (it doesn't validate this fact).

It disables marking basically fully - linker will go over all assemblies, and process them in "copy" mode (copy the original file over) and will call all the custom steps and so on, but it will do no marking (or very little, depends on descriptors and such which this doesn't disable).

This is intentionally non-discoverable feature, to be used only by the mono AOT toolchain.

Commit migrated from dotnet/linker@c90ed0a
  • Loading branch information
vitek-karas authored Nov 15, 2021
1 parent ac94046 commit c959dfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tools/illink/src/linker/Linker.Steps/MarkStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,9 @@ protected void MarkAssembly (AssemblyDefinition assembly, DependencyInfo reason)
MarkExportedTypesTarget.ProcessAssembly (assembly, Context);

if (ProcessReferencesStep.IsFullyPreservedAction (Context.Annotations.GetAction (assembly))) {
MarkEntireAssembly (assembly);
if (!Context.TryGetCustomData ("DisableMarkingOfCopyAssemblies", out string? disableMarkingOfCopyAssembliesValue) ||
disableMarkingOfCopyAssembliesValue != "true")
MarkEntireAssembly (assembly);
return;
}

Expand Down

0 comments on commit c959dfa

Please sign in to comment.