Skip to content

NativeAOT-LLVM: Question: Should we drop WasmImport and use DllImport #2414

@yowl

Description

@yowl

We have been discussing the WasmImport msbuild property for Wasm Components and think it would be a good time to revisit this. WasmImport is used to generate the following LLVM:

attributes #2 = { "wasm-import-module"="hellowasi" "wasm-import-name"="reverse" }

which is an attribute added to a function that generates the following wasm (WAT)

(import "hellowasi" "reverse" (func $reverse (type 4)))

Previous and open issues/PRs for this:
#1390
#1845
#2410

I don't know that the original decision to not use DllImport was based on anything other than thinking this was not exactly the same as DllImport so rather than cause any problem, I just created something new.

However now is good time, with Wasm component work starting, and wanting to support Mono, to revisit this and in particular look at whether we should switch to DllImport Value for the module name and EntryPoint for the import name (function name)

cc @pavelsavara , @AaronRobinsonMSFT , @dotnet/nativeaot-llvm , @silesmo

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-LLVMLLVM generation for Native AOT compilation (including Web Assembly)questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions