From 89564aae8cc7c5dde21966a696e73daecf190e24 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 13 Dec 2022 10:23:14 +0100 Subject: [PATCH] Use ReferencePathWithRefAssemblies for libs ILLink Fixes https://github.com/dotnet/runtime/issues/79513 The libraries build invokes ILLink to perform "library" mode trimming. The libraries build step is expected to be runtime agnostic and shouldn't bind against a specific CoreLib runtime implementation. During compilation, even though we have a ProjectReference pointing to the CoreLib/src project, we build against CoreLib/ref. But that ILLink invocation doesn't honor that as it uses the ReferencePath msbuild item instead of ReferencePathWithRefAssemblies. --- eng/illink.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/illink.targets b/eng/illink.targets index 6faae27a7ae624..e574f066166bf5 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -274,7 +274,7 @@ /> - <_DependencyDirectoriesTemp Include="@(ReferencePath->'%(RootDir)%(Directory)')" /> + <_DependencyDirectoriesTemp Include="@(ReferencePathWithRefAssemblies->'%(RootDir)%(Directory)')" /> <_DependencyDirectories Condition="'%(_DependencyDirectoriesTemp.ReferenceSourceTarget)'=='ProjectReference'" Include="%(_DependencyDirectoriesTemp.Identity)" />