[wasm2c] Add the very beginning of a wasm2c implementation and test harness - #8763
Conversation
These files are unmodified. Any necessary modifications will be included in follow-up commits.
|
Okay, I uploaded a new draft that incorporates all your feedback. PTAL. Thanks! |
|
@kripken, any final comments here? |
kripken
left a comment
There was a problem hiding this comment.
No concerns from me for landing.
(I didn't review the code in detail - let me know if you also want that.)
|
Looks like the test needs to be updated before this can land. |
…n't support that flag
It took me a while, but they're finally passing. :) |
| # files related to building in-tree | ||
| CMakeFiles | ||
| *.cmake | ||
| !src/tools/wasm2c/gen-wasm2c-templates.cmake |
There was a problem hiding this comment.
This this file was not actually added in this PR it seem to include this here.
BTW, the *.cmake line above seems odd.. does the in-tree build really make files with the .cmake extension?
There was a problem hiding this comment.
I removed this file, and the generation step, in favor of just checking in the "prebuilt" files. I forgot to remove this from .gitignore, though. :( I'll remove it in my next PR (or I can send a one-line PR to remove it, if you'd prefer?).
| add_compile_flag("-Wnon-virtual-dtor") | ||
| add_compile_flag("-Wsuggest-override") | ||
| add_compile_flag("-Wnon-virtual-dtor" "CXX_ONLY") | ||
| add_compile_flag("-Wsuggest-override" "CXX_ONLY") |
There was a problem hiding this comment.
I would hope these are not needed, and we don't try to use the same compile flags for building binaryen itself as the generated C source code. i.e. those two sets of flags should probably not be related.
There was a problem hiding this comment.
These flags aren't used for building the generated C source code, but they are used for building the wasm-rt C runtime library. I added this because I couldn't find any other way to get the clang-tidy pass to treat this as C code rather than C++ code (the file extension notwithstanding).
If you have a better idea, I'm happy to change this!
There was a problem hiding this comment.
Fair enough. i'm kind of tempted to say that the wasm-rt C runtime library should also be built with the same flags that the generated code (i.e. not these flags), but whatever works best I guess
|
This change seems to be breaking the emscripten-releases roller: |
|
It looks like emscripten-releases is injecting I wonder, could libwasm-rt always be a static library? That would avoid this issue? |
This change adds an extremely bare-bones wasm2c implementation and test harness.
Most of the code here is imported directly from WABT, particularly the boilerplate code and tests. The only substantive new code is in src/tools/wasm2c/* and scripts/test/wasm2c.py.
I tried to prune this down to be as minimal as possible while still providing a useful checkpoint, but I'm not sure I succeeded. Please feel free to offer suggestions if you see more ways to shrink this down.