-
Notifications
You must be signed in to change notification settings - Fork 516
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
[runtime/tools] Implement finding native support libraries when linking statically. Fixes #10950, #11145 and #12100. #12323
Conversation
…ng statically. Fixes xamarin#10950, xamarin#11145 and xamarin#12100. * Add support for Mono Components. * Modify how we look up symbols from native libraries shipped with Mono: we keep track of which native libraries we linked with, and depending on how we linked to those assemblies, we look the symbols up at runtime in either the current executable (if linking statically), or the actual library (where the P/Invoke says they're supposed to be). * This means that we have to propagate how libmono is linked from the MSBuild code to the Application class so that our existing logic is able to correctly determine which native mono lib to use. * Modify how we list the P/Invokes we need to preserve by taking into account the list of native libraries from Mono we have to link with (for .NET). For legacy Xamarin, I've reverted the logic to how it was before we started adding .NET support. Fixes xamarin#10950. Fixes xamarin#11145. Fixes xamarin#12100.
@rolfbjarne @spouliot - do we know roughly any size gains, and/or startup perf impact if any ? |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results4 tests failed, 114 tests passed.Failed tests
Pipeline on Agent XAMBOT-1101.BigSur |
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.
LGTM
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results1 tests failed, 117 tests passed.Failed tests
Pipeline on Agent XAMBOT-1101.BigSur' |
Test failure is unrelated (https://github.com/xamarin/maccore/issues/2443). |
I would be quite surprised if this had any measurable startup perf impact, the only new thing we do now are a few string comparisons. I haven't done any size measurements, so I don't know the size gain (if any) there. |
@SamMonoRT the size impact seems minimal between this commit and the previous one
|
Add support for Mono Components.
Modify how we look up symbols from native libraries shipped with Mono: we keep
track of which native libraries we linked with, and depending on how we linked
to those assemblies, we look the symbols up at runtime in either the current executable
(if linking statically), or the actual library (where the P/Invoke says they're
supposed to be).
This means that we have to propagate how libmono is linked from the MSBuild code
to the Application class so that our existing logic is able to correctly determine
which native mono lib to use.
Modify how we list the P/Invokes we need to preserve by taking into account the
list of native libraries from Mono we have to link with (for .NET). For legacy
Xamarin, I've reverted the logic to how it was before we started adding .NET support.
Fixes #10950.
Fixes #11145.
Fixes #12100.