Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Rozenfeld <erozen@microsoft.com>2018-02-28 03:28:00 +0300
committerEugene Rozenfeld <erozen@microsoft.com>2018-03-10 03:12:36 +0300
commit69953f61937e585df3bdd83a1d09fc45cbc2d396 (patch)
treef28d0cb7a816e70ca056133a581b9012d63d95cb /illink.targets
parentca64ba94a8f19f2b5d8afc2f178af32e576f4852 (diff)
Updates for ILLink integration.
1. Update ILLink.Tasks version. 2. Embed ILLinkTrim.xml as an assembly resource. The linker knows how to process embedded xml files. This will ensure that the types, methods, and fields specified in ILLinkTrim.xml won't be removed when customers run ILLink on shipped assemblies. 3. Add --skip-unresolved true so that the linker is tolerant to missing assembly references. 4. Remove the option that hard-coded netstandard by name. 5. ClearInitLocals is now exposed as a parameter of ILLInk task. Use it instead of specifying the plugin option in ILLinkArgs. I verified that the set of things removed by the linker didn't change.
Diffstat (limited to 'illink.targets')
-rw-r--r--illink.targets23
1 files changed, 17 insertions, 6 deletions
diff --git a/illink.targets b/illink.targets
index 440c06f59c..005a1d7ff9 100644
--- a/illink.targets
+++ b/illink.targets
@@ -25,6 +25,12 @@
<ILLinkRewritePDBs Condition="'$(ILLinkRewritePDBs)' == '' AND '$(DebugSymbols)' != 'false'">true</ILLinkRewritePDBs>
</PropertyGroup>
+ <ItemGroup Condition="'$(ILLinkTrimXml)' != ''">
+ <EmbeddedResource Include="$(ILLinkTrimXml)">
+ <LogicalName>$(AssemblyName).xml</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+
<!-- Custom binplacing for pre/post-trimming and reports that is useful for analysis
Must be enabled by setting BinPlaceILLinkTrimAssembly=true
-->
@@ -60,20 +66,23 @@
<Target Name="ILLinkTrimAssembly" Condition="'$(ILLinkTrimAssembly)' == 'true'" DependsOnTargets="EnsureBuildToolsRuntime">
<PropertyGroup>
<ILLinkArgs>$(ILLinkArgs)-r $(TargetName)</ILLinkArgs>
- <!-- don't trim anything that's defined in core assemblies -->
+ <!-- default action for core assemblies -->
<ILLinkArgs>$(ILLinkArgs) -c skip</ILLinkArgs>
- <ILLinkArgs>$(ILLinkArgs) -p skip netstandard</ILLinkArgs>
+ <!-- default action for non-core assemblies -->
+ <ILLinkArgs>$(ILLinkArgs) -u skip</ILLinkArgs>
+ <!-- trim the target assembly -->
+ <ILLinkArgs>$(ILLinkArgs) -p link $(TargetName)</ILLinkArgs>
<!-- keep type-forward assemblies (facades) -->
<ILLinkArgs>$(ILLinkArgs) -t</ILLinkArgs>
- <ILLinkArgs Condition="'$(ILLinkTrimXml)' != ''">$(ILLinkArgs) -x $(ILLinkTrimXml)</ILLinkArgs>
<ILLinkArgs Condition="'$(ILLinkRewritePDBs)' == 'true' AND Exists('$(ILLinkTrimAssemblySymbols)')">$(ILLinkArgs) -b true</ILLinkArgs>
<!-- keep types and members required by Debugger-related attributes -->
<ILLinkArgs>$(ILLinkArgs) -v true</ILLinkArgs>
+ <!-- don't remove the embedded root xml resource since ILLink may run again on the assembly -->
+ <ILLinkArgs>$(ILLinkArgs) --strip-resources false</ILLinkArgs>
<!-- reflection heuristics to apply -->
<ILLinkArgs>$(ILLinkArgs) -h LdtokenTypeMethods,InstanceConstructors</ILLinkArgs>
- <!-- add a linker step to clear initlocals flag on all assemblies before the output step -->
- <!-- version of ILLink.CustomSteps is passed as a workaround for msbuild issue #3016 -->
- <ILLinkArgs Condition="'$(ILLinkClearInitLocals)' == 'true'">$(ILLinkArgs) -s ILLink.CustomSteps.ClearInitLocalsStep,ILLink.CustomSteps,Version=0.0.0.0:OutputStep</ILLinkArgs>
+ <!-- ignore unresolved references -->
+ <ILLinkArgs>$(ILLinkArgs) --skip-unresolved true</ILLinkArgs>
</PropertyGroup>
<MakeDir Directories="$(ILLinkTrimInputPath)" />
@@ -100,6 +109,8 @@
<ILLink AssemblyPaths="$(ILLinkTrimInputAssembly);@(_DependencyDirectories)"
RootAssemblyNames=""
OutputDirectory="$(ILLinkTrimOutputPath)"
+ ClearInitLocals="$(ILLinkClearInitLocals)"
+ ClearInitLocalsAssemblies="$(TargetName)"
ExtraArgs="$(ILLinkArgs)" />
</Target>