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

[NativeAOT LLVM] Missing main export when using IlcExportUnmanagedEntrypoint=true #2433

Open
maraf opened this issue Nov 21, 2023 · 2 comments
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)

Comments

@maraf
Copy link
Member

maraf commented Nov 21, 2023

If I set IlcExportUnmanagedEntrypoint=true, main is not exported.
It can be fixed by adding <CustomLinkerArg Include="-Wl,--export,__main_argc_argv" />

https://github.com/dotnet/runtimelab/blob/feature/NativeAOT-LLVM/src/coreclr/tools/aot/ILCompiler/Program.cs#L590

Is it correct to add such export explicitly when IlcExportUnmanagedEntrypoint == true && NativeLib == ''?

@maraf maraf added the area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly) label Nov 21, 2023
@ivanpovazan
Copy link
Member

Is the question related to the managed main?

If I am not mistaken, managed main is exposed via __managed__Main symbol

@maraf
Copy link
Member Author

maraf commented Nov 22, 2023

Good question. I didn't realized yesterday that I need to call the actual C# main, the one that user, possibly async, so that we can yield to JavaScript loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-LLVM LLVM generation for Native AOT compilation (including Web Assembly)
Projects
None yet
Development

No branches or pull requests

2 participants