I have now compiled yosys.wasm using clang.wasm! The built yosys.wasm is able to compile a blinky (hardware equivalent of Hello World) just as well as one compiled with native clang. I’m going to call this a success, I think!
For everyone who doesn’t want to build their own packages, this workflow run should have artifacts available in a matter of minutes now (caution: expands to multiple directories). It includes latest changes to the (sigh) compiler driver driver that let you compile a moderately complex project like Yosys nearly unmodified.
In my experience, there are two things to watch out for:
*.dfiles are probably broken because clang includes paths into the sysroot in them, and the sysroot is currently mounted under a path that make (running outside of the sandbox) won’t see. This is fixable but not fixed currently.- WASI doesn’t have
realpathso sometimes the build will break in a place where both an absolute path and a relative path are expected to point to the same file, often in a somewhat obscure way. The workaround is to use either absolute or relative paths uniformly.