-
Notifications
You must be signed in to change notification settings - Fork 127
Description
With change dotnet/runtime#37615, we are introducing some ILLink.Substitutions.xml files that direct the linker to trim branches in IL that will never be called. For example, when building for x64, any if (AdvSimd.IsSupported) branches can be trimmed away, since ARM intrinsics will never be true for x64.
However, Pdb2Pdb is failing in this PR:
System.Private.CoreLib -> F:\workspace\_work\1\s\artifacts\bin\coreclr\Windows_NT.x64.Checked\IL\System.Private.CoreLib.dll
PDB0004: token 0x06001C30: Method containing local variables has no local signature
PDB0004: token 0x06001C30: Method containing local variables has no local signature
PDB0004: token 0x06001C31: Method containing local variables has no local signature
PDB0004: token 0x06001C31: Method containing local variables has no local signature
Error HRESULT E_FAIL has been returned from a call to a COM component.
F:\workspace\_work\1\s\.packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20280.1\tools\SymStore.targets(70,5): error MSB3073: The command ""F:\workspace\_work\1\s\.packages\microsoft.diasymreader.pdb2pdb\1.1.0-beta2-19575-01\tools\Pdb2Pdb.exe" "F:\workspace\_work\1\s\artifacts\bin\coreclr\Windows_NT.x64.Checked\IL\System.Private.CoreLib.dll" /out "F:\workspace\_work\1\s\artifacts\SymStore\Checked\System.Private.CoreLib\netcoreapp2.1\x64\System.Private.CoreLib.pdb" /srcsvrvar SRC_INDEX=public" exited with code 2. [F:\workspace\_work\1\s\src\coreclr\src\System.Private.CoreLib\System.Private.CoreLib.csproj]
##[error].packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20280.1\tools\SymStore.targets(70,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command ""F:\workspace\_work\1\s\.packages\microsoft.diasymreader.pdb2pdb\1.1.0-beta2-19575-01\tools\Pdb2Pdb.exe" "F:\workspace\_work\1\s\artifacts\bin\coreclr\Windows_NT.x64.Checked\IL\System.Private.CoreLib.dll" /out "F:\workspace\_work\1\s\artifacts\SymStore\Checked\System.Private.CoreLib\netcoreapp2.1\x64\System.Private.CoreLib.pdb" /srcsvrvar SRC_INDEX=public" exited with code 2.
Debugging into Pdb2Pdb.exe, I see the first problem is that we are trimming away locals from this method:
The if (AdvSimd.Arm64.IsSupported) branch is getting trimmed, but it looks like the local variables are not getting removed from the portable .pdb. Here is the code after trimming:
public static int PopCount(uint value)
{
if (Popcnt.IsSupported)
{
return (int)Popcnt.PopCount(value);
}
!AdvSimd.Arm64.IsSupported;
return BitOperations.<PopCount>g__SoftwareFallback|9_0(value);
}The error
PDB0004: token 0x06001C30: Method containing local variables has no local signature
Is being emitted because Pdb2Pdb is finding local variables in the pdb, but the method doesn't have a "local signature" (since there are no locals in the resulting method).
The ILLinker needs to be removing the locals from the pdbs as well, so tools like Pdb2Pdb still work.