Skip to content
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

Add AOT support for the EntryPoint property for UnmanagedCallersOnly. #44809

Merged
merged 3 commits into from
Nov 19, 2020

Conversation

vargaz
Copy link
Contributor

@vargaz vargaz commented Nov 17, 2020

Fixes #44803.

…returns the beginning of the metadata string so its length can be computed.
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

export_name [slen] = 0;
}
}
g_free (named_args);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
g_free (named_args);
g_assert (!typed_args);
g_free (named_args);

Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
MonoMethod *wrapper;

if (!(method->flags & METHOD_ATTRIBUTE_STATIC)) {
g_warning ("AOT restriction: Method '%s' must be static since it is decorated with [UnmanagedCallers].",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this permanent limitation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's part of the spec of UnmanagedCallersOnlyAttribute

It is an error to apply the attribute to anything other than an ordinary static method or ordinary static local function. The C# compiler will mark any non-static or static non-ordinary methods imported from metadata with this attribute as unsupported by the language.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we check only for this restriction then and shouldn't this be TLE or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its just a copy paste from the MonoPInvokeCallback case.

@vargaz vargaz merged commit 88c4a46 into dotnet:master Nov 19, 2020
@vargaz vargaz deleted the aot-entrypoint branch November 19, 2020 10:24
@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[aot] Mono should support UnmanagedCallersOnly EntryPoint attribute
4 participants