Skip to content

Commit

Permalink
Add a custom flag to disable marking of copy assemblies (#2370) (#2437)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vitek-karas authored Jan 6, 2022
1 parent 4e27b85 commit e28b7f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 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 e28b7f3

Please sign in to comment.