WASM-SPLIT(1)
๐ 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--profileand--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--profileand--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 address0and 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'sSPLIT_MODULEmode 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โ 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). ๐--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 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โ 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 tostderr. notstdout, 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
- 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