Skip to content

Commit

Permalink
Fix linker error with -sEXPORT_ES6 -sTRUSTED_TYPES -pthread. (#21951)
Browse files Browse the repository at this point in the history
This was broken in #19906, but we didn't have any testing for this
particular combination of flags.
  • Loading branch information
sbc100 authored May 15, 2024
1 parent 4a83d1b commit 04535a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/library_pthread.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ var LibraryPThread = {
var p = trustedTypes.createPolicy(
'emscripten#workerPolicy1',
{
createScriptURL: (ignored) => new URL(import.meta.url);
createScriptURL: (ignored) => new URL(import.meta.url)
}
);
worker = new Worker(p.createScriptURL('ignored'), workerOptions);
Expand Down
11 changes: 8 additions & 3 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -12397,8 +12397,12 @@ def test_SUPPORT_LONGJMP_wasm(self):
# because Emscripten EH and Wasm SjLj cannot be used at the same time.
self.run_process([EMCC, test_file('core/test_longjmp.c'), '-c', '-sSUPPORT_LONGJMP=wasm', '-o', 'a.o'])

def test_pthread_MODULARIZE(self):
self.run_process([EMCC, test_file('hello_world.c'), '-o', 'out.mjs', '-pthread', '-sPROXY_TO_PTHREAD', '-sMODULARIZE', '-sEXIT_RUNTIME'])
@parameterized({
'': [[]],
'trusted': [['-sTRUSTED_TYPES']]
})
def test_pthread_export_es6(self, args):
self.run_process([EMCC, test_file('hello_world.c'), '-o', 'out.mjs', '-pthread', '-sPROXY_TO_PTHREAD', '-sEXIT_RUNTIME'] + args)
create_file('runner.mjs', '''
import Hello from "./out.mjs";
Hello();
Expand Down Expand Up @@ -12491,7 +12495,8 @@ def test_old_makeDynCall_syntax(self):
# For this test verify the different build options that generate anonymous enclosing function scopes. (DYNCALLS and MEMORY64)
@parameterized({
'plain': [[]],
'dyncalls': [['-sDYNCALLS']]})
'dyncalls': [['-sDYNCALLS']]
})
def test_this_in_dyncall(self, args):
self.do_run_in_out_file_test('no_this_in_dyncall.c', emcc_args=['--js-library', test_file('no_this_in_dyncall.js')] + args)

Expand Down

0 comments on commit 04535a3

Please sign in to comment.