WASM-EMSCRIPTEN-FINALIZE(1)

πŸ“¦
version 131 Β· 3 versions
, in ubuntu stonking

✨ wasm-emscripten-finalize πŸ’…

okay so bestie, you know how .wasm files come out of your toolchain looking a lil too raw for the browser? this is the glow-up tool. it's called wasm-emscripten-finalize and it's a User Commands girlie from the command line, and she does Emscripten-specific transforms on your .wasm files so they're actually ready for the JS world. 🫢


πŸŽ€ NAME πŸŽ€

wasm-emscripten-finalize β€” Performs Emscripten-specific transforms on .wasm files. that's it, that's the job, and she eats every time. πŸ‘‘


🌸 DESCRIPTION 🌸

fr fr, here's the whole vibe up top, exactly how she prints it:

================================================================================
wasm-emscripten-finalize INFILE

Performs Emscripten-specific transforms on .wasm files
================================================================================

so you hand her an INFILE and she does the Emscripten-flavored touch-ups. let's get into the flags, because there are... a lot. and we are listing every single one. no skips, no "etc.", periodt. πŸ’–


πŸ¦‹ wasm-emscripten-finalize options:

  • --output,-o β€” Output file. where the masterpiece goes. πŸŽ€
  • --debuginfo,-g β€” Emit names section in wasm binary (or full debuginfo in wast). yes queen, give us the names. ✨
  • --dwarf β€” Update DWARF debug info. the little debugging gremlins get fed. 🧚
  • --emit-text,-S β€” Emit text instead of binary for the output file. and listen: in this mode, if no output file is specified, we write to stdout. so she just yaps the text directly at you. no cap. πŸ’¬
  • --side-module β€” Input is an emscripten side module. side quest module, love that for her.
  • --input-source-map,-ism β€” Consume source map from the specified file. nom nom, source map. πŸ“
  • --no-legalize-javascript-ffi,-nj β€” Do not fully legalize (i64->i32, f32->f64) the imports and exports for interfacing with JS. basically: skip the i64->i32 and f32->f64 makeovers on the imports/exports that talk to JS.
  • --bigint,-bi β€” Assume JS will use wasm/JS BigInt integration, so wasm i64s will turn into JS BigInts, and there is no need for any legalization at all (not even minimal legalization of dynCalls). full BigInt main character energy β€” zero legalization, not even the tiny bit for dynCalls. πŸ”₯
  • --output-source-map,-osm β€” Emit source map to the specified file.
  • --output-source-map-url,-osu β€” Emit specified string as source map URL.
  • --check-stack-overflow β€” Check for stack overflows every time the stack is extended. she's watching the stack like a hawk bestie. πŸ‘€
  • --standalone-wasm β€” Emit a wasm file that does not depend on JS, as much as possible, using wasi and other standard conventions etc. where possible. independent woman πŸ’… (as much as possible).
  • --minimize-wasm-changes β€” Modify the wasm as little as possible. This is useful during development as we reduce the number of changes to the wasm, as it lets emscripten control how much modifications to do. lowkey the "hands off my wasm" flag, great for dev time.
  • --no-dyncalls β€” (no extra deets, she's just here, standing there, iconic.)
  • --dyncalls-i64 β€” (same deal, no description given, she simply exists. πŸ™ˆ)

🌈 Tool options:

  • --mvp-features,-mvp β€” Disable all non-MVP features. back to basics, we're being humble today.
  • --all-features,-all β€” Enable all features. orrr... give me EVERYTHING. 😀
  • --detect-features β€” (deprecated - this flag does nothing). genuinely nothing. she's a ghost. πŸ’€
  • --quiet,-q β€” Emit less verbose output and hide trivial warnings. shhh era. 🀫
  • --experimental-poppy β€” Parse wast files as Poppy IR for testing purposes. yes that's really the name and yes it's adorable. 🌸
  • --emit-module-names β€” Emit module names, even if not emitting the rest of the names section. just the names, not the whole section, we're being selective. ✨
  • --enable-sign-ext β€” Enable sign extension operations.
  • --disable-sign-ext β€” Disable sign extension operations.
  • --enable-threads β€” Enable atomic operations.
  • --disable-threads β€” Disable atomic operations.
  • --enable-mutable-globals β€” Enable mutable globals.
  • --disable-mutable-globals β€” Disable mutable globals.
  • --enable-nontrapping-float-to-int β€” Enable nontrapping float-to-int operations.
  • --disable-nontrapping-float-to-int β€” Disable nontrapping float-to-int operations.
  • --enable-simd β€” Enable SIMD operations and types.
  • --disable-simd β€” Disable SIMD operations and types.
  • --enable-bulk-memory β€” Enable bulk memory operations.
  • --disable-bulk-memory β€” Disable bulk memory operations.
  • --enable-bulk-memory-opt β€” Enable memory.copy and memory.fill.
  • --disable-bulk-memory-opt β€” Disable memory.copy and memory.fill.
  • --enable-call-indirect-overlong β€” Enable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen). so... it's ignored, bestie. for compatibility. no effect on Binaryen. πŸ’€
  • --disable-call-indirect-overlong β€” Disable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen). same energy, same nothing. πŸ™ˆ
  • --enable-exception-handling β€” Enable exception handling operations.
  • --disable-exception-handling β€” Disable exception handling operations.
  • --enable-tail-call β€” Enable tail call operations.
  • --disable-tail-call β€” Disable tail call operations.
  • --enable-reference-types β€” Enable reference types.
  • --disable-reference-types β€” Disable reference types.
  • --enable-multivalue β€” Enable multivalue functions.
  • --disable-multivalue β€” Disable multivalue functions.
  • --enable-gc β€” Enable garbage collection.
  • --disable-gc β€” Disable garbage collection.
  • --enable-memory64 β€” Enable memory64.
  • --disable-memory64 β€” Disable memory64.
  • --enable-relaxed-simd β€” Enable relaxed SIMD.
  • --disable-relaxed-simd β€” Disable relaxed SIMD.
  • --enable-extended-const β€” Enable extended const expressions.
  • --disable-extended-const β€” Disable extended const expressions.
  • --enable-strings β€” Enable strings.
  • --disable-strings β€” Disable strings.
  • --enable-multimemory β€” Enable multimemory.
  • --disable-multimemory β€” Disable multimemory.
  • --enable-stack-switching β€” Enable stack switching.
  • --disable-stack-switching β€” Disable stack switching.
  • --enable-shared-everything β€” Enable shared-everything threads.
  • --disable-shared-everything β€” Disable shared-everything threads.
  • --enable-fp16 β€” Enable float 16 operations.
  • --disable-fp16 β€” Disable float 16 operations.
  • --enable-custom-descriptors β€” Enable custom descriptors (RTTs) and exact references.
  • --disable-custom-descriptors β€” Disable custom descriptors (RTTs) and exact references.
  • --enable-multibyte β€” Enable multibyte array loads and stores.
  • --disable-multibyte β€” Disable multibyte array loads and stores.
  • --enable-relaxed-atomics β€” Enable acquire/release atomic memory operations.
  • --disable-relaxed-atomics β€” Disable acquire/release atomic memory operations.
  • --enable-custom-page-sizes β€” Enable custom page sizes.
  • --disable-custom-page-sizes β€” Disable custom page sizes.
  • --enable-wide-arithmetic β€” Enable wide arithmetic.
  • --disable-wide-arithmetic β€” Disable wide arithmetic.
  • --enable-compact-imports β€” Enable compact import section.
  • --disable-compact-imports β€” Disable compact import section.
  • --enable-typed-function-references β€” Deprecated compatibility flag.
  • --disable-typed-function-references β€” Deprecated compatibility flag.
  • --no-validation,-n β€” Disables validation, assumes inputs are correct. okay diva, we trust you completely, no questions asked. πŸ™
  • --pass-arg,-pa β€” An argument passed along to optimization passes being run. Must be in the form KEY@VALUE. If KEY is the name of a pass then it applies to the closest instance of that pass before us. If KEY is not the name of a pass then it is a global option that applies to all pass instances that read it.
  • --closed-world,-cw β€” Assume code outside of the module does not inspect or interact with GC and function references, even if they are passed out. The outside may hold on to them and pass them back in, but not inspect their contents or call them. so they can hold hands with your refs but not, like, look at them. 🫢
  • --preserve-type-order β€” Preserve the order of types from the input (useful for debugging and testing).
  • --generate-stack-ir β€” generate StackIR during writing.
  • --optimize-stack-ir β€” optimize StackIR during writing.
  • --print-stack-ir β€” print StackIR during writing.

πŸ’œ General options:

  • --version β€” Output version information and exit. she'll tell you who she is and dip. πŸ‘‹
  • --help,-h β€” Show this help message and exit.
  • --debug,-d β€” Print debug information to stderr.

⚠️ bestie real talk: watch out for the flags marked deprecated β€” --detect-features literally does nothing, --enable-typed-function-references and --disable-typed-function-references are both deprecated compatibility flags, and the --enable/disable-call-indirect-overlong pair is ignored for compatibility since it has no effect on Binaryen. and --no-validation,-n turns off validation and assumes your inputs are correct, so only send that one if you're 100% sure. πŸ’€

aaaand that's the whole page, we ate and left no crumbs. this was wasm-emscripten-finalize 131, from a very cute August 2026 β€” πŸ’– byeeeee, go finalize some wasm bestie βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from