// Settings that control the emscripten compiler. These are available to the1// python code and also as global variables when the JS compiler runs. They2// are set via the command line. For example:3//4// emcc -sOPTION1=VALUE1 -sOPTION2=ITEM1,ITEM2 [..other stuff..]5//6// For convenience and readability ``-sOPTION`` expands to ``-sOPTION=1``7// and ``-sNO_OPTION`` expands to ``-sOPTION=0`` (assuming OPTION is a valid8// option).9//10// See https://github.com/emscripten-core/emscripten/wiki/Code-Generation-Modes/11//12// Note that the values here are the defaults which can be affected either13// directly via ``-s`` flags or indirectly via other options (e.g. -O1,2,3)14//15// These flags should only have an effect when compiling to JS, so there16// should not be a need to have them when just compiling source to17// bitcode. However, there will also be no harm either, so it is ok to.18//19// Settings in this file can be directly set from the command line. Internal20// settings that are not part of the user ABI live in the settings_internal.js.21//22// In general it is best to pass the same arguments at both compile and link23// time, as whether wasm object files are used or not affects when codegen24// happens (without wasm object files, codegen is done entirely during25// link; otherwise, it is during compile). Flags affecting codegen must26// be passed when codegen happens, so to let a build easily switch when codegen27// happens (LTO vs normal), pass the flags at both times. The flags are also28// annotated in this file:29//30// [link] - Should be passed at link time. This is the case for all JS flags,31// as we emit JS at link (and that is most of the flags here, and32// hence the default).33// [compile+link] - A flag that has an effect at both compile and link time,34// basically any time emcc is invoked. The same flag should be35// passed at both times in most cases.36//37// If not otherwise specified, a flag is [link]. Note that no flag is only38// relevant during compile time, as during link we may do codegen for system39// libraries and other support code, so all flags are either link or40// compile+link.41//4243// Tuning4445// Whether we should add runtime assertions. This affects both JS and how46// system libraries are built.47// ASSERTIONS == 2 gives even more runtime checks, that may be very slow. That48// includes internal dlmalloc assertions, for example.49// ASSERTIONS defaults to 0 in optimized builds (-O1 and above).50// [link]51var ASSERTIONS = 1;5253// Chooses what kind of stack smash checks to emit to generated code:54// Building with ASSERTIONS=1 causes STACK_OVERFLOW_CHECK default to 1.55// Since ASSERTIONS=1 is the default at -O0, which itself is the default56// optimization level this means that this setting also effectively57// defaults 1, absent any other settings:58//59// - 0: Stack overflows are not checked.60// - 1: Adds a security cookie at the top of the stack, which is checked at end61// of each tick and at exit (practically zero performance overhead)62// - 2: Same as above, but also runs a binaryen pass which adds a check to all63// stack pointer assignments. Has a small performance cost.64//65// [link]66var STACK_OVERFLOW_CHECK = 0;6768// When STACK_OVERFLOW_CHECK is enabled we also check writes to address zero.69// This can help detect NULL pointer usage. If you want to skip this extra70// check (for example, if you want reads from the address zero to always return71// zero) you can disable this here. This setting has no effect when72// STACK_OVERFLOW_CHECK is disabled.73var CHECK_NULL_WRITES = true;7475// When set to 1, will generate more verbose output during compilation.76// [general]77var VERBOSE = false;7879// Whether we will run the main() function. Disable if you embed the generated80// code in your own, and will call main() yourself at the right time (which you81// can do with Module.callMain(), with an optional parameter of commandline args).82// [link]83var INVOKE_RUN = true;8485// If 0, the runtime is not quit when main() completes (allowing code to86// run afterwards, for example from the browser main event loop). atexit()s87// are also not executed, and we can avoid including code for runtime shutdown,88// like flushing the stdio streams.89// Set this to 1 if you do want atexit()s or stdio streams to be flushed90// on exit.91// This setting is controlled automatically in STANDALONE_WASM mode:92//93// - For a command (has a main function) this is always 194// - For a reactor (no a main function) this is always 095//96// [link]97var EXIT_RUNTIME = false;9899// The total stack size. There is no way to enlarge the stack, so this100// value must be large enough for the program's requirements. If101// assertions are on, we will assert on not exceeding this, otherwise,102// it will fail silently.103// [link]104var STACK_SIZE = 64*1024;105106// What malloc()/free() to use, out of:107//108// - dlmalloc - a powerful general-purpose malloc109// - emmalloc - a simple and compact malloc designed for emscripten110// - emmalloc-debug - use emmalloc and add extra assertion checks111// - emmalloc-memvalidate - use emmalloc with assertions+heap consistency112// checking.113// - emmalloc-verbose - use emmalloc with assertions + verbose logging.114// - emmalloc-memvalidate-verbose - use emmalloc with assertions + heap115// consistency checking + verbose logging.116// - mimalloc - a powerful mulithreaded allocator. This is recommended in117// large applications that have malloc() contention, but it is118// larger and uses more memory.119// - none - no malloc() implementation is provided, but you must implement120// malloc() and free() yourself.121//122// dlmalloc is necessary for split memory and other special modes, and will be123// used automatically in those cases.124// In general, if you don't need one of those special modes, and if you don't125// allocate very many small objects, you should use emmalloc since it's126// smaller. Otherwise, if you do allocate many small objects, dlmalloc127// is usually worth the extra size. dlmalloc is also a good choice if you want128// the extra security checks it does (such as noticing metadata corruption in129// its internal data structures, which emmalloc does not do).130// [link]131var MALLOC = "dlmalloc";132133// If 1, then when malloc would fail we abort(). This is nonstandard behavior,134// but makes sense for the web since we have a fixed amount of memory that135// must all be allocated up front, and so (a) failing mallocs are much more136// likely than on other platforms, and (b) people need a way to find out137// how big that initial allocation (INITIAL_MEMORY) must be.138// If you set this to 0, then you get the standard malloc behavior of139// returning NULL (0) when it fails.140//141// Setting ALLOW_MEMORY_GROWTH turns this off, as in that mode we default to142// the behavior of trying to grow and returning 0 from malloc on failure, like143// a standard system would. However, you can still set this flag to override144// that. This is a mostly-backwards-compatible change. Previously this option145// was ignored when growth was on. The current behavior is that growth turns it146// off by default, so for users that never specified the flag nothing changes.147// But if you do specify it, it will have an effect now, which it did not148// previously. If you don't want that, just stop passing it in at link time.149//150// Note that this setting does not affect the behavior of operator new in C++.151// This function will always abort on allocation failure if exceptions are disabled.152// If you want new to return 0 on failure, use it with std::nothrow.153//154// [link]155var ABORTING_MALLOC = true;156157// The initial amount of heap memory available to the program. This is the158// memory region available for dynamic allocations via `sbrk`, `malloc` and `new`.159//160// Unlike INITIAL_MEMORY, this setting allows the static and dynamic regions of161// your programs memory to independently grow. In most cases we recommend using162// this setting rather than `INITIAL_MEMORY`. However, this setting does not work163// for imported memories (e.g. when dynamic linking is used).164//165// [link]166var INITIAL_HEAP = 16777216;167168// The initial amount of memory to use. Using more memory than this will169// cause us to expand the heap, which can be costly with typed arrays:170// we need to copy the old heap into a new one in that case.171// If ALLOW_MEMORY_GROWTH is set, this initial amount of memory can increase172// later; if not, then it is the final and total amount of memory.173//174// By default, this value is calculated based on INITIAL_HEAP, STACK_SIZE,175// as well the size of static data in input modules.176//177// (This option was formerly called TOTAL_MEMORY.)178// [link]179var INITIAL_MEMORY = -1;180181// Set the maximum size of memory in the wasm module (in bytes). This is only182// relevant when ALLOW_MEMORY_GROWTH is set, as without growth, the size of183// INITIAL_MEMORY is the final size of memory anyhow.184//185// Note that the default value here is 2GB, which means that by default if you186// enable memory growth then we can grow up to 2GB but no higher. 2GB is a187// natural limit for several reasons:188//189// * If the maximum heap size is over 2GB, then pointers must be unsigned in190// JavaScript, which increases code size. We don't want memory growth builds191// to be larger unless someone explicitly opts in to >2GB+ heaps.192// * Historically no VM has supported more >2GB+, and only recently (Mar 2020)193// has support started to appear. As support is limited, it's safer for194// people to opt into >2GB+ heaps rather than get a build that may not195// work on all VMs.196//197// To use more than 2GB, set this to something higher, like 4GB.198//199// (This option was formerly called WASM_MEM_MAX and BINARYEN_MEM_MAX.)200// [link]201var MAXIMUM_MEMORY = 2147483648;202203// If false, we abort with an error if we try to allocate more memory than204// we can (INITIAL_MEMORY). If true, we will grow the memory arrays at205// runtime, seamlessly and dynamically.206// See https://code.google.com/p/v8/issues/detail?id=3907 regarding207// memory growth performance in chrome.208// Note that growing memory means we replace the JS typed array views, as209// once created they cannot be resized. (In wasm we can grow the Memory, but210// still need to create new views for JS.)211// Setting this option on will disable ABORTING_MALLOC, in other words,212// ALLOW_MEMORY_GROWTH enables fully standard behavior, of both malloc213// returning 0 when it fails, and also of being able to allocate more214// memory from the system as necessary.215// [link]216var ALLOW_MEMORY_GROWTH = false;217218// If ALLOW_MEMORY_GROWTH is true, this variable specifies the geometric219// overgrowth rate of the heap at resize. Specify MEMORY_GROWTH_GEOMETRIC_STEP=0220// to disable overgrowing the heap at all, or e.g.221// MEMORY_GROWTH_GEOMETRIC_STEP=1.0 to double the heap (+100%) at every grow step.222// The larger this value is, the more memory the WebAssembly heap overreserves223// to reduce performance hiccups coming from memory resize, and the smaller224// this value is, the more memory is conserved, at the performance of more225// stuttering when the heap grows. (profiled to be on the order of ~20 msecs)226// [link]227var MEMORY_GROWTH_GEOMETRIC_STEP = 0.20;228229// Specifies a cap for the maximum geometric overgrowth size, in bytes. Use230// this value to constrain the geometric grow to not exceed a specific rate.231// Pass MEMORY_GROWTH_GEOMETRIC_CAP=0 to disable the cap and allow unbounded232// size increases.233// [link]234var MEMORY_GROWTH_GEOMETRIC_CAP = 96*1024*1024;235236// If ALLOW_MEMORY_GROWTH is true and MEMORY_GROWTH_LINEAR_STEP == -1, then237// geometric memory overgrowth is utilized (above variable). Set238// MEMORY_GROWTH_LINEAR_STEP to a multiple of WASM page size (64KB), eg. 16MB to239// replace geometric overgrowth rate with a constant growth step size. When240// MEMORY_GROWTH_LINEAR_STEP is used, the variables MEMORY_GROWTH_GEOMETRIC_STEP241// and MEMORY_GROWTH_GEOMETRIC_CAP are ignored.242// [link]243var MEMORY_GROWTH_LINEAR_STEP = -1;244245// The "architecture" to compile for. 0 means the default wasm32, 1 is246// the full end-to-end wasm64 mode, and 2 is wasm64 for clang/lld but lowered to247// wasm32 in Binaryen (such that it can run on wasm32 engines, while internally248// using i64 pointers).249// Assumes WASM_BIGINT.250// [compile+link]251var MEMORY64 = 0;252253// Sets the initial size of the table when MAIN_MODULE or SIDE_MODULE is use254// (and not otherwise). Normally Emscripten can determine the size of the table255// at link time, but in SPLIT_MODULE mode, wasm-split often needs to grow the256// table, so the table size baked into the JS for the instrumented build will be257// too small after the module is split. This is a hack to allow users to specify258// a large enough table size that can be consistent across both builds. This259// setting may be removed at any time and should not be used except in260// conjunction with SPLIT_MODULE and dynamic linking.261// [link]262var INITIAL_TABLE = -1;263264// If true, allows more functions to be added to the table at runtime. This is265// necessary for dynamic linking, and set automatically in that mode.266// [link]267var ALLOW_TABLE_GROWTH = false;268269// Where global data begins; the start of static memory.270// A GLOBAL_BASE of 1024 or above is useful for optimizing load/store offsets, as it271// enables the --low-memory-unused pass272// [link]273var GLOBAL_BASE = 1024;274275// Where table slots (function addresses) are allocated.276// This must be at least 1 to reserve the zero slot for the null pointer.277// [link]278var TABLE_BASE = 1;279280// Whether closure compiling is being run on this output281// [link]282var USE_CLOSURE_COMPILER = false;283284// Deprecated: Use the standard warnings flags instead. e.g. ``-Wclosure``,285// ``-Wno-closure``, ``-Werror=closure``.286// options: 'quiet', 'warn', 'error'. If set to 'warn', Closure warnings are287// printed out to console. If set to 'error', Closure warnings are treated like288// errors, similar to -Werror compiler flag.289// [link]290// [deprecated]291var CLOSURE_WARNINGS = 'quiet';292293// Ignore closure warnings and errors (like on duplicate definitions)294// [link]295var IGNORE_CLOSURE_COMPILER_ERRORS = false;296297// If set to 1, each wasm module export is individually declared with a298// JavaScript "var" definition. This is the simple and recommended approach.299// However, this does increase code size (especially if you have many such300// exports), which can be avoided in an unsafe way by setting this to 0. In that301// case, no "var" is created for each export, and instead a loop (of small302// constant code size, no matter how many exports you have) writes all the303// exports received into the global scope. Doing so is dangerous since such304// modifications of the global scope can confuse external JS minifier tools, and305// also things can break if the scope the code is in is not the global scope306// (e.g. if you manually enclose them in a function scope).307// [link]308var DECLARE_ASM_MODULE_EXPORTS = true;309310// If set to 1, prevents inlining. If 0, we will inline normally in LLVM.311// This does not affect the inlining policy in Binaryen.312// [compile]313var INLINING_LIMIT = false;314315// If set to 1, perform acorn pass that converts each HEAP access into a316// function call that uses DataView to enforce LE byte order for HEAP buffer;317// This makes generated JavaScript run on BE as well as LE machines. (If 0, only318// LE systems are supported). Does not affect generated wasm.319// [experimental]320var SUPPORT_BIG_ENDIAN = false;321322// Check each write to the heap, for example, this will give a clear323// error on what would be segfaults in a native build (like dereferencing324// 0). See runtime_safe_heap.js for the actual checks performed.325// Set to value 1 to test for safe behavior for both Wasm+Wasm2JS builds.326// Set to value 2 to test for safe behavior for only Wasm builds. (notably,327// Wasm-only builds allow unaligned memory accesses. Note, however, that328// on some architectures unaligned accesses can be very slow, so it is still329// a good idea to verify your code with the more strict mode 1)330// [link]331var SAFE_HEAP = 0;332333// Log out all SAFE_HEAP operations334// [link]335var SAFE_HEAP_LOG = false;336337// Allows function pointers to be cast, wraps each call of an incorrect type338// with a runtime correction. This adds overhead and should not be used339// normally. Aside from making calls not fail, this tries to convert values as340// best it can. We use 64 bits (i64) to represent values, as if we wrote the341// sent value to memory and loaded the received type from the same memory (using342// truncs/extends/ reinterprets). This means that when types do not match the343// emulated values may not match (this is true of native too, for that matter -344// this is all undefined behavior). This approaches appears good enough to345// support Python (the original motiviation for this feature) and Glib (the346// continued motivation).347// [link]348var EMULATE_FUNCTION_POINTER_CASTS = false;349350// Print out exceptions in emscriptened code.351// [link]352var EXCEPTION_DEBUG = false;353354// Print out when we enter a library call (library*.js). You can also unset355// runtimeDebug at runtime for logging to cease, and can set it when you want356// it back. A simple way to set it in C++ is::357//358// emscripten_run_script("runtimeDebug = ...;");359//360// [link]361var LIBRARY_DEBUG = false;362363// Print out all musl syscalls, including translating their numeric index364// to the string name, which can be convenient for debugging. (Other system365// calls are not numbered and already have clear names; use LIBRARY_DEBUG366// to get logging for all of them.)367// [link]368var SYSCALL_DEBUG = false;369370// Log out socket/network data transfer.371// [link]372var SOCKET_DEBUG = false;373374// Log dynamic linker information375// [link]376var DYLINK_DEBUG = 0;377378// Register file system callbacks using trackingDelegate in library_fs.js379// [link]380var FS_DEBUG = false;381382// Select socket backend, either webrtc or websockets. XXX webrtc is not383// currently tested, may be broken384385// As well as being configurable at compile time via the "-s" option the386// WEBSOCKET_URL and WEBSOCKET_SUBPROTOCOL387// settings may configured at run time via the Module object e.g.388// Module['websocket'] = {subprotocol: 'base64, binary, text'};389// Module['websocket'] = {url: 'wss://', subprotocol: 'base64'};390// You can set 'subprotocol' to null, if you don't want to specify it391// Run time configuration may be useful as it lets an application select392// multiple different services.393// [link]394var SOCKET_WEBRTC = false;395396// A string containing either a WebSocket URL prefix (ws:// or wss://) or a complete397// RFC 6455 URL - "ws[s]:" "//" host [ ":" port ] path [ "?" query ].398// In the (default) case of only a prefix being specified the URL will be constructed from399// prefix + addr + ':' + port400// where addr and port are derived from the socket connect/bind/accept calls.401// [link]402var WEBSOCKET_URL = 'ws://';403404// If 1, the POSIX sockets API uses a native bridge process server to proxy sockets calls405// from browser to native world.406// [link]407var PROXY_POSIX_SOCKETS = false;408409// A string containing a comma separated list of WebSocket subprotocols410// as would be present in the Sec-WebSocket-Protocol header.411// You can set 'null', if you don't want to specify it.412// [link]413var WEBSOCKET_SUBPROTOCOL = 'binary';414415// Print out debugging information from our OpenAL implementation.416// [link]417var OPENAL_DEBUG = false;418419// If 1, prints out debugging related to calls from ``emscripten_web_socket_*``420// functions in ``emscripten/websocket.h``.421// If 2, additionally traces bytes communicated via the sockets.422// [link]423var WEBSOCKET_DEBUG = false;424425// Adds extra checks for error situations in the GL library. Can impact426// performance.427// [link]428var GL_ASSERTIONS = false;429430// If enabled, prints out all API calls to WebGL contexts. (*very* verbose)431// [link]432var TRACE_WEBGL_CALLS = false;433434// Enables more verbose debug printing of WebGL related operations. As with435// LIBRARY_DEBUG, this is toggleable at runtime with option GL.debug.436// [link]437var GL_DEBUG = false;438439// When enabled, sets preserveDrawingBuffer in the context, to allow tests to440// work (but adds overhead)441// [link]442var GL_TESTING = false;443444// How large GL emulation temp buffers are445// [link]446var GL_MAX_TEMP_BUFFER_SIZE = 2097152;447448// Enables some potentially-unsafe optimizations in GL emulation code449// [link]450var GL_UNSAFE_OPTS = true;451452// Forces support for all GLES2 features, not just the WebGL-friendly subset.453// [link]454var FULL_ES2 = false;455456// If true, glGetString() for GL_VERSION and GL_SHADING_LANGUAGE_VERSION will457// return strings OpenGL ES format "Open GL ES ... (WebGL ...)" rather than the458// WebGL format. If false, the direct WebGL format strings are returned. Set459// this to true to make GL contexts appear like an OpenGL ES context in these460// version strings (at the expense of a little bit of added code size), and to461// false to make GL contexts appear like WebGL contexts and to save some bytes462// from the output.463// [link]464var GL_EMULATE_GLES_VERSION_STRING_FORMAT = true;465466// If true, all GL extensions are advertised in both unprefixed WebGL extension467// format, but also in desktop/mobile GLES/GL extension format with ``GL_``468// prefix.469// [link]470var GL_EXTENSIONS_IN_PREFIXED_FORMAT = true;471472// If true, adds support for automatically enabling all GL extensions for473// GLES/GL emulation purposes. This takes up code size. If you set this to 0,474// you will need to manually enable the extensions you need.475// [link]476var GL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS = true;477478// If true, the function ``emscripten_webgl_enable_extension()`` can be called to479// enable any WebGL extension. If false, to save code size,480// ``emscripten_webgl_enable_extension()`` cannot be called to enable any of extensions481// 'ANGLE_instanced_arrays', 'OES_vertex_array_object', 'WEBGL_draw_buffers',482// 'WEBGL_multi_draw', 'WEBGL_draw_instanced_base_vertex_base_instance',483// or 'WEBGL_multi_draw_instanced_base_vertex_base_instance',484// but the dedicated functions ``emscripten_webgl_enable_*()``485// found in html5.h are used to enable each of those extensions.486// This way code size is increased only for the extensions that are actually used.487// N.B. if setting this to 0, GL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS must be set488// to zero as well.489// [link]490var GL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS = true;491492// If set to 0, Emscripten GLES2->WebGL translation layer does not track the kind493// of GL errors that exist in GLES2 but do not exist in WebGL. Settings this to 0494// saves code size. (Good to keep at 1 for development)495// [link]496var GL_TRACK_ERRORS = true;497498// If true, GL contexts support the explicitSwapControl context creation flag.499// Set to 0 to save a little bit of space on projects that do not need it.500// [link]501var GL_SUPPORT_EXPLICIT_SWAP_CONTROL = false;502503// If true, calls to glUniform*fv and glUniformMatrix*fv utilize a pool of504// preallocated temporary buffers for common small sizes to avoid generating505// temporary garbage for WebGL 1. Disable this to optimize generated size of the506// GL library a little bit, at the expense of generating garbage in WebGL 1. If507// you are only using WebGL 2 and do not support WebGL 1, this is not needed and508// you can turn it off.509// [link]510var GL_POOL_TEMP_BUFFERS = true;511512// If true, enables support for the EMSCRIPTEN_explicit_uniform_location WebGL513// extension. See docs/EMSCRIPTEN_explicit_uniform_location.txt514var GL_EXPLICIT_UNIFORM_LOCATION = false;515516// If true, enables support for the EMSCRIPTEN_uniform_layout_binding WebGL517// extension. See docs/EMSCRIPTEN_explicit_uniform_binding.txt518var GL_EXPLICIT_UNIFORM_BINDING = false;519520// Deprecated. Pass -sMAX_WEBGL_VERSION=2 to target WebGL 2.0.521// [link]522var USE_WEBGL2 = false;523524// Specifies the lowest WebGL version to target. Pass -sMIN_WEBGL_VERSION=1525// to enable targeting WebGL 1, and -sMIN_WEBGL_VERSION=2 to drop support526// for WebGL 1.0527// [link]528var MIN_WEBGL_VERSION = 1;529530// Specifies the highest WebGL version to target. Pass -sMAX_WEBGL_VERSION=2531// to enable targeting WebGL 2. If WebGL 2 is enabled, some APIs (EGL, GLUT, SDL)532// will default to creating a WebGL 2 context if no version is specified.533// Note that there is no automatic fallback to WebGL1 if WebGL2 is not supported534// by the user's device, even if you build with both WebGL1 and WebGL2535// support, as that may not always be what the application wants. If you want536// such a fallback, you can try to create a context with WebGL2, and if that537// fails try to create one with WebGL1.538// [link]539var MAX_WEBGL_VERSION = 1;540541// If true, emulates some WebGL 1 features on WebGL 2 contexts, meaning that542// applications that use WebGL 1/GLES 2 can initialize a WebGL 2/GLES3 context,543// but still keep using WebGL1/GLES 2 functionality that no longer is supported544// in WebGL2/GLES3. Currently this emulates GL_EXT_shader_texture_lod extension545// in GLSLES 1.00 shaders, support for unsized internal texture formats, and the546// GL_HALF_FLOAT_OES != GL_HALF_FLOAT mixup.547// [link]548var WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION = false;549550// Forces support for all GLES3 features, not just the WebGL2-friendly subset.551// This automatically turns on FULL_ES2 and WebGL2 support.552// [link]553var FULL_ES3 = false;554555// Includes code to emulate various desktop GL features. Incomplete but useful556// in some cases, see557// http://kripken.github.io/emscripten-site/docs/porting/multimedia_and_graphics/OpenGL-support.html558// [link]559var LEGACY_GL_EMULATION = false;560561// If you specified LEGACY_GL_EMULATION = 1 and only use fixed function pipeline562// in your code, you can also set this to 1 to signal the GL emulation layer563// that it can perform extra optimizations by knowing that the user code does564// not use shaders at all. If LEGACY_GL_EMULATION = 0, this setting has no565// effect.566// [link]567var GL_FFP_ONLY = false;568569// If you want to create the WebGL context up front in JS code, set this to 1570// and set Module['preinitializedWebGLContext'] to a precreated WebGL context.571// WebGL initialization afterwards will use this GL context to render.572// [link]573var GL_PREINITIALIZED_CONTEXT = false;574575// Enables the built-in implementation of ``<webgpu/webgpu.h>``.576// Deprecated: Please try migrating to ``--use-port=emdawnwebgpu``,577// which implements a newer, incompatible version of webgpu.h (see578// tools/ports/emdawnwebgpu.py for more info).579// [link]580// [deprecated]581var USE_WEBGPU = false;582583// Enables building of stb-image, a tiny public-domain library for decoding584// images, allowing decoding of images without using the browser's built-in585// decoders. The benefit is that this can be done synchronously, however, it586// will not be as fast as the browser itself. When enabled, stb-image will be587// used automatically from IMG_Load and IMG_Load_RW. You can also call the588// ``stbi_*`` functions directly yourself.589// [link]590var STB_IMAGE = false;591592// From Safari 8 (where WebGL was introduced to Safari) onwards, OES_texture_half_float and OES_texture_half_float_linear extensions593// are broken and do not function correctly, when used as source textures.594// See https://bugs.webkit.org/show_bug.cgi?id=183321, https://bugs.webkit.org/show_bug.cgi?id=169999,595// https://stackoverflow.com/questions/54248633/cannot-create-half-float-oes-texture-from-uint16array-on-ipad596// [link]597var GL_DISABLE_HALF_FLOAT_EXTENSION_IF_BROKEN = false;598599// Workaround Safari WebGL issue: After successfully acquiring WebGL context on a canvas,600// calling .getContext() will always return that context independent of which 'webgl' or 'webgl2'601// context version was passed. See https://bugs.webkit.org/show_bug.cgi?id=222758 and602// https://github.com/emscripten-core/emscripten/issues/13295.603// Set this to 0 to force-disable the workaround if you know the issue will not affect you.604// [link]605var GL_WORKAROUND_SAFARI_GETCONTEXT_BUG = true;606607// If 1, link with support to glGetProcAddress() functionality.608// In WebGL, glGetProcAddress() causes a substantial code size and performance impact, since WebGL609// does not natively provide such functionality, and it must be emulated. Using glGetProcAddress()610// is not recommended. If you still need to use this, e.g. when porting an existing renderer,611// you can link with -sGL_ENABLE_GET_PROC_ADDRESS=1 to get support for this functionality.612// [link]613var GL_ENABLE_GET_PROC_ADDRESS = true;614615// Use JavaScript math functions like Math.tan. This saves code size as we can avoid shipping616// compiled musl code. However, it can be significantly slower as it calls out to JS. It617// also may give different results as JS math is specced somewhat differently than libc, and618// can also vary between browsers.619// [link]620var JS_MATH = false;621622// If set, enables polyfilling for Math.clz32, Math.trunc, Math.imul, Math.fround.623// [link]624var POLYFILL_OLD_MATH_FUNCTIONS = false;625626// Set this to enable compatibility emulations for old JavaScript engines. This gives you627// the highest possible probability of the code working everywhere, even in rare old628// browsers and shell environments. Specifically:629//630// - Add polyfilling for Math.clz32, Math.trunc, Math.imul, Math.fround. (-sPOLYFILL_OLD_MATH_FUNCTIONS)631// - Disable WebAssembly. (Must be paired with -sWASM=0)632// - Adjusts MIN_X_VERSION settings to 0 to include support for all browser versions.633// - Avoid TypedArray.fill, if necessary, in zeroMemory utility function.634//635// You can also configure the above options individually.636// [link]637var LEGACY_VM_SUPPORT = false;638639// Specify which runtime environments the JS output will be capable of running640// in. For maximum portability this can configured to support all environments641// or it can be limited to reduce overall code size. The supported environments642// are:643//644// - 'web' - the normal web environment.645// - 'webview' - just like web, but in a webview like Cordova; considered to be646// same as "web" in almost every place647// - 'worker' - a web worker environment.648// - 'node' - Node.js.649// - 'shell' - a JS shell like d8, js, or jsc.650//651// This setting can be a comma-separated list of these environments, e.g.,652// "web,worker". If this is the empty string, then all environments are653// supported.654//655// Note that the set of environments recognized here is not identical to the656// ones we identify at runtime using ``ENVIRONMENT_IS_*``. Specifically:657//658// - We detect whether we are a pthread at runtime, but that's set for workers659// and not for the main file so it wouldn't make sense to specify here.660// - The webview target is basically a subset of web. It must be specified661// alongside web (e.g. "web,webview") and we only use it for code generation662// at compile time, there is no runtime behavior change.663//664// Note that by default we do not include the 'shell' environment since direct665// usage of d8, spidermonkey and jsc is extremely rare.666// [link]667var ENVIRONMENT = ['web', 'webview', 'worker', 'node'];668669// Enable this to support lz4-compressed file packages. They are stored compressed in memory, and670// decompressed on the fly, avoiding storing the entire decompressed data in memory at once.671// If you run the file packager separately, you still need to build the main program with this flag,672// and also pass --lz4 to the file packager.673// (You can also manually compress one on the client, using LZ4.loadPackage(), but that is less674// recommended.)675// Limitations:676//677// - LZ4-compressed files are only decompressed when needed, so they are not available678// for special preloading operations like pre-decoding of images using browser codecs,679// preloadPlugin stuff, etc.680// - LZ4 files are read-only.681//682// [link]683var LZ4 = false;684685// Emscripten (JavaScript-based) exception handling options.686// The three options below (DISABLE_EXCEPTION_CATCHING,687// EXCEPTION_CATCHING_ALLOWED, and DISABLE_EXCEPTION_THROWING) only pertain to688// JavaScript-based exception handling and do not control the native Wasm689// exception handling option (-fwasm-exceptions, internal setting:690// WASM_EXCEPTIONS).691692// Disables generating code to actually catch exceptions. This disabling is on693// by default as the overhead of exceptions is quite high in size and speed694// currently (in the future, wasm should improve that). When exceptions are695// disabled, if an exception actually happens then it will not be caught696// and the program will halt (so this will not introduce silent failures).697//698// .. note::699//700// This removes *catching* of exceptions, which is the main701// issue for speed, but you should build source files with702// -fno-exceptions to really get rid of all exceptions code overhead,703// as it may contain thrown exceptions that are never caught (e.g.704// just using std::vector can have that). -fno-rtti may help as well.705//706// This option is mutually exclusive with EXCEPTION_CATCHING_ALLOWED.707//708// This option only applies to Emscripten (JavaScript-based) exception handling709// and does not control the native Wasm exception handling.710//711// [compile+link] - affects user code at compile and system libraries at link712var DISABLE_EXCEPTION_CATCHING = 1;713714// Enables catching exception but only in the listed functions. This715// option acts like a more precise version of ``DISABLE_EXCEPTION_CATCHING=0``.716//717// This option is mutually exclusive with DISABLE_EXCEPTION_CATCHING.718//719// This option only applies to Emscripten (JavaScript-based) exception handling720// and does not control the native Wasm exception handling.721//722// [compile+link] - affects user code at compile and system libraries at link723var EXCEPTION_CATCHING_ALLOWED = [];724725// Internal: Tracks whether Emscripten should link in exception throwing (C++726// 'throw') support library. This does not need to be set directly, but pass727// -fno-exceptions to the build disable exceptions support. (This is basically728// -fno-exceptions, but checked at final link time instead of individual .cpp729// file compile time) If the program *does* contain throwing code (some source730// files were not compiled with ``-fno-exceptions``), and this flag is set at link731// time, then you will get errors on undefined symbols, as the exception732// throwing code is not linked in. If so you should either unset the option (if733// you do want exceptions) or fix the compilation of the source files so that734// indeed no exceptions are used).735// TODO(sbc): Move to settings_internal (current blocked due to use in test736// code).737//738// This option only applies to Emscripten (JavaScript-based) exception handling739// and does not control the native Wasm exception handling.740//741// [link]742var DISABLE_EXCEPTION_THROWING = false;743744// Make the exception message printing function, 'getExceptionMessage' available745// in the JS library for use, by adding necessary symbols to EXPORTED_FUNCTIONS.746//747// This works with both Emscripten EH and Wasm EH. When you catch an exception748// from JS, that gives you a user-thrown value in case of Emscripten EH, and a749// WebAssembly.Exception object in case of Wasm EH. 'getExceptionMessage' takes750// the user-thrown value in case of Emscripten EH and the WebAssembly.Exception751// object in case of Wasm EH, meaning in both cases you can pass a caught752// exception directly to the function.753//754// When used with Wasm EH, this option additionally provides these functions in755// the JS library:756//757// - getCppExceptionTag: Returns the C++ tag758// - getCppExceptionThrownObjectFromWebAssemblyException:759// Given an WebAssembly.Exception object, returns the actual user-thrown C++760// object address in Wasm memory.761//762// Setting this option also adds refcount increasing and decreasing functions763// ('incrementExceptionRefcount' and 'decrementExceptionRefcount') in the JS764// library because if you catch an exception from JS, you may need to manipulate765// the refcount manually not to leak memory. What you need to do is different766// depending on the kind of EH you use767// (https://github.com/emscripten-core/emscripten/issues/17115).768//769// See test_EXPORT_EXCEPTION_HANDLING_HELPERS in test/test_core.py for an770// example usage.771var EXPORT_EXCEPTION_HANDLING_HELPERS = false;772773// When this is enabled, exceptions will contain stack traces and uncaught774// exceptions will display stack traces upon exiting. This defaults to true when775// ASSERTIONS is enabled. This option is for users who want exceptions' stack776// traces but do not want other overheads ASSERTIONS can incur.777// This option implies EXPORT_EXCEPTION_HANDLING_HELPERS.778// [link]779var EXCEPTION_STACK_TRACES = false;780781// If true, emit instructions for the legacy Wasm exception handling proposal:782// https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/legacy/Exceptions.md783// If false, emit instructions for the standardized exception handling proposal:784// https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md785// [compile+link]786var WASM_LEGACY_EXCEPTIONS = true;787788// Emscripten throws an ExitStatus exception to unwind when exit() is called.789// Without this setting enabled this can show up as a top level unhandled790// exception.791//792// With this setting enabled a global uncaughtException handler is used to793// catch and handle ExitStatus exceptions. However, this means all other794// uncaught exceptions are also caught and re-thrown, which is not always795// desirable.796//797// [link]798var NODEJS_CATCH_EXIT = false;799800// Catch unhandled rejections in node. This only effect versions of node older801// than 15. Without this, old version node will print a warning, but exit802// with a zero return code. With this setting enabled, we handle any unhandled803// rejection and throw an exception, which will cause the process exit804// immediately with a non-0 return code.805// This not needed in Node 15+ so this setting will default to false if806// MIN_NODE_VERSION is 150000 or above.807// [link]808var NODEJS_CATCH_REJECTION = true;809810// Whether to support async operations in the compiled code. This makes it811// possible to call JS functions from synchronous-looking code in C/C++.812//813// - 1 (default): Run binaryen's Asyncify pass to transform the code using814// asyncify. This emits a normal wasm file in the end, so it works everywhere,815// but it has a significant cost in terms of code size and speed.816// See https://emscripten.org/docs/porting/asyncify.html817// - 2 (deprecated): Use ``-sJSPI`` instead.818//819// [link]820var ASYNCIFY = 0;821822// Imports which can do an async operation, in addition to the default ones that823// emscripten defines like emscripten_sleep. If you add more you will need to824// mention them to here, or else they will not work (in ASSERTIONS builds an825// error will be shown).826// Note that this list used to contain the default ones, which meant that you827// had to list them when adding your own; the default ones are now added828// automatically.829// [link]830var ASYNCIFY_IMPORTS = [];831832// Whether indirect calls can be on the stack during an unwind/rewind.833// If you know they cannot, then setting this can be extremely helpful, as otherwise asyncify834// must assume an indirect call can reach almost everywhere.835// [link]836var ASYNCIFY_IGNORE_INDIRECT = false;837838// The size of the asyncify stack - the region used to store unwind/rewind839// info. This must be large enough to store the call stack and locals. If it is too840// small, you will see a wasm trap due to executing an "unreachable" instruction.841// In that case, you should increase this size.842// [link]843var ASYNCIFY_STACK_SIZE = 4096;844845// If the Asyncify remove-list is provided, then the functions in it will not846// be instrumented even if it looks like they need to. This can be useful847// if you know things the whole-program analysis doesn't, like if you848// know certain indirect calls are safe and won't unwind. But if you849// get the list wrong things will break (and in a production build user850// input might reach code paths you missed during testing, so it's hard851// to know you got this right), so this is not recommended unless you852// really know what are doing, and need to optimize every bit of speed853// and size.854//855// The names in this list are names from the WebAssembly Names section. The856// wasm backend will emit those names in *human-readable* form instead of857// typical C++ mangling. For example, you should write Struct::func()858// instead of _ZN6Struct4FuncEv. C is also different from C++, as C859// names don't end with parameters; as a result foo(int) in C++ would appear860// as just foo in C (C++ has parameters because it needs to differentiate861// overloaded functions). You will see warnings in the console if a name in the862// list is missing (these are not errors because inlining etc. may cause863// changes which would mean a single list couldn't work for both -O0 and -O1864// builds, etc.). You can inspect the wasm binary to look for the actual names,865// either directly or using wasm-objdump or wasm-dis, etc.866//867// Simple ``*`` wildcard matching is supported.868//869// To avoid dealing with limitations in operating system shells or build system870// escaping, the following substitutions can be made:871//872// - ' ' -> ``.``,873// - ``&`` -> ``#``,874// - ``,`` -> ``?``.875//876// That is, the function `"foo(char const*, int&)"` can be inputted as877// `"foo(char.const*?.int#)"` on the command line instead.878//879// Note: Whitespace is part of the function signature! I.e.880// "foo(char const *, int &)" will not match "foo(char const*, int&)", and881// neither would "foo(const char*, int &)".882//883// [link]884var ASYNCIFY_REMOVE = [];885886// Functions in the Asyncify add-list are added to the list of instrumented887// functions, that is, they will be instrumented even if otherwise asyncify888// thinks they don't need to be. As by default everything will be instrumented889// in the safest way possible, this is only useful if you use IGNORE_INDIRECT890// and use this list to fix up some indirect calls that *do* need to be891// instrumented.892//893// See notes on ASYNCIFY_REMOVE about the names, including wildcard matching and894// character substitutions.895// [link]896var ASYNCIFY_ADD = [];897898// If enabled, instrumentation status will be propagated from the add-list, ie.899// their callers, and their callers' callers, and so on. If disabled then all900// callers must be manually added to the add-list (like the only-list).901// [link]902var ASYNCIFY_PROPAGATE_ADD = true;903904// If the Asyncify only-list is provided, then *only* the functions in the list905// will be instrumented. Like the remove-list, getting this wrong will break906// your application.907//908// See notes on ASYNCIFY_REMOVE about the names, including wildcard matching and909// character substitutions.910// [link]911var ASYNCIFY_ONLY = [];912913// If enabled will output which functions have been instrumented and why.914// [link]915var ASYNCIFY_ADVISE = false;916917// Allows lazy code loading: where emscripten_lazy_load_code() is written, we918// will pause execution, load the rest of the code, and then resume.919// [link]920// [deprecated]921var ASYNCIFY_LAZY_LOAD_CODE = false;922923// Runtime debug logging from asyncify internals.924//925// - 1: Minimal logging.926// - 2: Verbose logging.927//928// [link]929var ASYNCIFY_DEBUG = 0;930931// Deprecated, use JSPI_EXPORTS instead.932// [deprecated]933var ASYNCIFY_EXPORTS = [];934935// Use VM support for the JavaScript Promise Integration proposal. This allows936// async operations to happen without the overhead of modifying the wasm. This937// is experimental atm while spec discussion is ongoing, see938// https://github.com/WebAssembly/js-promise-integration/ TODO: document which939// of the following flags are still relevant in this mode (e.g. IGNORE_INDIRECT940// etc. are not needed)941//942// [link]943var JSPI = 0;944945// A list of exported module functions that will be asynchronous. Each export946// will return a ``Promise`` that will be resolved with the result. Any exports947// that will call an asynchronous import (listed in ``JSPI_IMPORTS``) must be948// included here.949//950// By default this includes ``main``.951// [link]952var JSPI_EXPORTS = [];953954955// A list of imported module functions that will potentially do asynchronous956// work. The imported function should return a ``Promise`` when doing957// asynchronous work.958//959// Note when using JS library files, the function can be marked with960// ``<function_name>_async:: true`` in the library instead of this setting.961// [link]962var JSPI_IMPORTS = [];963964// Runtime elements that are exported on Module by default. We used to export965// quite a lot here, but have removed them all. You should use966// EXPORTED_RUNTIME_METHODS for things you want to export from the runtime.967// Note that the name may be slightly misleading, as this is for any JS library968// element, and not just methods. For example, we can export the FS object by969// having "FS" in this list.970// [link]971var EXPORTED_RUNTIME_METHODS = [];972973// A list of incoming values on the Module object in JS that we care about. If974// a value is not in this list, then we don't emit code to check if you provide975// it on the Module object. For example, if976// you have this::977//978// var Module = {979// print: (x) => console.log('print: ' + x),980// preRun: [() => console.log('pre run')]981// };982//983// Then MODULE_JS_API must contain 'print' and 'preRun'; if it does not then984// we may not emit code to read and use that value. In other words, this985// option lets you set, statically at compile time, the list of which Module986// JS values you will be providing at runtime, so the compiler can better987// optimize.988//989// Setting this list to [], or at least a short and concise set of names you990// actually use, can be very useful for reducing code size. By default, the991// list contains a set of commonly used symbols.992//993// FIXME: should this just be 0 if we want everything?994// [link]995var INCOMING_MODULE_JS_API = [996'ENVIRONMENT', 'GL_MAX_TEXTURE_IMAGE_UNITS', 'SDL_canPlayWithWebAudio',997'SDL_numSimultaneouslyQueuedBuffers', 'INITIAL_MEMORY', 'wasmMemory', 'arguments',998'buffer', 'canvas', 'doNotCaptureKeyboard', 'dynamicLibraries',999'elementPointerLock', 'extraStackTrace', 'forcedAspectRatio',1000'instantiateWasm', 'keyboardListeningElement', 'freePreloadedMediaOnUse',1001'loadSplitModule', 'locateFile', 'logReadFiles', 'mainScriptUrlOrBlob', 'mem',1002'monitorRunDependencies', 'noExitRuntime', 'noInitialRun', 'onAbort',1003'onCustomMessage', 'onExit', 'onFree', 'onFullScreen', 'onMalloc',1004'onRealloc', 'onRuntimeInitialized', 'postMainLoop', 'postRun', 'preInit',1005'preMainLoop', 'preRun',1006'preinitializedWebGLContext', 'preloadPlugins',1007'print', 'printErr', 'setStatus', 'statusMessage', 'stderr',1008'stdin', 'stdout', 'thisProgram', 'wasm', 'wasmBinary', 'websocket'1009];10101011// If set to nonzero, the provided virtual filesystem if treated1012// case-insensitive, like Windows and macOS do. If set to 0, the VFS is1013// case-sensitive, like on Linux.1014// [link]1015var CASE_INSENSITIVE_FS = false;10161017// If set to 0, does not build in any filesystem support. Useful if you are just1018// doing pure computation, but not reading files or using any streams (including1019// fprintf, and other stdio.h things) or anything related. The one exception is1020// there is partial support for printf, and puts, hackishly. The compiler will1021// automatically set this if it detects that syscall usage (which is static)1022// does not require a full filesystem. If you still want filesystem support, use1023// FORCE_FILESYSTEM1024// [link]1025var FILESYSTEM = true;10261027// Makes full filesystem support be included, even if statically it looks like1028// it is not used. For example, if your C code uses no files, but you include1029// some JS that does, you might need this.1030// [link]1031var FORCE_FILESYSTEM = false;10321033// Enables support for the NODERAWFS filesystem backend. This is a special1034// backend as it replaces all normal filesystem access with direct Node.js1035// operations, without the need to do ``FS.mount()``, and this backend only1036// works with Node.js. The initial working directory will be same as1037// process.cwd() instead of VFS root directory. Because this mode directly uses1038// Node.js to access the real local filesystem on your OS, the code will not1039// necessarily be portable between OSes - it will be as portable as a Node.js1040// program would be, which means that differences in how the underlying OS1041// handles permissions and errors and so forth may be noticeable.1042// [link]1043var NODERAWFS = false;10441045// This saves the compiled wasm module in a file with name1046// ``$WASM_BINARY_NAME.$V8_VERSION.cached``1047// and loads it on subsequent runs. This caches the compiled wasm code from1048// v8 in node, which saves compiling on subsequent runs, making them start up1049// much faster.1050// The V8 version used in node is included in the cache name so that we don't1051// try to load cached code from another version, which fails silently (it seems1052// to load ok, but we do actually recompile).1053//1054// - The only version known to work for sure is node 12.9.1, as this has1055// regressed, see1056// https://github.com/nodejs/node/issues/18265#issuecomment-6229715471057// - The default location of the .cached files is alongside the wasm binary,1058// as mentioned earlier. If that is in a read-only directory, you may need1059// to place them elsewhere. You can use the locateFile() hook to do so.1060//1061// [link]1062var NODE_CODE_CACHING = false;10631064// Symbols that are explicitly exported. These symbols are kept alive through1065// LLVM dead code elimination, and also made accessible outside of the1066// generated code even after running closure compiler (on "Module"). Native1067// symbols listed here require an ``_`` prefix.1068//1069// By default if this setting is not specified on the command line the1070// ``_main`` function will be implicitly exported. In STANDALONE_WASM mode the1071// default export is ``__start`` (or ``__initialize`` if --no-entry is specified).1072//1073// JS Library symbols can also be added to this list (without the leading `$`).1074// [link]1075var EXPORTED_FUNCTIONS = [];10761077// If true, we export all the symbols that are present in JS onto the Module1078// object. This does not affect which symbols will be present - it does not1079// prevent DCE or cause anything to be included in linking. It only does1080// ``Module['X'] = X;``1081// for all X that end up in the JS file. This is useful to export the JS1082// library functions on Module, for things like dynamic linking.1083// [link]1084var EXPORT_ALL = false;10851086// If true, we export the symbols that are present in JS onto the Module1087// object.1088// It only does ``Module['X'] = X;``1089var EXPORT_KEEPALIVE = true;10901091// Remembers the values of these settings, and makes them accessible1092// through getCompilerSetting and emscripten_get_compiler_setting.1093// To see what is retained, look for compilerSettings in the generated code.1094// [link]1095var RETAIN_COMPILER_SETTINGS = false;10961097// JS library elements (C functions implemented in JS) that we include by1098// default. If you want to make sure something is included by the JS compiler,1099// add it here. For example, if you do not use some ``emscripten_*`` C API call1100// from C, but you want to call it from JS, add it here.1101// Note that the name may be slightly misleading, as this is for any JS1102// library element, and not just functions. For example, you can include the1103// Browser object by adding "$Browser" to this list.1104//1105// If you want to both include and export a JS library symbol, it is enough to1106// simply add it to EXPORTED_FUNCTIONS, without also adding it to1107// DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.1108// [link]1109var DEFAULT_LIBRARY_FUNCS_TO_INCLUDE = [];11101111// Include all JS library functions instead of the sum of1112// DEFAULT_LIBRARY_FUNCS_TO_INCLUDE + any functions used by the generated code.1113// This is needed when dynamically loading (i.e. dlopen) modules that make use1114// of runtime library functions that are not used in the main module. Note that1115// this only applies to js libraries, *not* C. You will need the main file to1116// include all needed C libraries. For example, if a module uses malloc or new,1117// you will need to use those in the main file too to pull in malloc for use by1118// the module.1119// [link]1120var INCLUDE_FULL_LIBRARY = false;11211122// If set to 1, we emit relocatable code from the LLVM backend; both1123// globals and function pointers are all offset (by gb and fp, respectively)1124// Automatically set for SIDE_MODULE or MAIN_MODULE.1125// [compile+link]1126var RELOCATABLE = false;11271128// A main module is a file compiled in a way that allows us to link it to1129// a side module at runtime.1130//1131// - 1: Normal main module.1132// - 2: DCE'd main module. We eliminate dead code normally. If a side1133// module needs something from main, it is up to you to make sure1134// it is kept alive.1135//1136// [compile+link]1137var MAIN_MODULE = 0;11381139// Corresponds to MAIN_MODULE (also supports modes 1 and 2)1140// [compile+link]1141var SIDE_MODULE = 0;11421143// Deprecated, list shared libraries directly on the command line instead.1144// [link]1145// [deprecated]1146var RUNTIME_LINKED_LIBS = [];11471148// If set to 1, this is a worker library, a special kind of library that is run1149// in a worker. See emscripten.h1150// [link]1151var BUILD_AS_WORKER = false;11521153// If set to 1, we build the project into a js file that will run in a worker,1154// and generate an html file that proxies input and output to/from it.1155// [link]1156var PROXY_TO_WORKER = false;11571158// If set, the script file name the main thread loads. Useful if your project1159// doesn't run the main emscripten- generated script immediately but does some1160// setup before1161// [link]1162var PROXY_TO_WORKER_FILENAME = '';11631164// If set to 1, compiles in a small stub main() in between the real main() which1165// calls pthread_create() to run the application main() in a pthread. This is1166// something that applications can do manually as well if they wish, this option1167// is provided as convenience.1168//1169// The pthread that main() runs on is a normal pthread in all ways, with the one1170// difference that its stack size is the same as the main thread would normally1171// have, that is, STACK_SIZE. This makes it easy to flip between1172// PROXY_TO_PTHREAD and non-PROXY_TO_PTHREAD modes with main() always getting1173// the same amount of stack.1174//1175// This proxies Module['canvas'], if present, and if OFFSCREENCANVAS_SUPPORT1176// is enabled. This has to happen because this is the only chance - this browser1177// main thread does the only pthread_create call that happens on1178// that thread, so it's the only chance to transfer the canvas from there.1179// [link]1180var PROXY_TO_PTHREAD = false;11811182// If set to 1, this file can be linked with others, either as a shared library1183// or as the main file that calls a shared library. To enable that, we will not1184// internalize all symbols and cull the unused ones, in other words, we will not1185// remove unused functions and globals, which might be used by another module we1186// are linked with.1187//1188// MAIN_MODULE and SIDE_MODULE both imply this, so it not normally necessary1189// to set this explicitly. Note that MAIN_MODULE and SIDE_MODULE mode 2 do1190// *not* set this, so that we still do normal DCE on them, and in that case1191// you must keep relevant things alive yourself using exporting.1192// [link]1193var LINKABLE = false;11941195// Emscripten 'strict' build mode: Drop supporting any deprecated build options.1196// Set the environment variable EMCC_STRICT=1 or pass -sSTRICT to test that a1197// codebase builds nicely in forward compatible manner.1198// Changes enabled by this:1199//1200// - The C define EMSCRIPTEN is not defined (__EMSCRIPTEN__ always is, and1201// is the correct thing to use).1202// - STRICT_JS is enabled.1203// - IGNORE_MISSING_MAIN is disabled.1204// - AUTO_JS_LIBRARIES is disabled.1205// - AUTO_NATIVE_LIBRARIES is disabled.1206// - DEFAULT_TO_CXX is disabled.1207// - USE_GLFW is set to 0 rather than 2 by default.1208// - ALLOW_UNIMPLEMENTED_SYSCALLS is disabled.1209// - INCOMING_MODULE_JS_API is set to empty by default.1210// [compile+link]1211var STRICT = false;12121213// Allow program to link with or without ``main`` symbol.1214// If this is disabled then one must provide a ``main`` symbol or explicitly1215// opt out by passing ``--no-entry`` or an EXPORTED_FUNCTIONS list that doesn't1216// include ``_main``.1217// [link]1218var IGNORE_MISSING_MAIN = true;12191220// Add ``"use strict;"`` to generated JS1221// [link]1222var STRICT_JS = false;12231224// If set to 1, we will warn on any undefined symbols that are not resolved by1225// the ``library_*.js`` files. Note that it is common in large projects to not1226// implement everything, when you know what is not going to actually be called1227// (and don't want to mess with the existing buildsystem), and functions might1228// be implemented later on, say in --pre-js, so you may want to build with -s1229// WARN_ON_UNDEFINED_SYMBOLS=0 to disable the warnings if they annoy you. See1230// also ERROR_ON_UNDEFINED_SYMBOLS. Any undefined symbols that are listed in-1231// EXPORTED_FUNCTIONS will also be reported.1232// [link]1233var WARN_ON_UNDEFINED_SYMBOLS = true;12341235// If set to 1, we will give a link-time error on any undefined symbols (see1236// WARN_ON_UNDEFINED_SYMBOLS). To allow undefined symbols at link time set this1237// to 0, in which case if an undefined function is called a runtime error will1238// occur. Any undefined symbols that are listed in EXPORTED_FUNCTIONS will also1239// be reported.1240// [link]1241var ERROR_ON_UNDEFINED_SYMBOLS = true;12421243// Use small chunk size for binary synchronous XHR's in Web Workers. Used for1244// testing. See test_chunked_synchronous_xhr in runner.py and library.js.1245// [link]1246var SMALL_XHR_CHUNKS = false;12471248// If 1, we force Date.now(), Math.random, etc. to return deterministic results.1249// This also tries to make execution deterministic across machines and1250// environments, for example, not doing anything different based on the1251// browser's language setting (which would mean you can get different results1252// in different browsers, or in the browser and in node).1253// Good for comparing builds for debugging purposes (and nothing else).1254// [link]1255var DETERMINISTIC = false;12561257// By default we emit all code in a straightforward way into the output1258// .js file. That means that if you load that in a script tag in a web1259// page, it will use the global scope. With ``MODULARIZE`` set, we instead emit1260// the code wrapped in an async function. This function returns a promise that1261// resolves to a module instance once it is safe to run the compiled code1262// (similar to the ``onRuntimeInitialized`` callback).1263//1264// The default name of the function is ``Module``, but can be changed using the1265// ``EXPORT_NAME`` option. We recommend renaming it to a more typical name for a1266// factory function, e.g. ``createModule``.1267//1268// You use the factory function like so::1269//1270// const module = await EXPORT_NAME();1271//1272// or::1273//1274// let module;1275// EXPORT_NAME().then(instance => {1276// module = instance;1277// });1278//1279//1280// The factory function accepts 1 parameter, an object with default values for1281// the module instance::1282//1283// const module = await EXPORT_NAME({ option: value, ... });1284//1285// Note the parentheses - we are calling EXPORT_NAME in order to instantiate1286// the module. This allows you to create multiple instances of the module.1287//1288// Note that in MODULARIZE mode we do *not* look for a global ``Module`` object1289// for default values. Default values must be passed as a parameter to the1290// factory function.1291//1292// The default .html shell file provided in MINIMAL_RUNTIME mode will create1293// a singleton instance automatically, to run the application on the page.1294// (Note that it does so without using the Promise API mentioned earlier, and1295// so code for the Promise is not even emitted in the .js file if you tell1296// emcc to emit an .html output.)1297// The default .html shell file provided by traditional runtime mode is only1298// compatible with MODULARIZE=0 mode, so when building with traditional1299// runtime, you should provided your own html shell file to perform the1300// instantiation when building with MODULARIZE=1. (For more details, see1301// https://github.com/emscripten-core/emscripten/issues/7950)1302//1303// If you add --pre-js or --post-js files, they will be included inside1304// the factory function with the rest of the emitted code in order to be1305// optimized together with it.1306//1307// If you want to include code outside all of the generated code, including the1308// factory function, you can use --extern-pre-js or --extern-post-js. While1309// --pre-js and --post-js happen to do that in non-MODULARIZE mode, their1310// intended usage is to add code that is optimized with the rest of the emitted1311// code, allowing better dead code elimination and minification.1312//1313// Experimental Feature - Instance ES Modules:1314//1315// Note this feature is still under active development and is subject to change!1316//1317// To enable this feature use -sMODULARIZE=instance. Enabling this mode will1318// produce an ES module that is a singleton with ES module exports. The1319// module will export a default value that is an async init function and will1320// also export named values that correspond to the Wasm exports and runtime1321// exports. The init function must be called before any of the exports can be1322// used. An example of using the module is below.1323//1324// import init, { foo, bar } from "./my_module.mjs"1325// await init(optionalArguments);1326// foo();1327// bar();1328//1329// [link]1330var MODULARIZE = false;13311332// Export using an ES6 Module export rather than a UMD export. MODULARIZE must1333// be enabled for ES6 exports and is implicitly enabled if not already set.1334//1335// This is implicitly enabled if the output suffix is set to 'mjs'.1336//1337// [link]1338var EXPORT_ES6 = false;13391340// Global variable to export the module as for environments without a1341// standardized module loading system (e.g. the browser and SM shell).1342// [link]1343var EXPORT_NAME = 'Module';13441345// When set to 0, we do not emit eval() and new Function(), which disables some1346// functionality (causing runtime errors if attempted to be used), but allows1347// the emitted code to be acceptable in places that disallow dynamic code1348// execution (chrome packaged app, privileged firefox app, etc.). Pass this flag1349// when developing an Emscripten application that is targeting a privileged or a1350// certified execution environment, see Firefox Content Security Policy (CSP)1351// webpage for details:1352// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src1353// in particular the 'unsafe-eval' and 'wasm-unsafe-eval' policies.1354//1355// When this flag is set, the following features (linker flags) are unavailable:1356//1357// - RELOCATABLE: the function loadDynamicLibrary would need to eval().1358//1359// and some features may fall back to slower code paths when they need to:1360// Embind: uses eval() to jit functions for speed.1361//1362// Additionally, the following Emscripten runtime functions are unavailable when1363// DYNAMIC_EXECUTION=0 is set, and an attempt to call them will throw an exception:1364//1365// - emscripten_run_script(),1366// - emscripten_run_script_int(),1367// - emscripten_run_script_string(),1368// - dlopen(),1369// - the functions ccall() and cwrap() are still available, but they are1370// restricted to only being able to call functions that have been exported in1371// the Module object in advance.1372//1373// When -sDYNAMIC_EXECUTION=2 is set, attempts to call to eval() are demoted to1374// warnings instead of throwing an exception.1375// [link]1376var DYNAMIC_EXECUTION = 1;13771378// whether we are in the generate struct_info bootstrap phase1379// [link]1380var BOOTSTRAPPING_STRUCT_INFO = false;13811382// Add some calls to emscripten tracing APIs1383// [compile+link]1384var EMSCRIPTEN_TRACING = false;13851386// Specify the GLFW version that is being linked against. Only relevant, if you1387// are linking against the GLFW library. Valid options are 2 for GLFW2 and 31388// for GLFW3.1389// [link]1390var USE_GLFW = 0;13911392// Whether to use compile code to WebAssembly. Set this to 0 to compile to JS1393// instead of wasm.1394//1395// Specify -sWASM=2 to target both WebAssembly and JavaScript at the same time.1396// In that build mode, two files a.wasm and a.wasm.js are produced, and at runtime1397// the WebAssembly file is loaded if browser/shell supports it. Otherwise the1398// .wasm.js fallback will be used.1399//1400// If WASM=2 is enabled and the browser fails to compile the WebAssembly module,1401// the page will be reloaded in Wasm2JS mode.1402// [link]1403var WASM = 1;14041405// STANDALONE_WASM indicates that we want to emit a wasm file that can run1406// without JavaScript. The file will use standard APIs such as wasi as much as1407// possible to achieve that.1408//1409// This option does not guarantee that the wasm can be used by itself - if you1410// use APIs with no non-JS alternative, we will still use those (e.g., OpenGL1411// at the time of writing this). This gives you the option to see which APIs1412// are missing, and if you are compiling for a custom wasi embedding, to add1413// those to your embedding.1414//1415// We may still emit JS with this flag, but the JS should only be a convenient1416// way to run the wasm on the Web or in Node.js, and you can run the wasm by1417// itself without that JS (again, unless you use APIs for which there is no1418// non-JS alternative) in a wasm runtime like wasmer or wasmtime.1419//1420// Note that even without this option we try to use wasi etc. syscalls as much1421// as possible. What this option changes is that we do so even when it means1422// a tradeoff with JS size. For example, when this option is set we do not1423// import the Memory - importing it is useful for JS, so that JS can start to1424// use it before the wasm is even loaded, but in wasi and other wasm-only1425// environments the expectation is to create the memory in the wasm itself.1426// Doing so prevents some possible JS optimizations, so we only do it behind1427// this flag.1428//1429// When this flag is set we do not legalize the JS interface, since the wasm is1430// meant to run in a wasm VM, which can handle i64s directly. If we legalized it1431// the wasm VM would not recognize the API. However, this means that the1432// optional JS emitted won't run if you use a JS API with an i64. You can use1433// the WASM_BIGINT option to avoid that problem by using BigInts for i64s which1434// means we don't need to legalize for JS (but this requires a new enough JS1435// VM).1436//1437// Standalone builds require a ``main`` entry point by default. If you want to1438// build a library (also known as a reactor) instead you can pass ``--no-entry``.1439// [link]1440var STANDALONE_WASM = false;14411442// Whether to ignore implicit traps when optimizing in binaryen. Implicit1443// traps are the traps that happen in a load that is out of bounds, or1444// div/rem of 0, etc. With this option set, the optimizer assumes that loads1445// cannot trap, and therefore that they have no side effects at all. This1446// is *not* safe in general, as you may have a load behind a condition which1447// ensures it it is safe; but if the load is assumed to not have side effects it1448// could be executed unconditionally. For that reason this option is generally1449// not useful on large and complex projects, but in a small and simple enough1450// codebase it may help reduce code size a little bit.1451// [link]1452var BINARYEN_IGNORE_IMPLICIT_TRAPS = false;14531454// A comma-separated list of extra passes to run in the binaryen optimizer,1455// Setting this does not override/replace the default passes. It is appended at1456// the end of the list of passes.1457// [link]1458var BINARYEN_EXTRA_PASSES = "";14591460// Whether to compile the wasm asynchronously, which is more efficient and does1461// not block the main thread. This is currently required for all but the1462// smallest modules to run in chrome.1463//1464// (This option was formerly called BINARYEN_ASYNC_COMPILATION)1465// [link]1466var WASM_ASYNC_COMPILATION = true;14671468// If set to 1, the dynCall() and dynCall_sig() API is made available1469// to caller.1470// [link]1471var DYNCALLS = false;14721473// WebAssembly integration with JavaScript BigInt. When enabled we don't need to1474// legalize i64s into pairs of i32s, as the wasm VM will use a BigInt where an1475// i64 is used.1476// [link]1477var WASM_BIGINT = true;14781479// WebAssembly defines a "producers section" which compilers and tools can1480// annotate themselves in, and LLVM emits this by default.1481// Emscripten will strip that out so that it is *not* emitted because it1482// increases code size, and also some users may not want information1483// about their tools to be included in their builds for privacy or security1484// reasons, see1485// https://github.com/WebAssembly/tool-conventions/issues/93.1486// [link]1487var EMIT_PRODUCERS_SECTION = false;14881489// Emits emscripten license info in the JS output.1490// [link]1491var EMIT_EMSCRIPTEN_LICENSE = false;14921493// Whether to legalize the JS FFI interfaces (imports/exports) by wrapping them1494// to automatically demote i64 to i32 and promote f32 to f64. This is necessary1495// in order to interface with JavaScript. For non-web/non-JS embeddings, setting1496// this to 0 may be desirable.1497// [link]1498// [deprecated]1499var LEGALIZE_JS_FFI = true;15001501// Ports15021503// Specify the SDL version that is being linked against.1504// 1, the default, is 1.3, which is implemented in JS1505// 2 is a port of the SDL C code on emscripten-ports1506// When AUTO_JS_LIBRARIES is set to 0 this defaults to 0 and SDL1507// is not linked in.1508// Alternate syntax for using the port: --use-port=sdl21509// [compile+link]1510var USE_SDL = 0;15111512// Specify the SDL_gfx version that is being linked against. Must match USE_SDL1513// [compile+link]1514var USE_SDL_GFX = 0;15151516// Specify the SDL_image version that is being linked against. Must match USE_SDL1517// [compile+link]1518var USE_SDL_IMAGE = 1;15191520// Specify the SDL_ttf version that is being linked against. Must match USE_SDL1521// [compile+link]1522var USE_SDL_TTF = 1;15231524// Specify the SDL_net version that is being linked against. Must match USE_SDL1525// [compile+link]1526var USE_SDL_NET = 1;15271528// 1 = use icu from emscripten-ports1529// Alternate syntax: --use-port=icu1530// [compile+link]1531var USE_ICU = false;15321533// 1 = use zlib from emscripten-ports1534// Alternate syntax: --use-port=zlib1535// [compile+link]1536var USE_ZLIB = false;15371538// 1 = use bzip2 from emscripten-ports1539// Alternate syntax: --use-port=bzip21540// [compile+link]1541var USE_BZIP2 = false;15421543// 1 = use giflib from emscripten-ports1544// Alternate syntax: --use-port=giflib1545// [compile+link]1546var USE_GIFLIB = false;15471548// 1 = use libjpeg from emscripten-ports1549// Alternate syntax: --use-port=libjpeg1550// [compile+link]1551var USE_LIBJPEG = false;15521553// 1 = use libpng from emscripten-ports1554// Alternate syntax: --use-port=libpng1555// [compile+link]1556var USE_LIBPNG = false;15571558// 1 = use Regal from emscripten-ports1559// Alternate syntax: --use-port=regal1560// [compile+link]1561var USE_REGAL = false;15621563// 1 = use Boost headers from emscripten-ports1564// Alternate syntax: --use-port=boost_headers1565// [compile+link]1566var USE_BOOST_HEADERS = false;15671568// 1 = use bullet from emscripten-ports1569// Alternate syntax: --use-port=bullet1570// [compile+link]1571var USE_BULLET = false;15721573// 1 = use vorbis from emscripten-ports1574// Alternate syntax: --use-port=vorbis1575// [compile+link]1576var USE_VORBIS = false;15771578// 1 = use ogg from emscripten-ports1579// Alternate syntax: --use-port=ogg1580// [compile+link]1581var USE_OGG = false;15821583// 1 = use mpg123 from emscripten-ports1584// Alternate syntax: --use-port=mpg1231585// [compile+link]1586var USE_MPG123 = false;15871588// 1 = use freetype from emscripten-ports1589// Alternate syntax: --use-port=freetype1590// [compile+link]1591var USE_FREETYPE = false;15921593// Specify the SDL_mixer version that is being linked against.1594// Doesn't *have* to match USE_SDL, but a good idea.1595// [compile+link]1596var USE_SDL_MIXER = 1;15971598// 1 = use harfbuzz from harfbuzz upstream1599// Alternate syntax: --use-port=harfbuzz1600// [compile+link]1601var USE_HARFBUZZ = false;16021603// 3 = use cocos2d v3 from emscripten-ports1604// Alternate syntax: --use-port=cocos2d1605// [compile+link]1606var USE_COCOS2D = 0;16071608// 1 = use libmodplug from emscripten-ports1609// Alternate syntax: --use-port=libmodplug1610// [compile+link]1611var USE_MODPLUG = false;16121613// Formats to support in SDL2_image. Valid values: bmp, gif, lbm, pcx, png, pnm,1614// tga, xcf, xpm, xv1615// [link]1616var SDL2_IMAGE_FORMATS = [];16171618// Formats to support in SDL2_mixer. Valid values: ogg, mp3, mod, mid1619// [link]1620var SDL2_MIXER_FORMATS = ["ogg"];16211622// 1 = use sqlite3 from emscripten-ports1623// Alternate syntax: --use-port=sqlite31624// [compile+link]1625var USE_SQLITE3 = false;16261627// If 1, target compiling a shared Wasm Memory.1628// [compile+link] - affects user code at compile and system libraries at link.1629var SHARED_MEMORY = false;16301631// Enables support for Wasm Workers. Wasm Workers enable applications1632// to create threads using a lightweight web-specific API that builds on top1633// of Wasm SharedArrayBuffer + Atomics API.1634// [compile+link] - affects user code at compile and system libraries at link.1635var WASM_WORKERS = 0;16361637// If true, enables targeting Wasm Web Audio AudioWorklets. Check out the1638// full documentation in site/source/docs/api_reference/wasm_audio_worklets.rst1639// [link]1640var AUDIO_WORKLET = 0;16411642// If true, enables deep debugging of Web Audio backend.1643// [link]1644var WEBAUDIO_DEBUG = 0;16451646// In web browsers, Workers cannot be created while the main browser thread1647// is executing JS/Wasm code, but the main thread must regularly yield back1648// to the browser event loop for Worker initialization to occur.1649// This means that pthread_create() is essentially an asynchronous operation1650// when called from the main browser thread, and the main thread must1651// repeatedly yield back to the JS event loop in order for the thread to1652// actually start.1653// If your application needs to be able to synchronously create new threads,1654// you can pre-create a pthread pool by specifying -sPTHREAD_POOL_SIZE=x,1655// in which case the specified number of Workers will be preloaded into a pool1656// before the application starts, and that many threads can then be available1657// for synchronous creation.1658// Note that this setting is a string, and will be emitted in the JS code1659// (directly, with no extra quotes) so that if you set it to '5' then 5 workers1660// will be used in the pool, and so forth. The benefit of this being a string1661// is that you can set it to something like1662// 'navigator.hardwareConcurrency' (which will use the number of cores the1663// browser reports, and is how you can get exactly enough workers for a1664// threadpool equal to the number of cores).1665// [link] - affects generated JS runtime code at link time1666var PTHREAD_POOL_SIZE = 0;16671668// Normally, applications can create new threads even when the pool is empty.1669// When application breaks out to the JS event loop before trying to block on1670// the thread via ``pthread_join`` or any other blocking primitive,1671// an extra Worker will be created and the thread callback will be executed.1672// However, breaking out to the event loop requires custom modifications to1673// the code to adapt it to the Web, and not something that works for1674// off-the-shelf apps. Those apps without any modifications are most likely1675// to deadlock. This setting ensures that, instead of a risking a deadlock,1676// they get a runtime EAGAIN error instead that can at least be gracefully1677// handled from the C / C++ side.1678// Values:1679//1680// - ``0`` - disable warnings on thread pool exhaustion1681// - ``1`` - enable warnings on thread pool exhaustion (default)1682// - ``2`` - make thread pool exhaustion a hard error1683//1684// [link]1685var PTHREAD_POOL_SIZE_STRICT = 1;16861687// If your application does not need the ability to synchronously create1688// threads, but it would still like to opportunistically speed up initial thread1689// startup time by prewarming a pool of Workers, you can specify the size of1690// the pool with -sPTHREAD_POOL_SIZE=x, but then also specify1691// -sPTHREAD_POOL_DELAY_LOAD, which will cause the runtime to not wait up at1692// startup for the Worker pool to finish loading. Instead, the runtime will1693// immediately start up and the Worker pool will asynchronously spin up in1694// parallel on the background. This can shorten the time that pthread_create()1695// calls take to actually start a thread, but without actually slowing down1696// main application startup speed. If PTHREAD_POOL_DELAY_LOAD=0 (default),1697// then the runtime will wait for the pool to start up before running main().1698// If you do need to synchronously wait on the created threads1699// (e.g. via pthread_join), you must wait on the Module.pthreadPoolReady1700// promise before doing so or you're very likely to run into deadlocks.1701// [link] - affects generated JS runtime code at link time1702var PTHREAD_POOL_DELAY_LOAD = false;17031704// Default stack size to use for newly created pthreads. When not set, this1705// defaults to STACK_SIZE (which in turn defaults to 64k). Can also be set at1706// runtime using pthread_attr_setstacksize(). Note that the wasm control flow1707// stack is separate from this stack. This stack only contains certain function1708// local variables, such as those that have their addresses taken, or ones that1709// are too large to fit as local vars in wasm code.1710// [link]1711var DEFAULT_PTHREAD_STACK_SIZE = 0;17121713// True when building with --threadprofiler1714// [link]1715var PTHREADS_PROFILING = false;17161717// It is dangerous to call pthread_join or pthread_cond_wait1718// on the main thread, as doing so can cause deadlocks on the Web (and also1719// it works using a busy-wait which is expensive). See1720// https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread1721// This may become set to 0 by default in the future; for now, this just1722// warns in the console.1723// [link]1724var ALLOW_BLOCKING_ON_MAIN_THREAD = true;17251726// If true, add in debug traces for diagnosing pthreads related issues.1727// [link]1728var PTHREADS_DEBUG = false;17291730// This tries to evaluate code at compile time. The main use case is to eval1731// global ctor functions, which are those that run before main(), but main()1732// itself or parts of it can also be evalled. Evaluating code this way can avoid1733// work at runtime, as it applies the results of the execution to memory and1734// globals and so forth, "snapshotting" the wasm and then just running it from1735// there when it is loaded.1736//1737// This will stop when it sees something it cannot eval at compile time, like a1738// call to an import. When running with this option you will see logging that1739// indicates what is evalled and where it stops.1740//1741// This optimization can either reduce or increase code size. If a small amount1742// of code generates many changes in memory, for example, then overall size may1743// increase.1744//1745// LLVM's GlobalOpt *almost* does this operation. It does in simple cases, where1746// LLVM IR is not too complex for its logic to evaluate, but it isn't powerful1747// enough for e.g. libc++ iostream ctors. It is just hard to do at the LLVM IR1748// level - LLVM IR is complex and getting more complex, so this would require1749// GlobalOpt to have a full interpreter, plus a way to write back into LLVM IR1750// global objects. At the wasm level, however, everything has been lowered1751// into a simple low level, and we also just need to write bytes into an array,1752// so this is easy for us to do. A further issue for LLVM is that it doesn't1753// know that we will not link in further code, so it only tries to optimize1754// ctors with lowest priority (while we do know explicitly if dynamic linking is1755// enabled or not).1756//1757// If set to a value of 2, this also makes some "unsafe" assumptions,1758// specifically that there is no input received while evalling ctors. That means1759// we ignore args to main() as well as assume no environment vars are readable.1760// This allows more programs to be optimized, but you need to make sure your1761// program does not depend on those features - even just checking the value of1762// argc can lead to problems.1763//1764// [link]1765var EVAL_CTORS = 0;17661767// The default value or 1 means the generated code will use TextDecoder if1768// available and fall back to custom decoder code when not available.1769// If set to 2, we assume TextDecoder is present and usable, and do not emit1770// any JS code to fall back if it is missing. Setting this zero to avoid even1771// conditional usage of TextDecoder is no longer supported.1772// Note: In -Oz builds, the default value of TEXTDECODER is set to 2, to save on1773// code size (except when AUDIO_WORKLET is specified, or when `shell` is part1774// of ENVIRONMENT since TextDecoder is not available in those environments).1775// [link]1776var TEXTDECODER = 1;17771778// Embind specific: If enabled, assume UTF-8 encoded data in std::string binding.1779// Disable this to support binary data transfer.1780// [link]1781var EMBIND_STD_STRING_IS_UTF8 = true;17821783// Embind specific: If enabled, generate Embind's JavaScript invoker functions1784// at compile time and include them in the JS output file. When used with1785// DYNAMIC_EXECUTION=0 this allows exported bindings to be just as fast as1786// DYNAMIC_EXECUTION=1 mode, but without the need for eval(). If there are many1787// bindings the JS output size may be larger though.1788var EMBIND_AOT = false;17891790// If set to 1, enables support for transferring canvases to pthreads and1791// creating WebGL contexts in them, as well as explicit swap control for GL1792// contexts. This needs browser support for the OffscreenCanvas specification.1793// [link]1794var OFFSCREENCANVAS_SUPPORT = false;17951796// If you are using PROXY_TO_PTHREAD with OFFSCREENCANVAS_SUPPORT, then specify1797// here a comma separated list of CSS ID selectors to canvases to proxy over1798// to the pthread at program startup, e.g. '#canvas1, #canvas2'.1799// [link]1800var OFFSCREENCANVASES_TO_PTHREAD = "#canvas";18011802// If set to 1, enables support for WebGL contexts to render to an offscreen1803// render target, to avoid the implicit swap behavior of WebGL where exiting any1804// event callback would automatically perform a "flip" to present rendered1805// content on screen. When an Emscripten GL context has Offscreen Framebuffer1806// enabled, a single frame can be composited from multiple event callbacks, and1807// the swap function emscripten_webgl_commit_frame() is then explicitly called1808// to present the rendered content on screen.1809//1810// The OffscreenCanvas feature also enables explicit GL frame swapping support,1811// and also, -sOFFSCREEN_FRAMEBUFFER feature can be used to polyfill support1812// for accessing WebGL in multiple threads in the absence of OffscreenCanvas1813// support in browser, at the cost of some performance and latency.1814// OffscreenCanvas and Offscreen Framebuffer support can be enabled at the same1815// time, and allows one to utilize OffscreenCanvas where available, and to fall1816// back to Offscreen Framebuffer otherwise.1817// [link]1818var OFFSCREEN_FRAMEBUFFER = false;18191820// If nonzero, Fetch API supports backing to IndexedDB. If 0, IndexedDB is not1821// utilized. Set to 0 if IndexedDB support is not interesting for target1822// application, to save a few kBytes.1823// [link]1824var FETCH_SUPPORT_INDEXEDDB = true;18251826// If nonzero, prints out debugging information in library_fetch.js1827// [link]1828var FETCH_DEBUG = false;18291830// If nonzero, enables emscripten_fetch API.1831// [link]1832var FETCH = false;18331834// ATTENTION [WIP]: Experimental feature. Please use at your own risk.1835// This will eventually replace the current JS file system implementation.1836// If set to 1, uses new filesystem implementation.1837// [link]1838// [experimental]1839var WASMFS = false;18401841// If set to 1, embeds all subresources in the emitted file as base64 string1842// literals. Embedded subresources may include (but aren't limited to) wasm,1843// asm.js, and static memory initialization code.1844//1845// When using code that depends on this option, your Content Security Policy may1846// need to be updated. Specifically, embedding asm.js requires the script-src1847// directive to allow 'unsafe-inline', and using a Worker requires the1848// child-src directive to allow blob:. If you aren't using Content Security1849// Policy, or your CSP header doesn't include either script-src or child-src,1850// then you can safely ignore this warning.1851// [link]1852var SINGLE_FILE = false;18531854// If set to 1, all JS libraries will be automatically available at link time.1855// This gets set to 0 in STRICT mode (or with MINIMAL_RUNTIME) which mean you1856// need to explicitly specify -lfoo.js in at link time in order to access1857// library function in library_foo.js.1858// [link]1859var AUTO_JS_LIBRARIES = true;18601861// Like AUTO_JS_LIBRARIES but for the native libraries such as libgl, libal1862// and libhtml5. If this is disabled it is necessary to explicitly add1863// e.g. -lhtml5 and also to first build the library using ``embuilder``.1864// [link]1865var AUTO_NATIVE_LIBRARIES = true;18661867// Specifies the oldest major version of Firefox to target. I.e. all Firefox1868// versions >= MIN_FIREFOX_VERSION1869// are desired to work. Pass -sMIN_FIREFOX_VERSION=majorVersion to drop support1870// for Firefox versions older than < majorVersion.1871// Firefox 79 was released on 2020-07-28.1872// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.1873// Minimum supported value is 55 which was released on 2017-08-08 (see1874// feature_matrix.py)1875// [link]1876var MIN_FIREFOX_VERSION = 79;18771878// Specifies the oldest version of desktop Safari to target. Version is encoded1879// in MMmmVV, e.g. 70101 denotes Safari 7.1.1.1880// Safari 14.1.0 was released on April 26, 2021, bundled with macOS 11.0 Big1881// Sur and iOS 14.5.1882// The previous default, Safari 12.0.0 was released on September 17, 2018,1883// bundled with macOS 10.14.0 Mojave.1884// NOTE: Emscripten is unable to produce code that would work in iOS 9.3.5 and1885// older, i.e. iPhone 4s, iPad 2, iPad 3, iPad Mini 1, Pod Touch 5 and older,1886// see https://github.com/emscripten-core/emscripten/pull/7191.1887// Multithreaded Emscripten code will need Safari 12.2 (iPhone 5s+) at minimum,1888// with support for DedicatedWorkerGlobalScope.name parameter.1889// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.1890// Minimum supported value is 120200 which was released on 2019-03-25 (see1891// feature_matrix.py).1892// [link]1893var MIN_SAFARI_VERSION = 150000;18941895// Specifies the oldest version of Chrome. E.g. pass -sMIN_CHROME_VERSION=58 to1896// drop support for Chrome 57 and older.1897// This setting also applies to modern Chromium-based Edge, which shares version1898// numbers with Chrome.1899// Chrome 85 was released on 2020-08-25.1900// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.1901// Minimum supported value is 70, which was released on 2018-10-16 (see1902// feature_matrix.py).1903// [link]1904var MIN_CHROME_VERSION = 85;19051906// Specifies minimum node version to target for the generated code. This is1907// distinct from the minimum version required run the emscripten compiler.1908// This version aligns with the current Ubuuntu TLS 20.04 (Focal).1909// Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01.1910// Minimum supported value is 101900, which was released 2020-02-05 (see1911// feature_matrix.py).1912var MIN_NODE_VERSION = 160000;19131914// If true, uses minimal sized runtime without POSIX features, Module,1915// preRun/preInit/etc., Emscripten built-in XHR loading or library_browser.js.1916// Enable this setting to target the smallest code size possible. Set1917// MINIMAL_RUNTIME=2 to further enable even more code size optimizations. These1918// opts are quite hacky, and work around limitations in Closure and other parts1919// of the build system, so they may not work in all generated programs (But can1920// be useful for really small programs).1921//1922// By default, no symbols will be exported on the ``Module`` object. In order1923// to export kept alive symbols, please use ``-sEXPORT_KEEPALIVE=1``.1924// [link]1925var MINIMAL_RUNTIME = 0;19261927// If set to 1, MINIMAL_RUNTIME will utilize streaming WebAssembly compilation,1928// where WebAssembly module is compiled already while it is being downloaded.1929// In order for this to work, the web server MUST properly serve the .wasm file1930// with a HTTP response header "Content-Type: application/wasm". If this HTTP1931// header is not present, e.g. Firefox 73 will fail with an error message1932// ``TypeError: Response has unsupported MIME type``1933// and Chrome 78 will fail with an error message1934// `Uncaught (in promise) TypeError: Failed to execute 'compile' on1935// 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'`.1936// If set to 0 (default), streaming WebAssembly compilation is disabled, which1937// means that the WebAssembly Module will first be downloaded fully, and only1938// then compilation starts.1939// For large .wasm modules and production environments, this should be set to 11940// for faster startup speeds. However this setting is disabled by default1941// since it requires server side configuration and for really small pages there1942// is no observable difference (also has a ~100 byte impact to code size)1943// This setting is only compatible with html output.1944// [link]1945var MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION = false;19461947// If set to 1, MINIMAL_RUNTIME will utilize streaming WebAssembly instantiation,1948// where WebAssembly module is compiled+instantiated already while it is being1949// downloaded. Same restrictions/requirements apply as with1950// MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION.1951// MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and1952// MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION cannot be simultaneously active.1953// Which one of these two is faster depends on the size of the wasm module,1954// the size of the JS runtime file, and the size of the preloaded data file1955// to download, and the browser in question.1956// [link]1957var MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION = false;19581959// If set to 'emscripten' or 'wasm', compiler supports setjmp() and longjmp().1960// If set to 0, these APIs are not available. If you are using C++ exceptions,1961// but do not need setjmp()+longjmp() API, then you can set this to 0 to save a1962// little bit of code size and performance when catching exceptions.1963//1964// 'emscripten': (default) Emscripten setjmp/longjmp handling using JavaScript1965// 'wasm': setjmp/longjmp handling using Wasm EH instructions (experimental)1966//1967// - 0: No setjmp/longjmp handling1968// - 1: Default setjmp/longjmp/handling, depending on the mode of exceptions.1969// 'wasm' if '-fwasm-exceptions' is used, 'emscripten' otherwise.1970//1971// [compile+link] - at compile time this enables the transformations needed for1972// longjmp support at codegen time, while at link it allows linking in the1973// library support.1974var SUPPORT_LONGJMP = true;19751976// If set to 1, disables old deprecated HTML5 API event target lookup behavior.1977// When enabled, there is no "Module.canvas" object, no magic "null" default1978// handling, and DOM element 'target' parameters are taken to refer to CSS1979// selectors, instead of referring to DOM IDs.1980// [link]1981var DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR = true;19821983// Certain browser DOM API operations, such as requesting fullscreen mode1984// transition or pointer lock require that the request originates from within1985// an user initiated event, such as mouse click or keyboard press. Refactoring1986// an application to follow this kind of program structure can be difficult, so1987// HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS allows transparent emulation1988// of this by deferring such requests until a suitable event callback is1989// generated. Set this to 0 to disable support for deferring to on save code1990// size if your application does not need support for deferred calls.1991// [link]1992var HTML5_SUPPORT_DEFERRING_USER_SENSITIVE_REQUESTS = true;19931994// Specifies whether the generated .html file is run through html-minifier. The1995// set of optimization passes run by html-minifier depends on debug and1996// optimization levels. In -g2 and higher, no minification is performed. In -g1,1997// minification is done, but whitespace is retained. Minification requires at1998// least -O1 or -Os to be used. Pass -sMINIFY_HTML=0 to explicitly choose to1999// disable HTML minification altogether.2000// [link]2001var MINIFY_HTML = true;20022003// This option is no longer used. The appropriate shadow memory size is now2004// calculated from INITIAL_MEMORY and MAXIMUM_MEMORY. Will be removed in a2005// future release.2006// [link]2007var ASAN_SHADOW_SIZE = -1;20082009// List of path substitutions to apply in the "sources" field of the source map.2010// Corresponds to the ``--prefix`` option used in ``tools/wasm-sourcemap.py``.2011// Must be used with ``-gsource-map``.2012//2013// This setting allows to map path prefixes to the proper ones so that the final2014// (possibly relative) URLs point to the correct locations :2015// ``-sSOURCE_MAP_PREFIXES=/old/path=/new/path``2016//2017// [link]2018var SOURCE_MAP_PREFIXES = [];20192020// Default to c++ mode even when run as ``emcc`` rather then ``emc++``.2021// When this is disabled ``em++`` is required linking C++ programs. Disabling2022// this will match the behaviour of gcc/g++ and clang/clang++.2023// [link]2024var DEFAULT_TO_CXX = true;20252026// While LLVM's wasm32 has long double = float128, we don't support printing2027// that at full precision by default. Instead we print as 64-bit doubles, which2028// saves libc code size. You can flip this option on to get a libc with full2029// long double printing precision.2030// [link]2031var PRINTF_LONG_DOUBLE = false;20322033// Setting this affects the path emitted in the wasm that refers to the DWARF2034// file, in -gseparate-dwarf mode. This allows the debugging file to be hosted2035// in a custom location.2036// [link]2037var SEPARATE_DWARF_URL = '';20382039// Emscripten runs wasm-ld to link, and in some cases will do further changes to2040// the wasm afterwards, like running wasm-opt to optimize the binary in2041// optimized builds. However, in some builds no wasm changes are necessary after2042// link. This can make the entire link step faster, and can also be important2043// for other reasons, like in debugging if the wasm is not modified then the2044// DWARF info from LLVM is preserved (wasm-opt can rewrite it in some cases, but2045// not in others like split-dwarf).2046// When this flag is turned on, we error at link time if the build requires any2047// changes to the wasm after link. This can be useful in testing, for example.2048// Some example of features that require post-link wasm changes are:2049// - Lowering i64 to i32 pairs at the JS boundary (See WASM_BIGINT)2050// - Lowering sign-extension operation when targeting older browsers.2051var ERROR_ON_WASM_CHANGES_AFTER_LINK = false;20522053// Abort on unhandled excptions that occur when calling exported WebAssembly2054// functions. This makes the program behave more like a native program where the2055// OS would terminate the process and no further code can be executed when an2056// unhandled exception (e.g. out-of-bounds memory access) happens.2057// This will instrument all exported functions to catch thrown exceptions and2058// call abort() when they happen. Once the program aborts any exported function2059// calls will fail with a "program has already aborted" exception to prevent2060// calls into code with a potentially corrupted program state.2061// This adds a small fixed amount to code size in optimized builds and a slight2062// overhead for the extra instrumented function indirection. Enable this if you2063// want Emscripten to handle unhandled exceptions nicely at the cost of a few2064// bytes extra.2065// Exceptions that occur within the ``main`` function are already handled via an2066// alternative mechanimsm.2067// [link]2068var ABORT_ON_WASM_EXCEPTIONS = false;20692070// Build binaries that use as many WASI APIs as possible, and include additional2071// JS support libraries for those APIs. This allows emscripten to produce binaries2072// are more WASI compliant and also allows it to process and execute WASI2073// binaries built with other SDKs (e.g. wasi-sdk).2074// This setting is experimental and subject to change or removal.2075// Implies STANDALONE_WASM.2076// [link]2077// [experimental]2078var PURE_WASI = false;20792080// Set to 1 to define the WebAssembly.Memory object outside of the wasm2081// module. By default the wasm module defines the memory and exports2082// it to JavaScript.2083// Use of the following settings will enable this settings since they2084// depend on being able to define the memory in JavaScript:2085// - -pthread2086// - RELOCATABLE2087// - ASYNCIFY_LAZY_LOAD_CODE2088// - WASM2JS (WASM=0)2089// [link]2090var IMPORTED_MEMORY = false;20912092// Generate code to loading split wasm modules.2093// This option will automatically generate two wasm files as output, one2094// with the ``.orig`` suffix and one without. The default file (without2095// the suffix) when run will generate instrumentation data can later be2096// fed into wasm-split (the binaryen tool).2097// As well as this the generated JS code will contains help functions2098// to loading split modules.2099// [link]2100var SPLIT_MODULE = false;21012102// For MAIN_MODULE builds, automatically load any dynamic library dependencies2103// on startup, before loading the main module.2104var AUTOLOAD_DYLIBS = true;21052106// Include unimplemented JS syscalls to be included in the final output. This2107// allows programs that depend on these syscalls at runtime to be compiled, even2108// though these syscalls will fail (or do nothing) at runtime.2109var ALLOW_UNIMPLEMENTED_SYSCALLS = true;21102111// Allow calls to Worker(...) and importScripts(...) to be Trusted Types compatible.2112// Trusted Types is a Web Platform feature designed to mitigate DOM XSS by restricting2113// the usage of DOM sink APIs. See https://w3c.github.io/webappsec-trusted-types/.2114// [link]2115var TRUSTED_TYPES = false;21162117// When targeting older browsers emscripten will sometimes require that2118// polyfills be included in the output. If you would prefer to take care of2119// polyfilling yourself via some other mechanism you can prevent emscripten2120// from generating these by passing ``-sNO_POLYFILL`` or ``-sPOLYFILL=0``2121// With default browser targets emscripten does not need any polyfills so this2122// settings is *only* needed when also explicitly targeting older browsers.2123var POLYFILL = true;21242125// If non-zero, add tracing to core runtime functions. Can be set to 2 for2126// extra tracing (for example, tracing that occurs on each turn of the event2127// loop or each user callback, which can flood the console).2128// This setting is enabled by default if any of the following debugging settings2129// are enabled:2130// - PTHREADS_DEBUG2131// - DYLINK_DEBUG2132// - LIBRARY_DEBUG2133// - GL_DEBUG2134// - OPENAL_DEBUG2135// - EXCEPTION_DEBUG2136// - SYSCALL_DEBUG2137// - WEBSOCKET_DEBUG2138// - SOCKET_DEBUG2139// - FETCH_DEBUG2140// [link]2141var RUNTIME_DEBUG = 0;21422143// Include JS library symbols that were previously part of the default runtime.2144// Without this, such symbols can be made available by adding them to2145// DEFAULT_LIBRARY_FUNCS_TO_INCLUDE, or via the dependencies of another JS2146// library symbol.2147var LEGACY_RUNTIME = false;21482149// User-defined functions to wrap with signature conversion, which take or return2150// pointer argument. Only affects MEMORY64=1 builds, see create_pointer_conversion_wrappers2151// in emscripten.py for details.2152// Use _ for non-pointer arguments, p for pointer/i53 arguments, and P for optional pointer/i53 values.2153// Example use -sSIGNATURE_CONVERSIONS=someFunction:_p,anotherFunction:p2154// [link]2155var SIGNATURE_CONVERSIONS = [];21562157// Experimental support for wasm source phase imports.2158// This is only currently implemented in the pre-release/nightly version of node,2159// and not yet supported by browsers.2160// Requires EXPORT_ES62161// [link]2162var SOURCE_PHASE_IMPORTS = false;21632164// Experimental support for wasm ESM integration.2165// Requires EXPORT_ES6 and MODULARIZE=instance2166// [link]2167var WASM_ESM_INTEGRATION = false;21682169// Enable use of the JS arraybuffer-base64 API:2170// https://github.com/tc39/proposal-arraybuffer-base642171// To run the resulting code currently requires passing `--js_base_64` to node2172// or chrome.2173// [experimental]2174// [link]2175var JS_BASE64_API = false;21762177// Enable support for GrowableSharedArrayBuffer.2178// This features is only available behind a flag in recent versions of2179// node/chrome.2180// [experimental]2181// [link]2182var GROWABLE_ARRAYBUFFERS = false;21832184// Experimental support for WebAssembly js-types proposal.2185// It's currently only available under a flag in certain browsers,2186// so we disable it by default to save on code size.2187var WASM_JS_TYPES = false;21882189// For renamed settings the format is:2190// [OLD_NAME, NEW_NAME]2191// For removed settings (which now effectively have a fixed value and can no2192// longer be changed) the format is:2193// [OPTION_NAME, POSSIBLE_VALUES, ERROR_EXPLANATION], where POSSIBLE_VALUES is2194// an array of values that will still be silently accepted by the compiler.2195// First element in the list is the canonical/fixed value going forward.2196// This allows existing build systems to keep specifying one of the supported2197// settings, for backwards compatibility.2198// When a setting has been removed, and we want to error on all values of it,2199// we can set POSSIBLE_VALUES to an impossible value (like "disallowed" for a2200// numeric setting, or -1 for a string setting).2201var LEGACY_SETTINGS = [2202['BINARYEN', 'WASM'],2203['TOTAL_STACK', 'STACK_SIZE'],2204['BINARYEN_ASYNC_COMPILATION', 'WASM_ASYNC_COMPILATION'],2205['UNALIGNED_MEMORY', [0], 'forced unaligned memory not supported in fastcomp'],2206['FORCE_ALIGNED_MEMORY', [0], 'forced aligned memory is not supported in fastcomp'],2207['PGO', [0], 'pgo no longer supported'],2208['QUANTUM_SIZE', [4], 'altering the QUANTUM_SIZE is not supported'],2209['FUNCTION_POINTER_ALIGNMENT', [2], 'Starting from Emscripten 1.37.29, no longer available (https://github.com/emscripten-core/emscripten/pull/6091)'],2210// Reserving function pointers is not needed - allowing table growth allows any number of new functions to be added.2211['RESERVED_FUNCTION_POINTERS', 'ALLOW_TABLE_GROWTH'],2212['BUILD_AS_SHARED_LIB', [0], 'Starting from Emscripten 1.38.16, no longer available (https://github.com/emscripten-core/emscripten/pull/7433)'],2213['SAFE_SPLIT_MEMORY', [0], 'Starting from Emscripten 1.38.19, SAFE_SPLIT_MEMORY codegen is no longer available (https://github.com/emscripten-core/emscripten/pull/7465)'],2214['SPLIT_MEMORY', [0], 'Starting from Emscripten 1.38.19, SPLIT_MEMORY codegen is no longer available (https://github.com/emscripten-core/emscripten/pull/7465)'],2215['BINARYEN_METHOD', ['native-wasm'], 'Starting from Emscripten 1.38.23, Emscripten now always builds either to Wasm (-sWASM - default), or to JavaScript (-sWASM=0), other methods are not supported (https://github.com/emscripten-core/emscripten/pull/7836)'],2216['BINARYEN_TRAP_MODE', [-1], 'The wasm backend does not support a trap mode (it always clamps, in effect)'],2217['PRECISE_I64_MATH', [1, 2], 'Starting from Emscripten 1.38.26, PRECISE_I64_MATH is always enabled (https://github.com/emscripten-core/emscripten/pull/7935)'],2218['MEMFS_APPEND_TO_TYPED_ARRAYS', [1], 'Starting from Emscripten 1.38.26, MEMFS_APPEND_TO_TYPED_ARRAYS=0 is no longer supported. MEMFS no longer supports using JS arrays for file data (https://github.com/emscripten-core/emscripten/pull/7918)'],2219['ERROR_ON_MISSING_LIBRARIES', [1], 'missing libraries are always an error now'],2220['EMITTING_JS', [1], 'The new STANDALONE_WASM flag replaces this (replace EMITTING_JS=0 with STANDALONE_WASM=1)'],2221['SKIP_STACK_IN_SMALL', [0, 1], 'SKIP_STACK_IN_SMALL is no longer needed as the backend can optimize it directly'],2222['SAFE_STACK', [0], 'Replace SAFE_STACK=1 with STACK_OVERFLOW_CHECK=2'],2223['MEMORY_GROWTH_STEP', 'MEMORY_GROWTH_LINEAR_STEP'],2224['ELIMINATE_DUPLICATE_FUNCTIONS', [0, 1], 'Duplicate function elimination for wasm is handled automatically by binaryen'],2225['ELIMINATE_DUPLICATE_FUNCTIONS_DUMP_EQUIVALENT_FUNCTIONS', [0], 'Duplicate function elimination for wasm is handled automatically by binaryen'],2226['ELIMINATE_DUPLICATE_FUNCTIONS_PASSES', [5], 'Duplicate function elimination for wasm is handled automatically by binaryen'],2227// WASM_OBJECT_FILES is handled in emcc.py, supporting both 0 and 1 for now.2228['WASM_OBJECT_FILES', [0, 1], 'For LTO, use -flto or -fto=thin instead; to disable LTO, just do not pass WASM_OBJECT_FILES=1 as 1 is the default anyhow'],2229['TOTAL_MEMORY', 'INITIAL_MEMORY'],2230['WASM_MEM_MAX', 'MAXIMUM_MEMORY'],2231['BINARYEN_MEM_MAX', 'MAXIMUM_MEMORY'],2232['BINARYEN_PASSES', [''], 'Use BINARYEN_EXTRA_PASSES to add additional passes'],2233['SWAPPABLE_ASM_MODULE', [0], 'Fully swappable asm modules are no longer supported'],2234['ASM_JS', [1], 'asm.js output is not supported anymore'],2235['FINALIZE_ASM_JS', [0, 1], 'asm.js output is not supported anymore'],2236['ASYNCIFY_WHITELIST', 'ASYNCIFY_ONLY'],2237['ASYNCIFY_BLACKLIST', 'ASYNCIFY_REMOVE'],2238['EXCEPTION_CATCHING_WHITELIST', 'EXCEPTION_CATCHING_ALLOWED'],2239['SEPARATE_ASM', [0], 'Separate asm.js only made sense for fastcomp with asm.js output'],2240['SEPARATE_ASM_MODULE_NAME', [''], 'Separate asm.js only made sense for fastcomp with asm.js output'],2241['FAST_UNROLLED_MEMCPY_AND_MEMSET', [0, 1], 'The wasm backend implements memcpy/memset in C'],2242['DOUBLE_MODE', [0, 1], 'The wasm backend always implements doubles normally'],2243['PRECISE_F32', [0, 1, 2], 'The wasm backend always implements floats normally'],2244['ALIASING_FUNCTION_POINTERS', [0, 1], 'The wasm backend always uses a single index space for function pointers, in a single Table'],2245['AGGRESSIVE_VARIABLE_ELIMINATION', [0, 1], 'Wasm ignores asm.js-specific optimization flags'],2246['SIMPLIFY_IFS', [1], 'Wasm ignores asm.js-specific optimization flags'],2247['DEAD_FUNCTIONS', [[]], 'The wasm backend does not support dead function removal'],2248['WASM_BACKEND', [-1], 'Only the wasm backend is now supported (note that setting it as -s has never been allowed anyhow)'],2249['EXPORT_BINDINGS', [0, 1], 'No longer needed'],2250['RUNNING_JS_OPTS', [0], 'Fastcomp cared about running JS which could alter asm.js validation, but not upstream'],2251['EXPORT_FUNCTION_TABLES', [0], 'No longer needed'],2252['BINARYEN_SCRIPTS', [''], 'No longer needed'],2253['WARN_UNALIGNED', [0, 1], 'No longer needed'],2254['ASM_PRIMITIVE_VARS', [[]], 'No longer needed'],2255['WORKAROUND_IOS_9_RIGHT_SHIFT_BUG', [0], 'Wasm2JS does not support iPhone 4s, iPad 2, iPad 3, iPad Mini 1, Pod Touch 5 (devices with end-of-life at iOS 9.3.5) and older'],2256['RUNTIME_FUNCS_TO_IMPORT', [[]], 'No longer needed'],2257['LIBRARY_DEPS_TO_AUTOEXPORT', [[]], 'No longer needed'],2258['EMIT_EMSCRIPTEN_METADATA', [0], 'No longer supported'],2259['SHELL_FILE', [''], 'No longer supported'],2260['LLD_REPORT_UNDEFINED', [1], 'Disabling is no longer supported'],2261['MEM_INIT_METHOD', [0], 'No longer supported'],2262['USE_PTHREADS', [0, 1], 'No longer needed. Use -pthread instead'],2263['USES_DYNAMIC_ALLOC', [1], 'No longer supported. Use -sMALLOC=none'],2264['REVERSE_DEPS', ['auto', 'all', 'none'], 'No longer needed'],2265['RUNTIME_LOGGING', 'RUNTIME_DEBUG'],2266['MIN_EDGE_VERSION', [0x7FFFFFFF], 'No longer supported'],2267['MIN_IE_VERSION', [0x7FFFFFFF], 'No longer supported'],2268['WORKAROUND_OLD_WEBGL_UNIFORM_UPLOAD_IGNORED_OFFSET_BUG', [0], 'No longer supported'],2269['AUTO_ARCHIVE_INDEXES', [0, 1], 'No longer needed'],2270['USE_ES6_IMPORT_META', [1], 'Disabling is no longer supported'],2271['EXTRA_EXPORTED_RUNTIME_METHODS', [[]], 'No longer supported, use EXPORTED_RUNTIME_METHODS'],2272['SUPPORT_ERRNO', [0], 'No longer supported'],2273['DEMANGLE_SUPPORT', [0], 'No longer supported'],2274['MAYBE_WASM2JS', [0], 'No longer supported (use -sWASM=2)'],2275['HEADLESS', [0], 'No longer supported, use headless browsers or Node.js with JSDOM'],2276['USE_OFFSET_COVERTER', [0], 'No longer supported, not needed with modern v8 versions'],2277];227822792280