-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix embedded coreclr detection in corhost.cpp #80294
Merged
Merged
Conversation
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
The `CORECLR_EMBEDDED` define that is used in corhost.cpp to detect whether the current host has coreclr and some other native libraries embedded or not doesn't work. The reason is that corhost.cpp is not compiled separately for the cases of embedded and non-embedded coreclr. The proper way is to check the `g_coreclr_embedded` global variable that is defined in the ceemain.cpp, which is compiled separately for those two cases. While we could also make the corhost.cpp build twice, it would be a waste of time.
cc: @am11 |
jkotas
approved these changes
Jan 6, 2023
am11
approved these changes
Jan 6, 2023
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 👍
elinor-fung
approved these changes
Jan 6, 2023
janvorli
added a commit
to janvorli/runtime
that referenced
this pull request
Jan 6, 2023
Port of dotnet#78484, dotnet#78790, dotnet#80104 and dotnet#80294 This change adds detecting and logging of failures during coreclr initialization. For logging, it uses a new host API `coreclr_set_error_writer` to register a callback to report the errors to the host. The hosts have support for optional usage of this API so that they can work with older runtime versions as well. The logging checks and reports failures with: * System.Private.CoreLib.dll * GC initialization * JIT initialization * libSystem.Native.so/dylib on Unix The logging messages should allow customers to self-diagnose the issues causing the failures. This change also adds backport of support for standalone GC back compatibility that is a prerequisite for it.
This was referenced Jan 10, 2023
janvorli
added a commit
to janvorli/runtime
that referenced
this pull request
Jan 17, 2023
Port of dotnet#78484, dotnet#78790, dotnet#80104 and dotnet#80294 This change adds detecting and logging of failures during coreclr initialization. For logging, it uses a new host API `coreclr_set_error_writer` to register a callback to report the errors to the host. The hosts have support for optional usage of this API so that they can work with older runtime versions as well. The logging checks and reports failures with: * System.Private.CoreLib.dll * GC initialization * JIT initialization * libSystem.Native.so/dylib on Unix The logging messages should allow customers to self-diagnose the issues causing the failures. This change also adds backport of support for standalone GC back compatibility that is a prerequisite for it.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The
CORECLR_EMBEDDED
define that is used in corhost.cpp to detect whether the current host has coreclr and some other native libraries embedded or not doesn't work. The reason is that corhost.cpp is not compiled separately for the cases of embedded and non-embedded coreclr.The proper way is to check the
g_coreclr_embedded
global variable that is defined in the ceemain.cpp, which is compiled separately for those two cases.While we could also make the corhost.cpp build twice, it would be a waste of time.