Skip to content

Commit ac22f90

Browse files
committed
.
1 parent 4204e28 commit ac22f90

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

tools/building.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,13 @@ def metadce(js_file, wasm_file, minify_whitespace, debug_info):
11321132
'name': 'emcc$export$' + export,
11331133
'reaches': []
11341134
})
1135+
# Because emitDCEGraph only looks at the main js file, and not the worker
1136+
# we have to explictly add module exported here that are accessed from the
1137+
# worker, in order to keep them alive through this DCE.
1138+
# TODO: Find a more robust way to do this, perhaps by also scanning worker.js
1139+
# for roots.
1140+
if Settings.USE_PTHREADS:
1141+
user_requested_exports.append('_emscripten_tls_init')
11351142
# ensure that functions expected to be exported to the outside are roots
11361143
for item in graph:
11371144
if 'export' in item:

tools/system_libs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ def get_files(self):
11991199
filenames=[
12001200
'library_pthread.c',
12011201
'emscripten_atomic.c',
1202-
'emscripten_init_tls.c',
1202+
'emscripten_tls_init.c',
12031203
])
12041204
return files
12051205
else:

0 commit comments

Comments
 (0)