Programming/wasm2021. 10. 26. 11:07

나름 컴파일 된거니, 디컴파일이라고 해야하나 애매하긴 하네

 

$ wat2wasm simple.wat -o simple.wasm
$ wasm2wat simple.wasm -o text.wat

[링크 : https://developer.mozilla.org/ko/docs/WebAssembly/Text_format_to_wasm]

 

emcc 와는 다르게 패키지로 존재하나 보다

$ wat2wasm

명령어 'wat2wasm' 을(를) 찾을 수 없습니다. 그러나 다음을 통해 설치할 수 있습니다:

sudo apt install wabt

$ wasm2wat

명령어 'wasm2wat' 을(를) 찾을 수 없습니다. 그러나 다음을 통해 설치할 수 있습니다:

sudo apt install wabt

 

 

$ wat2wasm
usage: wat2wasm [options] filename

  read a file in the wasm text format, check it for errors, and
  convert it to the wasm binary format.

examples:
  # parse and typecheck test.wat
  $ wat2wasm test.wat

  # parse test.wat and write to binary file test.wasm
  $ wat2wasm test.wat -o test.wasm

  # parse spec-test.wast, and write verbose output to stdout (including
  # the meaning of every byte)
  $ wat2wasm spec-test.wast -v

options:
      --help                                  Print this help message
      --version                               Print version information
  -v, --verbose                               Use multiple times for more info
      --debug-parser                          Turn on debugging the parser of wat files
  -d, --dump-module                           Print a hexdump of the module to stdout
      --enable-exceptions                     Enable Experimental exception handling
      --disable-mutable-globals               Disable Import/export mutable globals
      --enable-saturating-float-to-int        Enable Saturating float-to-int operators
      --enable-sign-extension                 Enable Sign-extension operators
      --enable-simd                           Enable SIMD support
      --enable-threads                        Enable Threading support
      --enable-multi-value                    Enable Multi-value
      --enable-tail-call                      Enable Tail-call support
      --enable-bulk-memory                    Enable Bulk-memory operations
      --enable-reference-types                Enable Reference types (anyref)
      --enable-annotations                    Enable Custom annotation syntax
      --enable-all                            Enable all features
  -o, --output=FILE                           output wasm binary file
  -r, --relocatable                           Create a relocatable wasm binary (suitable for linking with e.g. lld)
      --no-canonicalize-leb128s               Write all LEB128 sizes as 5-bytes instead of their minimal size
      --debug-names                           Write debug names to the generated binary file
      --no-check                              Don't check for invalid modules
expected filename argument.

$ wasm2wat
usage: wasm2wat [options] filename

  Read a file in the WebAssembly binary format, and convert it to
  the WebAssembly text format.

examples:
  # parse binary file test.wasm and write text file test.wast
  $ wasm2wat test.wasm -o test.wat

  # parse test.wasm, write test.wat, but ignore the debug names, if any
  $ wasm2wat test.wasm --no-debug-names -o test.wat

options:
      --help                                  Print this help message
      --version                               Print version information
  -v, --verbose                               Use multiple times for more info
  -o, --output=FILENAME                       Output file for the generated wast file, by default use stdout
  -f, --fold-exprs                            Write folded expressions where possible
      --enable-exceptions                     Enable Experimental exception handling
      --disable-mutable-globals               Disable Import/export mutable globals
      --enable-saturating-float-to-int        Enable Saturating float-to-int operators
      --enable-sign-extension                 Enable Sign-extension operators
      --enable-simd                           Enable SIMD support
      --enable-threads                        Enable Threading support
      --enable-multi-value                    Enable Multi-value
      --enable-tail-call                      Enable Tail-call support
      --enable-bulk-memory                    Enable Bulk-memory operations
      --enable-reference-types                Enable Reference types (anyref)
      --enable-annotations                    Enable Custom annotation syntax
      --enable-all                            Enable all features
      --inline-exports                        Write all exports inline
      --inline-imports                        Write all imports inline
      --no-debug-names                        Ignore debug names in the binary file
      --ignore-custom-section-errors          Ignore errors in custom sections
      --generate-names                        Give auto-generated names to non-named functions, types, etc.
      --no-check                              Don't check for invalid modules
expected filename argument.

'Programming > wasm' 카테고리의 다른 글

wasm interfacing example  (0) 2021.11.25
wasm text format  (0) 2021.10.26
emcc wasm 빌드  (0) 2021.10.25
wasm from c, cpp  (0) 2021.10.24
wasm  (0) 2021.10.22
Posted by 구차니