netcore: Static linking of native libs#20589
Merged
akoeplinger merged 1 commit intomono:masterfrom Dec 7, 2020
Merged
Conversation
c2c934e to
19d5f8f
Compare
fd2e8a9 to
2ddc1ff
Compare
d682118 to
9fca8fe
Compare
Statically linking `libSystem.Globalization.Native` and `libSystem.IO.Compression.Native`/`clrcompression` and use overrider mechanism to invoke. - Added support for PInvoke overriding mechanism. A static host or embedder can provide a callback to participate in PInvoke resolution, - At the time of PInvoke resolution, if there is an override it gets a chance to provide an implementation before normal PInvoke resolution process. - `libSystem.Globalization.Native` no longer relies on "QCall" mechanism. Instead there is a default/built-in override, which runs right after the host-provided one. Host-provided override has preference since it runs first. - The default overrider can be extended if we add more cases where PInvokes are backed by implementations statically linked into runtime (regardless of single-file or .dll/.so scenarios) - The signature of the overrider callback is: ```c const void* (PInvokeOverrideFn)(const char* libraryName, const char* entrypointName); ``` Returning `NULL` is interpreted as "no-match" case. - The overrider is passed to `coreclr_initialize` as a property named `PINVOKE_OVERRIDE`. The value is a pointer encoded as a hex-based string value. This is similar to `BUNDLE_PROBE`. - The implementation of an override is up to the overrider. In this change the following scheme was used: -- Host overrider dispatches on the name of the library (text match) and defers to one of the embedded libraries, if there is a match. -- The library dispatches on the _native_ name of the Dll Import and provides a method pointer of there is a match.
9fca8fe to
aecab1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
!! This PR is a copy of dotnet/runtime#44505, please do not edit or review it in this repo !!
Do not automatically approve this PR:
* Consider how the changes affect configurations in this repo,
* Check effects on files that are not mirrored,
* Identify test cases that may be needed in this repo.
!! Merge the PR only after the original PR is merged !!