-
Notifications
You must be signed in to change notification settings - Fork 205
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 NativeLibrary example crash at runtime #268
Comments
The runtime is not initialized. It needs #113 but that one is still not complete and I didn't have time to work on this yet. We'll want to just do #113 (comment) if you would like to take this on. Otherwise please use Native AOT from the CoreRT repo for now. (It's a different NuGet feed and different version.) |
This was fixed by #270. The fix will be in the next daily build. Thank you for reporting this! |
What about static lib? How to initialize the runtime when it is static-linked into another native DLL? |
Can you try adding this switch to the linker command line (when you link the resulting DLL): On Windows:
On Linux:
On macOS:
|
@MichalStrehovsky no, it's only available to shared lib, according to https://github.com/jkotas/runtimelab/blob/bc12ad23fe050a8efa06506c071d2fa8d8fc9172/src/coreclr/nativeaot/Bootstrap/main.cpp#L209-L224 |
We probably don't include (lib)bootrapperdll(.a/.lib) in the static library so you might need to specify it at the linker command line as well. |
I have tried to use NativeAOT NativeLibrary example but got an exception at runtime on Windows and WSL:
Windows
Exeption:
Stack Trace:
Enviroment:
OS Windows 10.0.19041.0
VisualStudio 16.8.0 Preview 5.0
Microsoft.DotNet.ILCompiler 6.0.0-alpha.1.20525.1
WSL:
gdb message:
Enviroment:
OS Debian GNU/Linux 10
clang 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
Microsoft.DotNet.ILCompiler 6.0.0-alpha.1.20525.1
The text was updated successfully, but these errors were encountered: