You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NativeAOT] Low level API support for Objective-C scenarios #77472
High level questions about how to approach implementing this
Is it desired to support this API in NativeAOT?
Can the work to support the ObjectiveCMarshal API be split over multiple PRs. If so, is there a recommended way to turn off the feature for release builds, but still have the CI system test the feature?
Yes, we are happy to merge contributions that fill in missing functionality in NativeAOT.
Xamarin-macios uses the CoreCLR hosting functions coreclr_initialize, coreclr_create_delegate, and coreclr_execute_assembly to execute some managed code before the application-defined main method starts running.
Xamarin-macios uses the CoreCLR hosting functions coreclr_initialize, coreclr_create_delegate, and coreclr_execute_assembly to execute some managed code before the application-defined main method starts running.
I agree that the full set of CoreCLR hosting APIs does not make sense for NativeAOT. The only feature that Xamarin-macios needs from a "hosting" API is the ability to call UnmanagedCallersOnly functions and before the application's main method. I have filed #77957 for this feature.
@AustinWise Marking this as future since there is no rush and no expectation all of it will be done in .NET 8. If you are able to make it happen hooray, just don't want to put undue pressure on you.
Activity
jkotas commentedon Oct 26, 2022
Yes, we are happy to merge contributions that fill in missing functionality in NativeAOT.
These CoreCLR hosting APIs do not make a lot of sense in NativeAOT world. The basic NativeAOT hosting primitive is
UnmanagedCallersOnlymethod exported as C entrypoint. https://github.com/dotnet/samples/tree/main/core/nativeaot/NativeLibrary is a sample that shows how to it.jkotas commentedon Oct 26, 2022
Yes, that's fine. Smaller PRs are typically reviewed and merged faster that makes it easier to make progress.
lambdageek commentedon Oct 26, 2022
/cc @ivanpovazan
AustinWise commentedon Nov 6, 2022
I agree that the full set of CoreCLR hosting APIs does not make sense for NativeAOT. The only feature that Xamarin-macios needs from a "hosting" API is the ability to call
UnmanagedCallersOnlyfunctions and before the application's main method. I have filed #77957 for this feature.AaronRobinsonMSFT commentedon Nov 13, 2022
@AustinWise Marking this as future since there is no rush and no expectation all of it will be done in .NET 8. If you are able to make it happen hooray, just don't want to put undue pressure on you.
AustinWise commentedon Jan 27, 2023
@AaronRobinsonMSFT This API is now implemented to a sufficient degree to unblock #80905. The milestone can be updated to .NET 8.
One small piece of the API in unimplemented. Since Xamarin does not currently use it, I have separated it out to its own tracking ticket: #80985