-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Complete warnings for AOT unsafe interop #74697
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
If we tell people to use the source generator for AsAny/LayoutClass/System.Delegate marshalling, the source generator will then tell them it's unsupported. It will shift the blame, but the end result for the user is the same if we don't send them on a hike first. |
Yes, it is the case with retrofitting existing AOT unsafe code. Steering people towards source generated interop is more interesting for new code. Source generated interop has natural AOT safety guiderails and prevents the AOT unsafe code to be written in the first place. |
Do source generated P/Invokes support direct P/Invoke and static linking? If not then I think it's not a replacement of current P/Invokes. |
Yes. This aspect is not different between source generated and built-in marshalling. All P/Invokes (except a few outliers) in this repo have been switched to be source generated, and native aot publishing uses direct P/Invokes and static linking extensively. |
This logic is shared with IL Linker and IL Linker doesn't have access to this unfortunately. |
Warnings for AOT unsafe interop are incomplete best effort currently: #74630 (comment)
runtime/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/ReflectionMethodBodyScanner.cs
Lines 566 to 643 in 2201016
The text was updated successfully, but these errors were encountered: