Skip to content
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

Why "Fast JIT currently not supported on Windows" #3979

Open
lxbxl opened this issue Dec 20, 2024 · 5 comments
Open

Why "Fast JIT currently not supported on Windows" #3979

lxbxl opened this issue Dec 20, 2024 · 5 comments

Comments

@lxbxl
Copy link

lxbxl commented Dec 20, 2024

I would like to understand the reasons why the Fast JIT feature is currently not supported on Windows.
If there's an opportunity, I would be willing to attempt implementing it myself.

@TianlongLiang
Copy link
Contributor

This is due to insufficient testing on this platform feature combo. I actually did make it compiled(at least on the MSVC toolchain) on the Windows platform, you can try it too by modifying the L62-L68 in runtime_lib.cmake and add:

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

on Windows iwasm CMakelists.txt.

But I am not sure it will work on other toolchains on Windows, and it needs more testing than simply compiling, that's why we disable it for now. It would be great if you could help with the testing, maybe starting by enabling certain spec tests for some running modes for CI on Windows.

@lxbxl
Copy link
Author

lxbxl commented Dec 23, 2024

Thank @TianlongLiang for your response.

I am currently conducting preliminary research on running a minimal feature set of WAMR in Windows kernel mode.

As you mentioned, supporting the Fast JIT mode In MSVC requires C++20. I have successfully completed the x64 compilation for Windows user mode; however, the compiled program fails to run successfully. Specifically, it crashes when executing asmjit modules.

By the way, Would you be more comfortable communicating in Chinese? my proficiency in English is limited.

@TianlongLiang
Copy link
Contributor

行啊,现在是报什么错啊?方便的话截图给我看一眼吗?

@lxbxl
Copy link
Author

lxbxl commented Dec 23, 2024

写了个 simple.c 用 wasi-sdk 编成 simple.wasm。 尝试在用户态的 iwasm.exe 内运行,结果崩了。

simple.c

#include <stdio.h>

int main(int argc, char** argv)
{
	printf("Hello World");
	return 0;
}

编译命令:D:/wasi-sdk-24.0-x86_64-windows/bin/clang.exe -O3 -o simple.wasm simple.c

运行命令:./iwasm.exe simple.wasm

fast-jit-sample

u.f(exec_env, info, func_idx, target) 处崩溃。

@lxbxl
Copy link
Author

lxbxl commented Dec 23, 2024

行啊,现在是报什么错啊?方便的话截图给我看一眼吗?

前两天 Fast Jit 还测了个宿主程序调用 simple.wasm 中导出函数的模型,初步定位可能是 jit_codegen_init 中的代码导致的崩溃。asmjit 不熟,就没跟下去,环境也没保存。

上面的 simple.c 多了入口函数,估计错误原因是一样的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants