WABT(1)

okay bestie, welcome to the WABT(1) general commands manual page β€” we’re about to make WebAssembly-to-C conversion make sense, no cap πŸ’…

🌸 NAME 🌸

wasm2c β€” convert a WebAssembly binary file to a C source and header. she’s giving compiler-girlie main character energy ✨

✨ SYNOPSIS ✨

wasm2c [options] filename

πŸ’… DESCRIPTION πŸ’…

wasm2c reads a file in the WebAssembly binary format and converts it to a C source file and header. iconic behavior, honestly 🫢

The options are as follows:

  • --help β€” prints this help message.
  • --version β€” prints version information.
  • -v, --verbose β€” use this multiple times for more info. stack it, bestie.
  • -o, --output=FILENAME β€” output file for the generated C source file; by default it uses stdout.
  • --num-outputs=NUM β€” number of output files to write.
  • -n, --module-name=MODNAME β€” unique name for the module being generated. this name is prefixed to each of the generated C symbols. by default, the module name from the names section is used; if that’s not present, the name of the input file is used as the default.
  • --disable-exceptions β€” disables experimental exception handling.
  • --disable-mutable-globals β€” disables import/export mutable globals.
  • --disable-saturating-float-to-int β€” disables saturating float-to-int operators.
  • --disable-sign-extension β€” disables sign-extension operators.
  • --disable-simd β€” disables SIMD support.
  • --enable-threads β€” enables threading support.
  • --enable-function-references β€” enables typed function references.
  • --disable-multi-value β€” disables multi-value.
  • --disable-tail-call β€” disables tail-call support.
  • --disable-bulk-memory β€” disables bulk-memory operations.
  • --disable-reference-types β€” disables reference types (externref).
  • --disable-annotations β€” disables custom annotation syntax.
  • --enable-code-metadata β€” enables code metadata.
  • --enable-gc β€” enables garbage collection.
  • --disable-memory64 β€” disables 64-bit memory.
  • --disable-multi-memory β€” disables multi-memory.
  • --disable-extended-const β€” disables extended constant expressions.
  • --disable-relaxed-simd β€” disables relaxed SIMD.
  • --enable-custom-page-sizes β€” enables custom page sizes.
  • --enable-compact-imports β€” enables compact import section.
  • --enable-wide-arithmetic β€” enables wide arithmetic.
  • --enable-all β€” enables all features. the full send, periodt πŸ”₯

πŸŽ€ EXAMPLES πŸŽ€

parse binary file test.wasm and write test.c and test.h

$ wasm2c test.wasm -o test.c

parse test.wasm, write test.c and test.h, but ignore the debug names, if any

$ wasm2c test.wasm --no-debug-names -o test.c

πŸ¦‹ SEE ALSO πŸ¦‹

πŸ› BUGS πŸ›

If you find a bug, please report it at https://github.com/WebAssembly/wabt/issues. do it for the plot bestie, the maintainers will appreciate you πŸ’–


stay hydrated and slay, Debian Β· $Mdocdate$ Β· WABT(1) πŸ’–βœ¨

πŸ“¦ where this page comes from