-
Notifications
You must be signed in to change notification settings - Fork 522
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
[release/6.0.4xx] [CoreCLR] Avoid having any internal calls in managed code for CoreCLR. Fixes #15343. #15458
Conversation
Fixes dotnet#15343. CoreCLR does not like running into methods declared as internal calls: [MethodImplAttribute (MethodImplOptions.InternalCall)] and will fail with an error, even if the method is never executed, just encountered by the JIT: ECall methods must be packaged into a system module In the early days of .NET support we solved this by adding an indirection for CoreCLR, where the internal call was hidden inside a managed call that would never be executed at runtime. This seems to work fine in most cases, except when the debugger attached, when I'm guessing the JIT is more aggressive, and looks further ahead (and fails). On the other hand, in the early days of .NET support on macOS the managed code had to work for both Mono and CoreCLR without modification (since the same implementation assembly would be picked by the build independent on the actual runtime). This is no longer the case, since we only support CoreCLR on macOS now, which allows us to put any Mono-specific managed code (such as the internal call) in !macOS conditions. Fixes dotnet#15343.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🔥 [PR Build] Build failed 🔥Build failed for the job 'Generate API diff' Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌Failed tests are:
Pipeline on Agent |
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌Tests failed on VSTS: simulator tests iOS. Test results1 tests failed, 147 tests passed.Failed tests
Pipeline on Agent XAMBOT-1037.Monterey' |
Test failure is unrelated (https://github.com/xamarin/maccore/issues/2606). |
CoreCLR does not like running into methods declared as internal calls:
and will fail with an error, even if the method is never executed, just encountered by the JIT:
In the early days of .NET support we solved this by adding an indirection for
CoreCLR, where the internal call was hidden inside a managed call that would
never be executed at runtime. This seems to work fine in most cases, except
when the debugger attached, when I'm guessing the JIT is more aggressive, and
looks further ahead (and fails).
On the other hand, in the early days of .NET support on macOS the managed code
had to work for both Mono and CoreCLR without modification (since the same
implementation assembly would be picked by the build independent on the actual
runtime). This is no longer the case, since we only support CoreCLR on macOS
now, which allows us to put any Mono-specific managed code (such as the
internal call) in !macOS conditions.
Fixes #15343.
Backport of #15358