-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Remove GetICUVersion from being preserved unconditionally by the ILLinker #39102
Comments
I am wondering how much we'll gain when trimming this method? is it really worth it? |
It isn't so much about the size gain. The size gain is super minimal. The bigger issue is the static linking with InvariantMode, as mentioned above. |
So can we make it conditional on InvariantMode? |
What is the motivation to have this pinvoke compiled into SPC at all? My understanding is that this is used for some test checks only, why the pinvoke cannot be defined in test assembly directly? |
This was discussed when we introduced using ICU on Windows. The reason we preferred having it there is because the test assembly not aware if the ICU is loaded at all in the process or not or we are in NLS mode or ICU mode. Or if we are in NLS mode and somehow someone loaded ICU in the process for any other reason. having it in the SPC make it just straight forward if we are really in ICU mode without any heuristics. |
Also, the reason why this PInvoke wasn't added into the test assembly directly is because the PInvoke is a QCall, which is internal and only allowed from |
I see. I agree with @eerhardt that the simplest solution then is to move the rule to "_LibraryBuild.xml" file for SPC. |
This work isn't necessary to ship 5.0, so moving to 6.0. |
Resolved by #48120. |
We have one entry in CoreLib's ILLink.Descriptors.xml that is only used for testing:
runtime/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.Shared.xml
Lines 3 to 6 in b779870
We should remove this entry so the method is trimmed when linking an app. See @marek-safar's comment here: #35199 (comment)
One option would be to make a "_LibraryBuild.xml" file for CoreLib and only preserve this method when doing the "library build". The descriptor entry won't be embedded into the assembly, so it won't be picked up when linking the user's application.
@safern @joperezr @layomia
The text was updated successfully, but these errors were encountered: