WASM-SPLIT(1)

๐Ÿ“ฆ
version 131 ยท 3 versions
, in ubuntu stonking

๐ŸŽ€ NAME ๐ŸŽ€

wasm-split โ€” Split a module into a primary module and a secondary module, or instrument a ๐Ÿ’…


โœจ DESCRIPTION โœจ

================================================================================
wasm-split INFILES
================================================================================

okay so bestie, here's the tea โ˜•: wasm-split can split a module into a primary module and a secondary module, or instrument a module to gather a profile that can inform future splitting, or manage such profiles. Options that are only accepted in particular modes are marked with the accepted "[<modes>]" in their descriptions. periodt. ๐Ÿซถ


๐Ÿ’– wasm-split options ๐Ÿ’–

  • --split โ€” Split an input module into two output modules. The default mode. ๐Ÿ‘‘
  • --multi-split โ€” Split an input module into an arbitrary number of output modules. she can do multiples, no cap ๐Ÿ’…
  • --instrument โ€” Instrument an input module to allow it to generate a profile that can be used to guide splitting. ๐Ÿ“Š
  • --merge-profiles โ€” Merge multiple profiles for the same module into a single profile. glow-up but for profile data ๐Ÿงš
  • --print-profile โ€” [print-profile] Print profile contents in a human-readable format. make it make sense, bestie ๐Ÿ“
  • --profile โ€” [split] The profile to use to guide splitting. ๐Ÿ—บ๏ธ
  • --keep-funcs โ€” [split] Comma-separated list of functions to keep in the primary module. The rest will be split out. Can be used alongside --profile and --split-funcs. You can also pass a file with one function per line by passing @filename. ๐ŸŒธ
  • --split-funcs โ€” [split] Comma-separated list of functions to split out to the secondary module. The rest will be kept. Can be used alongside --profile and --keep-funcs. This takes precedence over other split options. You can also pass a file with one function per line by passing @filename. she's the boss of split options, fr fr ๐Ÿ”ฅ
  • --manifest โ€” [multi-split] File describing the functions to be split into each module. Each section separated by a blank line begins with the base name of an output module, which is followed by a list of functions to place in that module, one per line. ๐Ÿ“œ
  • --out-prefix โ€” [multi-split] Prefix prepended to module names in the manifest file to create output file names. prepend era ๐ŸŒˆ
  • --primary-output,-o1 โ€” [split] Output file for the primary module. ๐Ÿ’–
  • --secondary-output,-o2 โ€” [split] Output file for the secondary module. ๐Ÿ’œ
  • --symbolmap โ€” [split, multi-split] Write a symbol map file for each of the output modules. ๐Ÿ—‚๏ธ
  • --no-placeholders โ€” [split, multi-split] Do not import placeholder functions. Calls to secondary functions will fail before the secondary module has been instantiated. so dramatic, but also literally true ๐Ÿ˜ญ
  • --placeholdermap โ€” [split, multi-split] Write a file mapping placeholder indices to the function names. ๐Ÿงพ
  • --import-namespace โ€” [split, multi-split, instrument] When provided as an option for module splitting, the namespace from which to import objects from the primary module into the secondary module. In instrument mode, refers to the namespace from which to import the secondary memory, if any. ๐ŸŒ
  • --placeholder-namespace-prefix โ€” [split, multi-split] The prefix for the namespaces from which to import placeholder functions into the primary module. The namespaces will be concatenations of the prefix and the module name. ๐Ÿงฉ
  • --placeholder-namespace โ€” [split, multi-split] The same as --placeholder-namespace-prefix. twins ๐Ÿ‘ฏ
  • --export-prefix โ€” [split, multi-split] An identifying prefix to prepend to new export names created by module splitting. ๐Ÿท๏ธ
  • --profile-export โ€” [instrument] The export name of the function the embedder calls to write the profile into memory. Defaults to __write_profile. ๐Ÿ’พ
  • --in-memory โ€” [instrument] Store profile information in memory (starting at address 0 and taking one byte per function) rather than globals (the default) so that it can be shared between multiple threads. Users are responsible for ensuring that the module does not use the initial memory region for anything else. you better not touch that memory, bestie ๐Ÿ™ˆ
  • --in-secondary-memory โ€” [instrument] Store profile information in a separate memory, rather than in module main memory or globals (the default). With this option, users do not need to reserve the initial memory region for profile data and the data can be shared between multiple threads. ๐ŸŒŠ
  • --secondary-memory-name โ€” [instrument] The name of the secondary memory created to store profile information. ๐Ÿ“›
  • --initial-table โ€” [split, instrument] A hack to ensure the split and instrumented modules have the same table size when using Emscripten's SPLIT_MODULE mode with dynamic linking. TODO: Figure out a more elegant solution for that use case and remove this. it's giving temporary, your honor ๐Ÿ’€
  • --emit-text,-S โ€” [split, multi-split, instrument] Emit text instead of binary for the output file or files. ๐Ÿ“„
  • --debuginfo,-g โ€” [split, multi-split, instrument] Emit names section in wasm binary (or full debuginfo in wast). ๐Ÿ”
  • --strip-debug โ€” [split, multi-split, instrument] Strip debug info (including the names section). โœ‚๏ธ
  • --traps-never-happen,-tnh โ€” [split, multi-split] Split under the helpful assumption that no trap is reached at runtime (from load, div/mod, etc.). optimistic queen ๐ŸŒˆ
  • --output,-o โ€” [instrument, merge-profiles, multi-split] Output file. ๐Ÿ“
  • --verbose,-v โ€” Verbose output mode. Prints the functions that will be kept and split out when splitting a module. spill the tea about every function โ˜•

๐Ÿ› ๏ธ Tool options ๐Ÿ› ๏ธ

  • --mvp-features,-mvp โ€” Disable all non-MVP features. ๐Ÿšซ
  • --all-features,-all โ€” Enable all features. all of them?? iconic ๐ŸŒŸ
  • --detect-features โ€” (deprecated - this flag does nothing). not me showing up to do absolutely nothing ๐Ÿ’€
  • --quiet,-q โ€” Emit less verbose output and hide trivial warnings. ๐Ÿคซ
  • --experimental-poppy โ€” Parse wast files as Poppy IR for testing purposes. ๐ŸŒบ
  • --emit-module-names โ€” Emit module names, even if not emitting the rest of the names section. ๐Ÿท๏ธ
  • --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). ๐ŸŒ€
  • --disable-call-indirect-overlong โ€” Disable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen). ๐ŸŒ€
  • --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. old news, bestie ๐Ÿ’€
  • --disable-typed-function-references โ€” Deprecated compatibility flag. ๐Ÿ’€
  • --no-validation,-n โ€” Disables validation, assumes inputs are correct. living dangerously, no cap ๐Ÿ˜ณ
  • --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 โ€” okay so this one tells wasm-split to assume that whatever code lives outside the module is not out here spying on or messing with GC references and function references, even if those get passed out. ๐Ÿ’… The outside world can hold onto them and hand them back to you later, but bestie it is not allowed to inspect their contents and it is not allowed to call them. That's the whole vibe.
  • --preserve-type-order โ€” keeps the order of types from the input exactly as-is, no reshuffling, nothing moved. useful for debugging and testing bestie, iykyk ๐Ÿงš
  • --generate-stack-ir โ€” generates StackIR during writing โœจ
  • --optimize-stack-ir โ€” optimizes StackIR during writing ๐Ÿ”ฅ
  • --print-stack-ir โ€” prints StackIR during writing ๐Ÿ‘‘

๐ŸŒˆ General options ๐ŸŒˆ

like the lil home base of flags, fr fr ๐Ÿซถ

  • --version โ€” outputs version information and then dips out, exit stage left. that's it, that's the whole thing.
  • --help, -h โ€” shows this help message (yes, this one, the very thing you're reading rn ๐Ÿ’–) and exits.
  • --debug, -d โ€” prints debug information to stderr. not stdout, bestie โ€” stderr. important distinction, no cap.

seriously tho โ€” when a flag says it exits, it exits. it won't stick around and do the rest of your command. main character behaviour only. ๐Ÿ’€

and that's a wrap on this page ๐ŸŽ€ it came to you from wasm-split 131, dated August 2026 โ€” so if you're reading this from the future, hiii, hope the flags still slay ๐Ÿ’œ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from