This document describes changes between tagged Emscripten SDK versions.
Note that in the compiler, version numbering is used as the mechanism to invalidate internal compiler caches, so version numbers do not necessarily reflect the amount of changes between versions.
To browse or download snapshots of old tagged versions, visit https://github.com/emscripten-core/emscripten/releases.
Not all changes are documented here. In particular, new features, user-oriented fixes, options, command-line parameters, usage changes, deprecations, significant internal modifications and optimizations etc. generally deserve a mention. To examine the full set of changes between versions, visit the link to full changeset diff at the end of each section.
See docs/process.md for how version tagging works.
WEBGL_multi_draw_instanced_base_vertex_base_instance
bindings (#12282).getentropy
in sys/random.h
, and use that from libc++'s random_device
. This is more efficient, see #12240.ABORT_ON_WASM_EXCEPTIONS
to work with the recent dynCall changes where functions can be called via the WASM table directly, bypassing WASM exports (#12269).ASYNCIFY_ADVISE
to output which functions have been instrumented for Asyncify mode, and why they need to be handled. (#12146)malloc
and free
by default. If you need access to them from JS, you must export them manually using -s EXPORTED_FUNCTIONS=['_malloc', ..]
.-O1
. This makes -O1
builds a little larger but they compile a lot faster, which makes more sense in a “compromise” build (in between -O0
and higher optimization levels suitable for release builds). (#12178)ERROR_ON_WASM_CHANGES_AFTER_LINK
option that errors if we need to do any work in wasm-emscripten-finalize
or wasm-opt
after linking. This can verify the link is maximally fast and also does no DWARF rewriting. (#12173)EMSCRIPTEN_NATIVE_OPTIMIZER
) have been removed (it was only relevant to asmjs/fastcomp backend).ALLOC_DYNAMIC
and deprecate dynamicAlloc
. (#12057, which also removes the internal DYNAMICTOP_PTR
API.)ABORT_ON_WASM_EXCEPTIONS
which will abort when an unhandled WASM exception is encountered. This makes the Emscripten program behave more like a native program where the OS would terminate the process and no further code can be executed when an unhandled exception (e.g. out-of-bounds memory access) happens. Once the program aborts any exported function calls will fail with a “program has already aborted” exception to prevent calls into code with a potentially corrupted program state.__indirect_function_table
as the import name for the table, which is what LLVM does.BINARYEN_SCRIPTS
setting..js
. This is contrary to behaviour of clang and gcc. Now emscripten will always produce and executable unless the -c
, -r
or -shared
flags are given. This is true even when the name of the output file ends in .o
. e.g, emcc foo.c -o foo.o
will produce a JavaScript file called foo.o
. This might surprise some users (although it matches the behavior of existing toolchains) so we now produce a warning in this case.file://
URLs, which are not very useful for testing anyhow for other reasons (like not working in chrome), and it made things more complex. The behavior has been changed to be simpler and just leave the browser's error code as it is.--no-heap-copy
file packager option by default, and remove the old default behavior entirely. That is the behavior we should have had from the beginning as it is more memory-efficient. (#12027)--no-entry
is now required in STANDALONE_WASM
mode when building a reactor (application without a main function). Previously exporting a list of functions that didn't include _main
would imply this. Now the list of EXPORTED_FUNCTIONS
is not relevant in the deciding the type of application to build. (#12020)__original_main
using --inline-main
. We used to do this so that it didn‘t show up in stack traces (which could be confusing because it is added by the linker - it’s not in the source code). But this has had several downsides, so we are stopping that now. This does not affect program behavior, unless you look at the wasm internals. However, one noticeable effect is that if you use ASYNCIFY_ADD
or ASYNCIFY_ONLY
then you may need to add __original_main
to there (since you are doing manual fine-tuning of the list of functions, which depends on the wasm's internals). Note that this should not matter in -O2+
anyhow as normal inlining generally removes __original_main
. (#11995)STACK_OVERFLOW_CHECK
in builds with ASSERTIONS
from 2 to 1. This means that plain debug builds (-O0
, which enables ASSERTIONS
) do not have the most expensive stack checks on by default. You can still add them with -s STACK_OVERFLOW_CHECK=2
.RESERVED_FUNCTION_POINTERS
setting, which is no longer needed as we have ALLOW_TABLE_GROWTH
. The old option allowed a fixed number of functions to be added to the table, while the new one allows an unlimited number. (We needed the old option for fastcomp, which could not support growth.) The old setting is mapped to the new one, so that building with -s RESERVED_FUNCTION_POINTERS=K
for any K > 0
will simply turn on table growth. The only noticeable effect of this is that you will be able to add an unlimited amount of functions and not just K
.EM_CONFIG
environment variable and --em-config
command line option no longer support a literal python string. Instead the name of a config file is required. Since all config file settings are individually override-able using EM_FOO
this should be enough.-Wno-deprecated
). Please update to python3 as we hope to remove support completely in the next releaase.--save-bc
command line option. This was specific to fastcomp, which is deprecated, and for debugging purposes we already have EMCC_DEBUG
which saves all intermediate files.EXPORTED_FUNCTIONS
list is missing from the build (can be disabled via -Wno-undefined
) (ERROR_ON_UNDEFINED_SYMBOLS and WARN_ON_UNDEFINED_SYMBOLS no longer apply to these symbols which are explicly exported).WASM=0
; #11505).emscripten/math.h
to emscripten/em_math.h
because if a user adds emscripten/
as an include path with -I
, that can override libc math.h, which leads to very confusing errors.main
mandatory by default (#11536). To build a library (“reactor”), use --no-entry
. The compiler will suggest that if main
is not present.-s
and the name of the setting. For example, -sEXPORT_ALL
is now equivalent to -s EXPORT_ALL
.EXCEPTION_CATCHING_WHITELIST
to EXCEPTION_CATCHING_ALLOWED
. The functionality is unchanged, and the old name will be allowed as an alias for a few releases to give users time to migrate.ASYNCIFY_ADD
to add a function, ASYNCIFY_REMOVE
to remove one (previously this was called ASYNCIFY_BLACKLIST
), and ASYNCIFY_ONLY
to set a list of the only functions to instrument and no others (previously this was called ASYNCIFY_WHITELIST
). The updated lists also handle indirect calls properly, so that if you use ASYNCIFY_IGNORE_INDIRECT
and then add (using either the add-list or the only-list) all the functions that are on the stack when pausing, then things will work (for more, see https://github.com/WebAssembly/binaryen/pull/2913).LIBCXX_ABI_OPTIMIZED_FUNCTION
which is an ABI change in libc++ (changing the layout of the std::function
object) (#11403).WASM2C
option that integrates with wabt's wasm2c tool in order to compile everything into a single C file (#11213).~/.emscripten
config file in the $HOME
directory is still supported and the sample config will still be written there in the case that the emscripten root is read-only.cache/ports
inside the emscripten source directory. This can be controlled by setting the location of the cache directory, or for even more fine grained control the EM_PORTS
environment variable and the PORTS
config setting can be used.-Wno-fastcomp
).EMTERPRETIFY
settings. Emterpreter has largely been replaced by asyncify and is fastcomp only so due for removing in the near future anyway.Add Math C API for direct access to JavaScript Math object (#11151).
Address Sanitizer support now includes JavaScript as well, that is, memory access of HEAP* arrays is checked by ASan. That allows errors to be found if JS glue code does something wrong like forget to shift a pointer. To use this, just build with ASan normally, -fsanitize=address
at link (#11147).
Fix embind string conversions in multithreaded builds (#10844).
ALLOW_MEMORY_GROWTH
used to silently disable ABORTING_MALLOC
. It now just changes the default, which means you can pass -s ABORTING_MALLOC=1
to override the default, which was not possible before. (If you pass the flag and don't want that behavior, stop passing the flag.) (#11131)
Change the factory function created by using the MODULARIZE
build option to return a Promise instead of the module instance. That is, beforehand
Module()
would return an instance (which was perhaps not ready yet if startup was async). In the new model, that returns a Promise which you can do .then
or await
on to get notified when the instance is ready, and the callback receives the instance. Note that both before and after this change doing Module()
creates and runs an instance, so the only change is the return value from that call. This fixes some long-standing bugs with that option which have been reported multiple times, but is a breaking change - sorry about that. To reduce the risk of confusing breakage, in a build with ASSERTIONS
we will show a clear warning on common errors. For more, see detailed examples for the current usage in src/settings.js
on MODULARIZE
. (#10697)
A new PRINTF_LONG_DOUBLE
option allows printf to print long doubles at full float128 precision. (#11130)
emscripten_async_queue_on_thread
has been renamed to emscripten_dispatch_to_thread
which no longer implies that it is async - the operation is in fact only async if it is sent to another thread, while it is sync if on the same one. A new emscripten_dispatch_to_thread_async
function is added which is always async.
The emscripten cache now lives in a directory called cache
at the root of the emscripten tree by default. The CACHE
config setting and the EM_CACHE
environment variable can be used to override this (#11126).
Honor CACHE
setting in config file as an alternative to EM_CACHE
environment variable.
Remove --cache
command line arg. The CACHE
config setting and the EM_CACHE
environment variable can be used to control this.
Compiling to a file with no suffix will now generate an executable (JS) rather than an object file. This means simple cases like emcc -o foo foo.c
do the expected thing and generate an executable.
System libraries such as libc and libc++ are now included by default at link time rather than selectively included based on the symbols used in the input object files. For small programs that don't use any system libraries this might result in slightly slower link times with the old fastcomp backend. In order to exclude these libraries build with -nostdlib
and/or -nostdlib++
.
--extern-pre-js
and --extern-post-js
emcc flags. Files provided there are prepended/appended to the final JavaScript output, after all other work has been done, including optimization, optional MODULARIZE
-ation, instrumentation like SAFE_HEAP
, etc. They are the same as prepending/ appending those files after emcc
finishes running, and are just a convenient way to do that. (For comparison, --pre-js
and --post-js
optimize that code together with everything else, keep it in the same scope if running MODULARIZE
, etc.).FE_INEXACT
and other floating point exception macros in libc, since we don‘t support them. That also prevents musl from including code using pragmas that don’t make sense for wasm. Ifdef out other uses of those pragmas as well, as tip of tree LLVM now fails to compile them on wasm. (#11087)BINARYEN_PASSES
setting (#11057). We still have BINARYEN_EXTRA_PASSES
(the removed setting completely overrides the set of passes from the command line, which doesn't make much sense as some of them are mandatory like setting the sbrk ptr).MODULARIZE_INSTANCE
build option (#11037). This was a seldom used option that was complicating the logic for MODULARIZE
. Module instances can be created by using MODULARIZE
and calling the factory function explicitly. See the new --extern-post-js
option added in this release, which can help code that used MODULARIZE_INSTANCE
(you can add an extern post js which does Module = Module();
for example).EMTERPRETIFY
which is soon to be removed.EMCC_LEAVE_INPUTS_RAW
. The two uses cases in our test code were covered by the -nostdlib
option.CONFIGURE_CC
. This could be used to override the underlying compiler used in emcc/em++ but only during configure tests. There are other ways to control/fake the detected configure features that don't require such monkey patching. For example setting defaults via a site file: https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Site-Defaults.htmlCOMPILER_OPTS
. This was a global setting in the emscripten config file that would inject extra compiler options.WASM_BIGINT
flag. With that the VM will use a JS BigInt for a wasm i64, avoiding the need for JS legalization. See #10860.MAXIMUM_MEMORY
to a higher value (i.e. by default you do not get support for 2GB+ heaps). See #10601--llvm-lto
flag is now ignored when using the upstream llvm backend. With the upstream backend LTO is controlled via -flto
.python emcc
no longer works. However emcc
, emcc.py
and python emcc.py
all continue to work. The reason for this change is that #!/usr/bin/env python
is no longer portable since the python symlink was dropped from Ubuntu 20.04.fp$
and g$
accessors in main modules, possible in Binaryen thanks to ensuring function table indexes are unique (#10741).JS_MATH
option to use Math.*
in JS instead of compiled musl (#10821).Module
to Module callback functions like Module.preRun
(#10777).ASYNCIFY_IMPORTS
: it now contains only new imports you add, and does not need to contain the list of default system imports like emscripten_sleep
. There is no harm in providing them, though, so this is not a breaking change.-g
, normal DWARF emitting happens, and when linking with -g
we preserve that and update it. This is a change from before, where we assumed DWARF was unneeded and did not emit it, so this can increase the size of debug builds (i.e. builds compiling and/or linking with -g). This change is necessary for full debugging support, that is, to be able to build with -g
and use a debugger. Before this change only the -gforce_dwarf
flag enabled DWARF; that flag is now removed. If you want the old behavior, build your object files with -gline-tables-only
(that will only add line table info, which is just enough for things like source maps and does not include full debug info). For more info and background see #10325.memset
handling, in particular, in the wasm backend, completely remove the JS version of memset from the JS library and from DEFAULT_LIBRARY_FUNCS_TO_INCLUDE
. The regular C version will be linked in from compiler_rt normally. A noticeable difference you may see is that a JS library cannot add a __dep
to memset
- deps only work for JS library functions, but now we only have the regular C version. If you hit that issue, just add _memset
to EXPORTED_FUNCTIONS
(or adjust deps_info.json
).emscripten_atomic_exchange_u8,16,32,64
(#10657).TOTAL_MEMORY
to INITIAL_MEMORY
and WASM_MEM_MAX
to MAXIMUM_MEMORY
, which are more accurate and match wasm conventions. The old names are still supported as aliases.WASM_OBJECT_FILES
setting. There are many standard ways to enable bitcode objects (-flto, -flto=full, -flto=thin, -emit-llvm).ASSERTIONS
that we do not have compiled code on the stack when starting to rewind, which is dangerous.__invoke_*
functions.-gforce_dwarf
flag for now, though (but that should be removed soon).npm install
after checking out emscripten if they want to use closure (--closure). emsdk users are not effected because emsdk runs this as a post install step (#9989).EM_CACHE
. This should not really be a user visible change although one side effect is that once a given port is built, its headers are then universally accessible, just like the library is universally available as -l<name>
.timestamp
field from mouse, wheel, devicemotion and deviceorientation events. The presence of a timestamp
on these events was slightly arbitrary, and populating this field caused a small profileable overhead that all users might not care about. It is easy to get a timestamp of an event by calling emscripten_get_now()
or emscripten_performance_now()
inside the event handler function of any event.MIN_FIREFOX_VERSION
, MIN_SAFARI_VERSION
, MIN_IE_VERSION
, MIN_EDGE_VERSION
, MIN_CHROME_VERSION
. The existing LEGACY_VM_SUPPORT
option sets all of them to 0, that is, maximal backwards compatibility. Note that going forward, we will use these settings in more places, so if you do need very old legacy browser support, you may need to set either LEGACY_VM_SUPPORT
or the fine-grained options. For more details see #9937DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR
to 1. See #9895. With this change the old deprecated HTML5 API event target lookup behavior is disabled. There is no “Module.canvas” object, no magic “null” default handling, and DOM element ‘target’ parameters are taken to refer to CSS selectors, instead of referring to DOM IDs. For more information see: https://groups.google.com/forum/#!msg/emscripten-discuss/xScZ_LRIByk/_gEy67utDgAJwasi_unstable
to wasi_snapshot_preview1
. This is mostly an implementation detail, but if you use STANDALONE_WASM
it means that the output of emscripten now requires a runtime with wasi_snapshot_preview1
support.SAFE_STACK
has been removed, as it overlaps with STACK_OVERFLOW_CHECK
. Replace SAFE_STACK=1
with STACK_OVERFLOW_CHECK=2
(note the value is 2). This also has the effect of enabling stack checking on upstream builds when ASSERTIONS
are enabled (as assertions enable STACK_OVERFLOW_CHECK=2
).requestFullScreen
method from library_browser.js
, please use requestFullscreen
(without the capital S).requestFullScreen
and cancelFullScreen
from library_glut.js
requestFullScreen
and cancelFullScreen
from library_glfw.js
ERROR_ON_MISSING_LIBRARIES
now also applies to internal symbols that start with emscripten_
. Prior to this change such missing symbols would result in a runtime error, now they are reported at compile time.ALLOW_BLOCKING_ON_MAIN_THREAD
is unset then the warning is an error.pthread_tryjoin_np
, which is a POSIX API similar to pthread_join
but without blocking.emscripten_has_asyncify()
.-lnodefs.js
, -lidbfs.js
', -lworkerfs.js
, -lproxyfs.js
. See #9645.emscripten
config variables using environment variables. Any config variable FOO
can be overridden by EM_FOO
in the environment.-Werror
now also turns warnings in the python driver code into errors.settings.js
to settings_internal.js
. These are settings that are for internal use only and are not set-able from the command line. If we misclassified any of these please open a bug.STANDALONE_WASM
mode now supports setting up argv via wasi APIs.STANDALONE_WASM
mode now supports running static constructors in _start
.MAIN_THREAD_EM_ASM
in wasm backend. #9560USE_FETCH_WORKER=0
. This is useful for people who use FETCH, but don't perform any synchronous fetches on the main thread. #9567EMCONFIGURE_JS
. Since #6269 we have set it to “2” which means never use native, always use JS.USE_FETCH_WORKER=0
is enforced). #9490-s ONLY_MY_CODE
as we now have much better solutions for that, like building to a wasm object file or using STANDALONE_WASM
etc. (see https://github.com/emscripten-core/emscripten/wiki/WebAssembly-Standalone).COMPILER_ENGINE
and JS_ENGINE
options. We only support node as the compiler engine so just use a single NODE_JS
option for that.EXTRA_EXPORTED_RUNTIME_METHODS
, and as with other such changes in the past, forgetting to export it will show a clear error in ASSERTIONS
mode.EMITTING_JS
flag, and replace it with STANDALONE_WASM
. That flag indicates that we want the wasm to be as standalone as possible. We may still emit JS in that case, but the JS would just be a convenient way to run the wasm on the Web or in Node.js.ASYNCIFY_BLACKLIST
and ASYNCIFY_WHITELIST
now support simple ‘*’ wildcard matchingBINARYEN_ROOT
in .emscripten to it. See #9409noExitRuntime
instead of Module.noExitRuntime
.ERROR_ON_MISSING_LIBRARIES
setting (it's always on now)TOTAL_MEMORY
. This means that -s TOTAL_MEMORY=1024*1024
will no longer work. This is done because the mechanism may result in execution of arbitrary code via command line flags.__builtin_return_address
now requires -s USE_OFFSET_CONVERTER=1
to work. (#9073)callMain
is no longer exported by default on Module, to allow better JS minification. You must add it to EXTRA_EXPORTED_RUNTIME_METHODS
if you want to call it on Module. (In assertions builds, an error with an explanation is shown.)EM_ASM
's arguments and prohibit non-arithmetic arguments (e.g. pointers, functions, arrays, objects). (#9054)emcc
on Windows now uses native newline byte sequence to get a line to print for parse error reporting. (#9088)Module
object during startup, like Module.arguments
, are now copied to a local (in order to avoid writing Module.*
everywhere, which wastes space). You can still provide them as always, but you can‘t modify Module.arguments
and other things after startup (which is now after we’ve finished processing them). In a build with assertions enabled you will get an error if you access those properties after startup. (#9072)__thread
and the C11/C++11 keyword thread_local
. (#8976)Module.readAsync()/Module['readAsync']()
to readAsync()
. Note that read is also renamed to read_
(since “read
” is an API call in the SpiderMonkey shell). In builds with ASSERTIONS, an error message is shown about the API change. This change allows better JS minification (the names read, readAsync etc. can be minified, and if the variables are not used they can be removed entirely). Defining these APIs on Module (which was never documented or intended, but happened to work) is also no longer allowed (but you can override read_
etc. from JS).emscripten_run_script_string
now returns C NULL
instead of the string null
or undefined
when the result of the eval
is JavaScript null
or undefined
.embuilder.py
to build a specific library, the name may have changed: for consistency, all library names are prefixed with lib now.embuilder.py
now only builds the requested library, and not its dependencies and certain system libraries that are always built. For example, running embuilder.py build libc
no longer builds libcompiler_rt
if it hasn't be built.EMCC_FORCE_STDLIBS
with a list of libraries, you must now use the simplified names, for example, libmalloc
and libpthreads
instead of libdlmalloc
or libpthreads_stub
. These names will link in the correct version of the library: if the build is configured to use emmalloc
, libmalloc
will mean libemmalloc
, and if thread support is disabled, libpthreads
will mean libpthreads_stub
. This allows you to say libmalloc
or libpthreads
without worrying about which implementation is supposed to be used, and avoid duplicate symbols if you used the wrong implementation.emcc -fsanitize=undefined
to work. (#8651)-fsanitize-minimal-runtime
) also works. (#8617)emscripten_return_address
which implements the functionality of gcc/clang's __builtin_return_address
. (#8617)ino_t/off_t
to 64-bits. (#8467)libbz2.a
). (#8349)ERROR_ON_MISSING_LIBRARIES
by default (#8461)-s EMTERPRETIFY_WHITELIST
now accepts shell-style wildcards; this allows matching static functions with conflicting names that the linker distinguishes by appending a random suffix.library_browser.js
. This changes the scroll amount in SDL, GLFW, and GLUT. (#7968)EMCC_LOCAL_PORTS
works, to be more usable. See #7963-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1
that changes the lookup semantics of DOM elements in html5.h event handler callbacks and WebGL context creation. The new behavior is to use CSS selector strings to look up DOM elements over the old behavior, which was somewhat ad hoc constructed rules around default Emscripten uses. The old behavior will be deprecated and removed in the future. Build with -s ASSERTIONS=1 to get diagnostics messages related to this transition.lib
prefix. If you use EMCC_FORCE_STDLIBS
or EMCC_ONLY_FORCED_STDLIBS
to select system libraries you may need to add the lib
prefix.pthread-main.js
to NAME.worker.js
, where NAME
is the main name of your application, that is, if you emit program.js
then you'll get program.worker.js
(this allows more than one to exist in the same directory, etc.).runPostSets
function and replace with normal static constructor function. See #7579strptime()
's handling of the “%c” to match that of strftime()
. This is a breaking change for code which depends on the old definition of “%c”.tableBase/memoryBase
to __table_base/__memory_base
(#7467)-s NO_X=1
as an alias for -s X=0
and vice versa, which simplifies current settings with NO_
-prefixed names. See #7151.EMULATED_FUNCTION_POINTER
improvements. See #7108, #7128.ERROR_ON_UNDEFINED_SYMBOLS
is now the default. See #7196-s WASM_OBJECT_FILES=1
. See #6875.size_t
and friends from int to long. This may have noticeable effects if you depend on the name mangling of a function that uses size_t
(like in EXPORTED_FUNCTIONS
), and you must rebuild source files to bitcode (so your bitcode is in sync with the system libraries after they are rebuilt with this change). Otherwise this should not have any noticeable effects for users. See #5916.Module.locateFile
to resolve relative paths to *.wasm, *.mem and other files relatively to the main JavaScript file rather than the current working directory (see #5368).prefix
to Module.locateFile
function that contains the path to the JavaScript file where files are loaded from by default.Module.*PrefixURL
APIs (use Module.locateFile
instead).invoke_*()s
. This may add noticeable overhead to programs using C++ exceptions and (less likely) setjmp/longjmp - please report any issues. See #6666 #6702src/struct_info.compiled.json
: Make it a normal cached thing like system libraries, not something checked into the source tree.-s WASM=0
to disable wasm and use asm.js if you want that (or use -s LEGACY_VM_SUPPORT=1
, which emits output that can run in older browsers, which includes a bunch of polyfills as well as disables wasm). (#6419)-s X=@file
broke if the file contains a newline (see #6436; fixed in 1.37.40)-s DISABLE_EXCEPTION_CATCHING=0
to enable them.addFunction
is now supported on LLVM wasm backend, but when being used on the wasm backend, you need to provide an additional second argument, a Wasm function signature string. Each character within a signature string represents a type. The first character represents the return type of a function, and remaining characters are for parameter types.ALLOC_*
numeric constants by default. As with previous changes, a warning will be shown in -O0
and when ASSERTIONS
are on if they are used.-O0
and when ASSERTIONS
are on, which will suggest either exporting the specific methods you need, or using FORCE_FILESYSTEM
which will auto export all the main filesystem methods. Aside from using FS methods yourself, you may notice this change when using a file package created standalone, that is, by running the file packager directly and then loading it at run time (as opposed to telling emcc
to package the files for you, in which case it would be aware of them at compile time); you should build with FORCE_FILESYSTEM
to ensure filesystem support for that case.Runtime
object, and move all the useful methods from it to simple top-level functions. Any usage of Runtime.func
should be changed to func
.NO_EXIT_RUNTIME
to 1 by default. This means that by default we don't include code to shut down the runtime, flush stdio streams, run atexits, etc., which is better for code size. When ASSERTIONS
is on, we warn at runtime if there is text buffered in the streams that should be flushed, or atexits are used.ASSERTIONS
warnings to help users), do not export the following runtime methods by default: ccall, cwrap, allocate, Pointer_stringify, AsciiToString, stringToAscii, UTF8ArrayToString, UTF8ToString, stringToUTF8Array, stringToUTF8, lengthBytesUTF8, stackTrace, addOnPreRun, addOnInit, addOnPreMain, addOnExit, addOnPostRun, intArrayFromString, intArrayToString, writeStringToMemory, writeArrayToMemory, writeAsciiToMemory.LEGACY_VM_SUPPORT
option enables support for legacy browsers. In ASSERTIONS
mode, a warning is shown if a polyfill was needed, suggesting using that option.Module
then you must export them by adding them to EXTRA_EXPORTED_RUNTIME_METHODS
. In -O0
or when ASSERTIONS
is on, a run-time error message explains that, if they are attempted to be used incorrectly.