Resolves #66191.
I no longer see the warning or the link.exe failure. This likely was a link.exe bug like I suspected in the issue based on available evidence.
Of course we also regressed multimodule mode so I'm fixing that too.
<!-- Set defaults for unspecified properties -->
<PropertyGroup>
- <NativeLib Condition="'$(OutputType)' == 'Library' and '$(NativeLib)' == ''">Shared</NativeLib>
+ <NativeLib Condition="'$(OutputType)' == 'Library' and '$(NativeLib)' == '' and '$(IlcMultiModule)' != 'true'">Shared</NativeLib>
<NativeIntermediateOutputPath Condition="'$(NativeIntermediateOutputPath)' == ''">$(IntermediateOutputPath)native\</NativeIntermediateOutputPath>
<NativeOutputPath Condition="'$(NativeOutputPath)' == ''">$(OutputPath)native\</NativeOutputPath>
<NativeCompilationDuringPublish Condition="'$(NativeCompilationDuringPublish)' == ''">true</NativeCompilationDuringPublish>
<!-- This test always runs as multimodule. It's not supported if we don't have framework object files. -->
<CLRTestTargetUnsupported Condition="'$(BuildNativeAotFrameworkObjects)' != 'true'">true</CLRTestTargetUnsupported>
<IlcMultiModule>true</IlcMultiModule>
-
- <!-- https://github.com/dotnet/runtime/issues/66191 -->
- <CLRTestTargetUnsupported>true</CLRTestTargetUnsupported>
</PropertyGroup>
<ItemGroup>
<Compile Include="MultiModule.cs" />