Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,7 @@ def test_gl_glteximage(self):
@parameterized({
'': ([],),
'pthreads': (['-pthread', '-sPROXY_TO_PTHREAD', '-sOFFSCREEN_FRAMEBUFFER'],),
'pthreads_main_module': (['-pthread', '-sPROXY_TO_PTHREAD', '-sOFFSCREEN_FRAMEBUFFER', '-sMAIN_MODULE', '-Wno-experimental'],),
})
@requires_graphics_hardware
def test_gl_textures(self, args):
Expand Down
9 changes: 8 additions & 1 deletion tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -3090,7 +3090,14 @@ def run(options, linker_args):
logger.debug('stopping after linking to object file')
return 0

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

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