diff --git a/eng/illink.targets b/eng/illink.targets
index ddd4936cc2647..682871ebc72b0 100644
--- a/eng/illink.targets
+++ b/eng/illink.targets
@@ -184,22 +184,37 @@
+
+
+
+
+ $(ILLinkArgs) -t
+
+
+ $(ILLinkArgs) --strip-link-attributes false --ignore-link-attributes true
+
+ $(ILLinkArgs) --skip-unresolved true
+
+ $(ILLinkArgs) --disable-opt unusedinterfaces
+
+
+
-
+
- $(ILLinkArgs)-r $(TargetName)
+ $(ILLinkArgs) -r $(TargetName)
$(ILLinkArgs) -c skip
$(ILLinkArgs) -u skip
$(ILLinkArgs) -p link $(TargetName)
-
- $(ILLinkArgs) -t
$(ILLinkArgs) -b true
$(ILLinkArgs) --strip-descriptors false
@@ -207,27 +222,21 @@
$(ILLinkArgs) -x "$(ILLinkTrimXmlLibraryBuild)"
$(ILLinkArgs) --strip-substitutions false
-
-
- $(ILLinkArgs) --strip-link-attributes false --ignore-link-attributes true
-
- $(ILLinkArgs) --skip-unresolved true
-
- $(ILLinkArgs) --disable-opt unusedinterfaces
$(ILLinkArgs) --keep-dep-attributes true
- $(ILLinkArgs) --nowarn IL2006;IL2008;IL2009;IL2012;IL2025;IL2026;IL2035;IL2041
+ $(ILLinkArgs) --nowarn IL2006;IL2008;IL2009;IL2012;IL2025;IL2026;IL2035;IL2050
diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props
index 57898d4ff67e4..98097c8ab3188 100644
--- a/src/libraries/Directory.Build.props
+++ b/src/libraries/Directory.Build.props
@@ -328,4 +328,5 @@
false
true
+
diff --git a/src/libraries/illink-sharedframework.targets b/src/libraries/illink-sharedframework.targets
new file mode 100644
index 0000000000000..9ccc5a2ec850f
--- /dev/null
+++ b/src/libraries/illink-sharedframework.targets
@@ -0,0 +1,76 @@
+
+
+
+
+
+ $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'ILLinkTrimAssembly', '$(BuildSettings)', 'trimmed-runtimepack'))
+
+
+
+
+ $(ILLinkArgs) -c link
+
+ $(ILLinkArgs) -b true
+
+ $(ILLinkArgs) --nowarn IL2006;IL2009;IL2025;IL2026;IL2035;IL2050
+
+
+
+
+
+
+
+
+ <_AssemblyPaths>$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir);$(SystemPrivateCoreLibPath)
+
+
+
+
+ <_DependencyDirectories Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir.TrimEnd('\'))" />
+
+
+
+ $(ILLinkArgs) -d @(_DependencyDirectories->'"%(Identity)"', ' -d ')
+
+
+
+ <_AssembliesToLink Include="System.Private.CoreLib" />
+
+ <_LibrariesToLink Include="$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)*.dll" />
+ <_AssembliesToLink Include="@(_LibrariesToLink->'%(FileName)')" />
+
+
+
+ $(ILLinkArgs) -r @(_AssembliesToLink->'%(Identity)', ' -r ')
+
+
+
+
+ <_DotNetHostDirectory>$(RepoRoot).dotnet
+ <_DotNetHostFileName>dotnet
+ <_DotNetHostFileName Condition=" '$(OS)' == 'Windows_NT' ">dotnet.exe
+
+
+
+
+
+
+
diff --git a/src/libraries/src.proj b/src/libraries/src.proj
index c534a380309d5..ce82c68ea701a 100644
--- a/src/libraries/src.proj
+++ b/src/libraries/src.proj
@@ -49,6 +49,9 @@
Properties="$(TraversalGlobalProperties)" />
+
+