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
2 changes: 1 addition & 1 deletion embuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
'crtbegin',
'libsanitizer_common_rt',
'libubsan_rt',
'libwasm_workers_stub-debug',
'libwasm_workers-debug-stub',
'libfetch',
'libfetch-mt',
'libwasmfs',
Expand Down
22 changes: 11 additions & 11 deletions tools/system_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1410,17 +1410,17 @@ def can_use(self):
return super(libprintf_long_double, self).can_use() and settings.PRINTF_LONG_DOUBLE


class libwasm_workers(MTLibrary):
class libwasm_workers(DebugLibrary):
name = 'libwasm_workers'
includes = ['system/lib/libc']

def __init__(self, **kwargs):
self.debug = kwargs.pop('debug')
self.is_stub = kwargs.pop('stub')
super().__init__(**kwargs)

def get_cflags(self):
cflags = super().get_cflags()
if self.debug:
if self.is_debug:
cflags += ['-D_DEBUG']
# library_wasm_worker.c contains an assert that a nonnull parameter
# is no NULL, which llvm now warns is redundant/tautological.
Expand All @@ -1433,28 +1433,28 @@ def get_cflags(self):
cflags += ['-DNDEBUG', '-Oz']
if settings.MAIN_MODULE:
cflags += ['-fPIC']
if not self.is_stub:
cflags += ['-sWASM_WORKERS']
return cflags

def get_base_name(self):
name = 'libwasm_workers'
if not self.is_ww and not self.is_mt:
name += '_stub'
if self.debug:
name += '-debug'
name = super().get_base_name()
if self.is_stub:
name += '-stub'
return name

@classmethod
def vary_on(cls):
return super().vary_on() + ['debug']
return super().vary_on() + ['stub']

@classmethod
def get_default_variation(cls, **kwargs):
return super().get_default_variation(debug=settings.ASSERTIONS >= 1, **kwargs)
return super().get_default_variation(stub=not settings.WASM_WORKERS, **kwargs)

def get_files(self):
return files_in_path(
path='system/lib/wasm_worker',
filenames=['library_wasm_worker.c' if self.is_ww or self.is_mt else 'library_wasm_worker_stub.c'])
filenames=['library_wasm_worker_stub.c' if self.is_stub else 'library_wasm_worker.c'])

def can_use(self):
# see src/library_wasm_worker.js
Expand Down
Loading