rv32emu icon indicating copy to clipboard operation
rv32emu copied to clipboard

Support hosting WebAssembly demo page locally

Open ChinYikMing opened this issue 10 months ago • 3 comments

To enhance the user experience of using WebAssembly version of rv32emu, we shall provide a Makefile target (serve-wasm) to serve the WebAssembly demo page in an easy way.

Since rv32emu leverages TCO (tail call optimization) when being compiled, so we have to tell if the user's browser supports TCO. Currently, only Chrome with MAJOR 112 and Firefox with MAJOR 121 supports TCO execution runtime, thus we focus on this two browsers. Also, use color text to remind the users if they need to update their Chrome or Firefox.

See also: #75

ChinYikMing avatar Apr 08 '24 10:04 ChinYikMing

Run make CC=emcc start-web to test it.

Note that you should install emcc then source your emcc firstly. In macOS or Linux, use source ~/emsdk/emsdk_env.sh.

ChinYikMing avatar Apr 08 '24 11:04 ChinYikMing

Move WebAssembly related rules to mk/wasm.mk.

Done.

ChinYikMing avatar Apr 08 '24 11:04 ChinYikMing

README will be updated on future PR.

ChinYikMing avatar Apr 08 '24 11:04 ChinYikMing

Update README.md to reflect the proposed changes.

Done.

ChinYikMing avatar Apr 09 '24 05:04 ChinYikMing

Thank @ChinYikMing for contributing!

jserv avatar Apr 09 '24 06:04 jserv