-
I use cargo-wasi to build it:
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
So what happened is that _start is already defined by this mysterious crt1-command.o. I didn't learn until much after that this is from wasi-libc:
-
Uh... ok then. At this point I decide that I should probably use WASI to define this exit function, instead of just endlessly looping. So I link in proc_exit. According to the WASI docs, proc_exit takes in an exitcode (a u32) and returns nothing. Perfect!
-
At this point, I look into Bytecode Alliance's WASI rust bindings, used by Rust's std.
-
I use fd_write, and since I don't want to look into how interface types work, I just look at the wasi crate again, with some help from the wasmtime WASI WAT tutorial.
-
Ok. Now I need to add in a global allocator. I use wee_alloc since I know it works pretty well with WASM: Cargo.toml
-
Um. Ok, I remember this kind of thing. I do some searching and then rediscover compiler_builtins.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives