Implement invokeNative asm code for MinGW (#1753)

And update the document of building iwasm for MinGW.
This commit is contained in:
Wenyong Huang
2022-11-28 17:48:06 +08:00
committed by GitHub
parent ec5ab8274d
commit 12bcc20710
5 changed files with 132 additions and 9 deletions

View File

@ -382,6 +382,8 @@ are valid for the MSYS2 build environment:
```Bash
pacman -R cmake
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-gcc
pacman -S make git
```
Then follow the build instructions for Windows above, and add the following
@ -389,16 +391,15 @@ arguments for cmake:
```Bash
cmake .. -G"Unix Makefiles" \
-DWAMR_BUILD_LIBC_UVWASI=0 \
-DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1 \
-DWAMR_DISABLE_HW_BOUND_CHECK=1
````
Note that WASI will be disabled until further work is done towards full MinGW support.
- uvwasi not building out of the box, though it reportedly supports MinGW.
- Failing compilation of assembler files, the C version of `invokeNative()` will
be used instead.
- Since memory access boundary check with hardware trap feature is disabled, when generating the AOT file with `wamrc`, the `--bounds-checks=1` flag should be added to generate the memory access boundary check instructions to ensure the sandbox security:
```bash
wamrc --bounds-checks=1 -o <aot_file> <wasm_file>
```
- Compiler complaining about missing `UnwindInfoAddress` field in `RUNTIME_FUNCTION`
struct (winnt.h).