Skip to content

Commit 39b44b6

Browse files
authored
Avoid the need for library_stack_trace.js when BOOTSTRAPPING_STRUCT_INFO. NFC (#15264)
1 parent f47bef3 commit 39b44b6

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

emcc.py

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,29 +1850,33 @@ def default_setting(name, new_default):
18501850
if settings.PROXY_TO_WORKER or options.use_preload_plugins:
18511851
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += ['$Browser']
18521852

1853-
if not settings.MINIMAL_RUNTIME:
1854-
# In non-MINIMAL_RUNTIME, the core runtime depends on these functions to be present. (In MINIMAL_RUNTIME, they are
1855-
# no longer always bundled in)
1856-
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += [
1857-
'$demangle',
1858-
'$demangleAll',
1859-
'$jsStackTrace',
1860-
'$stackTrace',
1861-
# Called by `callMain` to handle exceptions
1862-
'$handleException'
1863-
]
1853+
if settings.BOOTSTRAPPING_STRUCT_INFO:
1854+
# Called by `callMain` to handle exceptions
1855+
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += ['$handleException']
1856+
else:
1857+
if not settings.MINIMAL_RUNTIME:
1858+
# In non-MINIMAL_RUNTIME, the core runtime depends on these functions to be present. (In MINIMAL_RUNTIME, they are
1859+
# no longer always bundled in)
1860+
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += [
1861+
'$demangle',
1862+
'$demangleAll',
1863+
'$jsStackTrace',
1864+
'$stackTrace',
1865+
# Called by `callMain` to handle exceptions
1866+
'$handleException'
1867+
]
18641868

1865-
if settings.FILESYSTEM and not settings.BOOTSTRAPPING_STRUCT_INFO and not settings.STANDALONE_WASM:
1866-
# to flush streams on FS exit, we need to be able to call fflush
1867-
# we only include it if the runtime is exitable, or when ASSERTIONS
1868-
# (ASSERTIONS will check that streams do not need to be flushed,
1869-
# helping people see when they should have enabled EXIT_RUNTIME)
1870-
if settings.EXIT_RUNTIME or settings.ASSERTIONS:
1871-
settings.EXPORTED_FUNCTIONS += ['_fflush']
1872-
1873-
if settings.SUPPORT_ERRNO and not settings.BOOTSTRAPPING_STRUCT_INFO:
1874-
# so setErrNo JS library function can report errno back to C
1875-
settings.EXPORTED_FUNCTIONS += ['___errno_location']
1869+
if settings.FILESYSTEM and not settings.STANDALONE_WASM:
1870+
# to flush streams on FS exit, we need to be able to call fflush
1871+
# we only include it if the runtime is exitable, or when ASSERTIONS
1872+
# (ASSERTIONS will check that streams do not need to be flushed,
1873+
# helping people see when they should have enabled EXIT_RUNTIME)
1874+
if settings.EXIT_RUNTIME or settings.ASSERTIONS:
1875+
settings.EXPORTED_FUNCTIONS += ['_fflush']
1876+
1877+
if settings.SUPPORT_ERRNO:
1878+
# so setErrNo JS library function can report errno back to C
1879+
settings.EXPORTED_FUNCTIONS += ['___errno_location']
18761880

18771881
if settings.SAFE_HEAP:
18781882
# SAFE_HEAP check includes calling emscripten_get_sbrk_ptr() from wasm

src/modules.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ var LibraryManager = {
170170
libraries = [
171171
'library_bootstrap.js',
172172
'library_formatString.js',
173-
'library_stack_trace.js',
174173
'library_int53.js',
175174
];
176175
}

0 commit comments

Comments
 (0)