1WABT(1)                   BSD General Commands Manual                  WABT(1)
2

NAME

4     wasm2c — convert a WebAssembly binary file to a C source and header
5

SYNOPSIS

7     wasm2c [options] file
8

DESCRIPTION

10     wasm2c takes a WebAssembly module and produces an equivalent C source and
11     header.
12
13     The options are as follows:
14
15     --help  Print a help message
16
17     --version
18             Print version information
19
20     -v, --verbose
21             Use multiple times for more info
22
23     -o, --output=FILENAME
24             Output file for the generated C source file, by default use std‐
25             out
26
27     -n, --module-name=MODNAME
28             Unique name for the module being generated. This name is prefixed
29             to each of the generaed C symbols. By default, the module name
30             from the names section is used. If that is not present the name
31             of the input file is used as the default.
32
33     --enable-exceptions
34             Enable Experimental exception handling
35
36     --disable-mutable-globals
37             Disable Import/export mutable globals
38
39     --disable-saturating-float-to-int
40             Disable Saturating float-to-int operators
41
42     --disable-sign-extension
43             Disable Sign-extension operators
44
45     --disable-simd
46             Disable SIMD support
47
48     --enable-threads
49             Enable Threading support
50
51     --enable-function-references
52             Enable Typed function references
53
54     --disable-multi-value
55             Disable Multi-value
56
57     --enable-tail-call
58             Enable Tail-call support
59
60     --disable-bulk-memory
61             Disable Bulk-memory operations
62
63     --disable-reference-types
64             Disable Reference types (externref)
65
66     --enable-annotations
67             Enable Custom annotation syntax
68
69     --enable-code-metadata
70             Enable Code metadata
71
72     --enable-gc
73             Enable Garbage collection
74
75     --enable-memory64
76             Enable 64-bit memory
77
78     --enable-multi-memory
79             Enable Multi-memory
80
81     --enable-extended-const
82             Enable Extended constant expressions
83
84     --enable-all
85             Enable all features
86
87     --no-debug-names
88             Ignore debug names in the binary file
89

EXAMPLES

91     Parse binary file test.wasm and write test.c and test.h
92
93           $ wasm2c test.wasm -o test.c
94
95     Parse test.wasm, write test.c and test.h, but ignore the debug names, if
96     any
97
98           $ wasm2c test.wasm --no-debug-names -o test.c
99

SEE ALSO

101     wasm-decompile(1), wasm-interp(1), wasm-objdump(1), wasm-opcodecnt(1),
102     wasm-strip(1), wasm-validate(1), wasm2wat(1), wast2json(1),
103     wat-desugar(1), wat2wasm(1), spectest-interp(1)
104

BUGS

106     If you find a bug, please report it at
107     https://github.com/WebAssembly/wabt/issues
108
109BSD                            February 8, 2023                            BSD
Impressum