Skip to content

Commit 09534bb

Browse files
authored
Add some test coverage for threads+OFFSCREEN_FRAMEBUFFER+MAIN_MODULE=1. NFC (#25449)
See #19046
1 parent b27f90b commit 09534bb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

test/test_browser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,6 +1936,7 @@ def test_gl_glteximage(self):
19361936
@parameterized({
19371937
'': ([],),
19381938
'pthreads': (['-pthread', '-sPROXY_TO_PTHREAD', '-sOFFSCREEN_FRAMEBUFFER'],),
1939+
'pthreads_main_module': (['-pthread', '-sPROXY_TO_PTHREAD', '-sOFFSCREEN_FRAMEBUFFER', '-sMAIN_MODULE', '-Wno-experimental'],),
19391940
})
19401941
@requires_graphics_hardware
19411942
def test_gl_textures(self, args):

tools/link.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3090,7 +3090,14 @@ def run(options, linker_args):
30903090
logger.debug('stopping after linking to object file')
30913091
return 0
30923092

3093-
linker_args += phase_calculate_system_libraries(options)
3093+
system_libs = phase_calculate_system_libraries(options)
3094+
# Only add system libraries that have not already been specified.
3095+
# This avoids issues where the user explictly includes, for example, `-lGL`.
3096+
# This is not normally a problem except in the case of -sMAIN_MODULE=1 where
3097+
# the duplicate library would result in duplicate symbols.
3098+
for s in system_libs:
3099+
if s not in linker_args:
3100+
linker_args.append(s)
30943101

30953102
js_syms = {}
30963103
if (not settings.SIDE_MODULE or settings.ASYNCIFY) and not shared.SKIP_SUBPROCS:

0 commit comments

Comments
 (0)