Support for multiple modules#338
Conversation
|
Should we include Latch spectests to cover this multi-module extension? |
|
I currently get this error when trying out the example: Also I used the TOPLLab fork of wat2wasm to get the binaries: Maybe I need to update this version? |
|
@tolauwae |
|
Yes I get the same output. |
|
@tolauwae I see you compiled every |
|
I should have realised that 😅 |
57c44c9 to
ecf0ef8
Compare
|
Rebased. There were a lot of conflicts so I will run additional tests. But looks ready to merge. |
tolauwae
left a comment
There was a problem hiding this comment.
Additional tests seem to find no more issues.
➜ main (feat/multiple-modules) ✗ wdcli multiple_module_m1.wasm --link multiple_module_m2.wasm multiple_module_m3.wasm
=== Multi-module test ===
Cross-module call: 5 + 20 = 25
Table callback to table in M3 at index 0
M3: callback executed
Global counter: 100
Global counter +2: 102
Shared memory read: 8888
This PR fixes #27 by adding support for multiple modules, including shared memory, tables, globals and cross-module function calls.
Currently no official Wasm nor unofficial tests have been included in the Latch spectest suite. To test the multiple module functionality, see the test examples in
/tutorials/wat/main/mtuliple_modules_mX.wast. These example tests include the demonstration of:You can provide multiple modules to the CLI by linking modules using the --link flag (e.g.
./wdcli mod1.wasm --link mod2.wasm mod3.wasm).