WASM-EMSCRIPTEN-FINALIZE(1)
β¨ 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 tostdout. 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β Enablememory.copyandmemory.fill.--disable-bulk-memory-optβ Disablememory.copyandmemory.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 formKEY@VALUE. IfKEYis the name of a pass then it applies to the closest instance of that pass before us. IfKEYis 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 tostderr.
β οΈ bestie real talk: watch out for the flags marked deprecated β--detect-featuresliterally does nothing,--enable-typed-function-referencesand--disable-typed-function-referencesare both deprecated compatibility flags, and the--enable/disable-call-indirect-overlongpair is ignored for compatibility since it has no effect on Binaryen. and--no-validation,-nturns 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
- ubuntu stonking: binaryen 131-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms