[NativeAOT-LLVM] map runtimeimports to their native name for ldftn #1843
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR partially addresses a problem with ldftn for RuntimeImports, i.e. from
runtimelab/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/RuntimeExports.cs
Line 455 in 3dd23bf
Right now these are reported as undefined as they are not translated to the native names:
Emscripten will create imports for these in the wasm module, and stub them in JS. However a WASI host like wasmtime cannot satisfy these imports and just refuses to start. This PR at least lets the module run in a WASI host, although if these function pointers were ever called, they might be treated as managed calls, get a shadow stack arg, and fail. I propose to not solve that in the IL->LLVM compilation, but leave it until it's hit in the RyuJIT compilation.
There is still one undefined symbol preventing wasmtime starting,
dotnet_browser_entropy
, but that can be tackled in it's own PR.cc @SingleAccretion