Skip to content

Commit 11a09a2

Browse files
authored
Remove error when EXPORT_NAME is not specified with MODULARIZE+pthreads (#21772)
Now that worker.js is no longer a separate file we no longer have this limitation.
1 parent 3eb5a57 commit 11a09a2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

test/test_other.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12304,8 +12304,13 @@ def test_SUPPORT_LONGJMP_wasm(self):
1230412304
self.run_process([EMCC, test_file('core/test_longjmp.c'), '-c', '-sSUPPORT_LONGJMP=wasm', '-o', 'a.o'])
1230512305

1230612306
def test_pthread_MODULARIZE(self):
12307-
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-pthread', '-sMODULARIZE'])
12308-
self.assertContained('pthreads + MODULARIZE currently require you to set -sEXPORT_NAME=Something (see settings.js) to Something != Module, so that the .worker.js file can work', err)
12307+
self.run_process([EMCC, test_file('hello_world.c'), '-o', 'out.mjs', '-pthread', '-sPROXY_TO_PTHREAD', '-sMODULARIZE', '-sEXIT_RUNTIME'])
12308+
create_file('runner.mjs', '''
12309+
import Hello from "./out.mjs";
12310+
Hello();
12311+
''')
12312+
output = self.run_js('runner.mjs')
12313+
self.assertContained('hello, world!', output)
1230912314

1231012315
def test_jslib_clobber_i(self):
1231112316
# Regression check for an issue we have where a library clobbering the global `i` variable could

tools/link.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,6 @@ def setup_pthreads():
513513
if settings.MINIMAL_RUNTIME:
514514
building.user_requested_exports.add('exit')
515515

516-
if settings.MODULARIZE and not settings.EXPORT_ES6 and settings.EXPORT_NAME == 'Module':
517-
exit_with_error('pthreads + MODULARIZE currently require you to set -sEXPORT_NAME=Something (see settings.js) to Something != Module, so that the .worker.js file can work')
518-
519516

520517
def set_initial_memory():
521518
user_specified_initial_heap = 'INITIAL_HEAP' in user_settings

0 commit comments

Comments
 (0)