-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CoreCLR] More CLR hosting support (#9572)
Implements but does not complete CoreCLR host support. The runtime build will be enabled later, which will also be used to fix and update tests, potentially introducing new ones. This is in the interest to keep this PR as small as possible and getting the changes that affect the whole build system into `main` as quickly as possible.
- Loading branch information
Showing
69 changed files
with
4,829 additions
and
236 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Notes | ||
|
||
## Potential optimizations | ||
|
||
* https://github.com/dotnet/runtime/blob/9b24fb60a19f62620ca1fc5e4eb2e3ae0b3b086d/src/coreclr/binder/assemblybindercommon.cpp#L844-L889 | ||
* Managed C++ assemblies aren't available on Unix, no point in looking for them | ||
* `candidates[]` is `WCHAR*`, while `ProbeAppBundle` takes UTF-8 - no point in doing the | ||
conversion here | ||
* Host contract | ||
* It might make sense to pass strings as Unicode to host and back, to avoid conversions. | ||
p/invoke names for instance, can be Unicode. So can be the assembly names. Native library | ||
names should be UTF-8, but we can generate lookup tables for those at application build time | ||
(e.g. indexed by an xxHash of the Unicode version of the name) - no conversion at run time. | ||
* We need declarations of all he possible HRESULT errors (`S_OK` etc) | ||
|
||
## Stuff that should be changed | ||
|
||
### Logging | ||
Currently, most of the messages logged by the runtime end up in `/dev/null` (either because they | ||
are disabled in release build or because they log to stdio which doesn't work on Android). | ||
|
||
Logcat is the only way to get information from remote devices, especially via Google Play Console. | ||
|
||
We should log to logcat: | ||
|
||
+ C++ exception messages | ||
+ abort() messages / fatal errors | ||
+ warnings | ||
+ errors | ||
|
||
A subsystem should be added which will provide a single function that will do actual output, implementation of which | ||
will be specific to the platform. API should allow specification of severity, the actual message, and possibly a flag | ||
to indicate whether the process should be aborted (the decision might also be based on the severity). Severity should | ||
be shared between all targets, which then can (if needed) translate it to the target platform's value(s), if any. | ||
|
||
### Process termination | ||
Runtime currently calls `abort()` in several places. This should probably become part of the host contract instead. | ||
Being part of the contract, the target platform could implement process termination on `abort()` in a uniform way | ||
(includes platform-specific logging, preparation etc) | ||
|
||
## Issues and workarounds | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
The header files in this directory are verbatim copies taken from the | ||
https://github.com/dotnet/runtime/ repository. | ||
|
||
They can be found in the following locations in the repository: | ||
|
||
src/native/corehost/host_runtime_contract.h | ||
src/coreclr/hosts/inc/coreclrhost.h | ||
|
||
and they MUST be in sync with the current version of the runtime being | ||
used. They don't have to come from the same version, but their content | ||
must be ABI and API compatible with it. |
Oops, something went wrong.