-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ILLink.Substitutions.xml files for System.Private.CoreLib. #37615
Conversation
Tagging subscribers to this area: @ViktorHofer |
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoArmIntrinsics.xml
Outdated
Show resolved
Hide resolved
src/mono/netcore/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.wasm.xml
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Outdated
Show resolved
Hide resolved
@@ -145,6 +141,19 @@ | |||
<DefineConstants Condition="'$(TargetstvOS)' == 'true'">$(DefineConstants);TARGET_TVOS</DefineConstants> | |||
</PropertyGroup> | |||
|
|||
<!-- ILLinker settings --> | |||
<PropertyGroup> | |||
<ILLinkClearInitLocals>true</ILLinkClearInitLocals> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @layomia since you have a PR out changing this too.
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.32bit.xml
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoArmIntrinsics.xml
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Show resolved
Hide resolved
Note that this work is blocked by the failing CI. The failure occurs when creating a Windows PDB for the portable PDB:
Debugging into Pdb2Pdb.exe, I see the first problem is that we are trimming away locals from this method: runtime/src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs Lines 233 to 251 in bd6cbe3
The 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);
} @vitek-karas @marek-safar - I logged dotnet/linker#1260 for this. After that, Pdb2Pdb is trying to work on this method: runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CharUnicodeInfo.cs Lines 231 to 248 in bd6cbe3
But it is throwing a
From doing a little debugging, it appears that the top scope is getting closed in I've opened dotnet/symreader-converter#174 for the Pdb2Pdb crash, which is blocking clean CI. |
d4c4c8a
to
923a634
Compare
I've removed the |
Ported the settings from https://github.com/mono/mono/blob/eaa32d13659f0a6b6b5e62ddb49af68b1f9efb6c/sdks/wasm/src/linker-subs.xml and split them out as appropriate to reduce duplication across the different platform builds. Contributes to dotnet#31785
923a634
to
ba2fa03
Compare
Ported the settings from https://github.com/mono/mono/blob/eaa32d13659f0a6b6b5e62ddb49af68b1f9efb6c/sdks/wasm/src/linker-subs.xml and split them out as appropriate to reduce duplication across the different platform builds.
Contributes to #31785
The only API proposed in #31785 that I didn't cover was
System.Runtime.InteropService.OSPlatform
since there isn't a good way of supporting that in the linker, AFAIK.For a "Hello, World" wasm app,
System.Private.CoreLib.dll
sizes go from: