未验证 提交 2d30f341 编写于 作者: M Marek Safar 提交者: GitHub

Clean up libraries trimming illink configuration (#48153)

上级 6f93c0b8
...@@ -222,15 +222,10 @@ ...@@ -222,15 +222,10 @@
<!-- ILLink.Tasks arguments common to runs for both individual libraries and for the entire runtime pack --> <!-- ILLink.Tasks arguments common to runs for both individual libraries and for the entire runtime pack -->
<Target Name="SetCommonILLinkArgs"> <Target Name="SetCommonILLinkArgs">
<PropertyGroup> <PropertyGroup>
<!-- don't remove the embedded link attributes xml resource since ILLink may run again on the assembly --> <!-- don't remove attributes after build, our tooling is not ready for that -->
<!-- and ignore the link attributes xml file during the library build, since we need the attributes preserved until the final app is linked --> <ILLinkArgs>$(ILLinkArgs) --ignore-link-attributes true</ILLinkArgs>
<ILLinkArgs>$(ILLinkArgs) --strip-link-attributes false --ignore-link-attributes true</ILLinkArgs>
<!-- ignore unresolved references --> <!-- ignore unresolved references -->
<ILLinkArgs>$(ILLinkArgs) --skip-unresolved true</ILLinkArgs> <ILLinkArgs>$(ILLinkArgs) --skip-unresolved true</ILLinkArgs>
<!-- keep interface implementations -->
<ILLinkArgs>$(ILLinkArgs) --disable-opt unusedinterfaces</ILLinkArgs>
<!-- keep any type check -->
<ILLinkArgs>$(ILLinkArgs) --disable-opt unusedtypechecks</ILLinkArgs>
</PropertyGroup> </PropertyGroup>
</Target> </Target>
...@@ -250,14 +245,8 @@ ...@@ -250,14 +245,8 @@
<!-- trim the target assembly --> <!-- trim the target assembly -->
<ILLinkArgs>$(ILLinkArgs) -p link $(TargetName)</ILLinkArgs> <ILLinkArgs>$(ILLinkArgs) -p link $(TargetName)</ILLinkArgs>
<ILLinkArgs Condition="'$(ILLinkRewritePDBs)' == 'true' and Exists('$(ILLinkTrimAssemblySymbols)')">$(ILLinkArgs) -b true</ILLinkArgs> <ILLinkArgs Condition="'$(ILLinkRewritePDBs)' == 'true' and Exists('$(ILLinkTrimAssemblySymbols)')">$(ILLinkArgs) -b true</ILLinkArgs>
<!-- don't remove the embedded root xml resource since ILLink may run again on the assembly -->
<ILLinkArgs Condition="'$(ILLinkTrimXml)' != ''">$(ILLinkArgs) --strip-descriptors false</ILLinkArgs>
<!-- pass the non-embedded root xml file on the command line --> <!-- pass the non-embedded root xml file on the command line -->
<ILLinkArgs Condition="'$(ILLinkTrimXmlLibraryBuild)' != ''">$(ILLinkArgs) -x "$(ILLinkTrimXmlLibraryBuild)"</ILLinkArgs> <ILLinkArgs Condition="'$(ILLinkTrimXmlLibraryBuild)' != ''">$(ILLinkArgs) -x "$(ILLinkTrimXmlLibraryBuild)"</ILLinkArgs>
<!-- don't remove the embedded substitutions xml resource since ILLink may run again on the assembly -->
<ILLinkArgs Condition="'$(ILLinkSubstitutionsXml)' != ''">$(ILLinkArgs) --strip-substitutions false</ILLinkArgs>
<!-- keep DynamicDependencyAttribute unless a project explicitly disables it -->
<ILLinkArgs Condition="'$(ILLinkKeepDepAttributes)' != 'false'">$(ILLinkArgs) --keep-dep-attributes true</ILLinkArgs>
<!-- suppress warnings with the following codes: <!-- suppress warnings with the following codes:
IL2008: Could not find type A specified in resource B IL2008: Could not find type A specified in resource B
IL2009: Could not find method A in type B specified in resource C IL2009: Could not find method A in type B specified in resource C
...@@ -307,7 +296,7 @@ ...@@ -307,7 +296,7 @@
<_DependencyDirectories Remove="@(_DependencyDirectories)" /> <_DependencyDirectories Remove="@(_DependencyDirectories)" />
<_DependencyDirectories Include="%(_DependencyDirectoriesNoSlash.PathWithoutSlash)" /> <_DependencyDirectories Include="%(_DependencyDirectoriesNoSlash.PathWithoutSlash)" />
<ILLinkTrimInputAssembly Include="$(ILLinkTrimInputPath)$(TargetName)$(TargetExt)"> <ILLinkTrimInputAssembly Include="$(ILLinkTrimInputPath)$(TargetName)$(TargetExt)">
<RootMode>visible</RootMode> <RootMode>library</RootMode>
</ILLinkTrimInputAssembly> </ILLinkTrimInputAssembly>
</ItemGroup> </ItemGroup>
......
...@@ -229,6 +229,12 @@ ...@@ -229,6 +229,12 @@
<property name="Scope">member</property> <property name="Scope">member</property>
<property name="Target">M:System.Runtime.Serialization.XmlFormatReaderGenerator.UnsafeGetUninitializedObject(System.Type)</property> <property name="Target">M:System.Runtime.Serialization.XmlFormatReaderGenerator.UnsafeGetUninitializedObject(System.Type)</property>
</attribute> </attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2067</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Runtime.Serialization.SurrogateDataContract.GetUninitializedObject(System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute"> <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument> <argument>ILLink</argument>
<argument>IL2070</argument> <argument>IL2070</argument>
...@@ -446,4 +452,4 @@ ...@@ -446,4 +452,4 @@
<property name="Target">M:System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteCollection(System.Runtime.Serialization.CollectionDataContract)</property> <property name="Target">M:System.Runtime.Serialization.XmlFormatWriterGenerator.CriticalHelper.WriteCollection(System.Runtime.Serialization.CollectionDataContract)</property>
</attribute> </attribute>
</assembly> </assembly>
</linker> </linker>
\ No newline at end of file
...@@ -13,5 +13,11 @@ ...@@ -13,5 +13,11 @@
<property name="Scope">member</property> <property name="Scope">member</property>
<property name="Target">M:System.Text.Json.Serialization.ReflectionEmitMemberAccessor.CreateParameterizedConstructor(System.Reflection.ConstructorInfo)</property> <property name="Target">M:System.Text.Json.Serialization.ReflectionEmitMemberAccessor.CreateParameterizedConstructor(System.Reflection.ConstructorInfo)</property>
</attribute> </attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2090</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Text.Json.Serialization.ReflectionMemberAccessor.CreateParameterizedConstructor(System.Reflection.ConstructorInfo)</property>
</attribute>
</assembly> </assembly>
</linker> </linker>
\ No newline at end of file
...@@ -67,5 +67,35 @@ ...@@ -67,5 +67,35 @@
<property name="Scope">member</property> <property name="Scope">member</property>
<property name="Target">M:System.Text.Json.Serialization.IEnumerableConverterFactoryHelpers.GetImmutableEnumerableCreateRangeMethod(System.Type,System.Type)</property> <property name="Target">M:System.Text.Json.Serialization.IEnumerableConverterFactoryHelpers.GetImmutableEnumerableCreateRangeMethod(System.Type,System.Type)</property>
</attribute> </attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2077</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Text.Json.Serialization.ReflectionMemberAccessor.&lt;&gt;c__DisplayClass0_0.&lt;CreateConstructor&gt;b__0</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2080</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Text.Json.Serialization.ReflectionMemberAccessor.CreateConstructor(System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2090</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Text.Json.Serialization.ReflectionMemberAccessor.CreateAddMethodDelegate``1</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2090</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Text.Json.Serialization.ReflectionMemberAccessor.CreateParameterizedConstructor``1(System.Reflection.ConstructorInfo)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2090</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Text.Json.Serialization.ReflectionMemberAccessor.CreateParameterizedConstructor``5(System.Reflection.ConstructorInfo)</property>
</attribute>
</assembly> </assembly>
</linker> </linker>
\ No newline at end of file
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<_LibrariesToLink Include="$(SystemPrivateCoreLibPath)" /> <_LibrariesToLink Include="$(SystemPrivateCoreLibPath)" />
<RootAssemblies Include="@(_LibrariesToLink)"> <RootAssemblies Include="@(_LibrariesToLink)">
<RootMode>visible</RootMode> <RootMode>library</RootMode>
</RootAssemblies> </RootAssemblies>
</ItemGroup> </ItemGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册