Skip to content

Commit 079738f

Browse files
authored
Remove stub flavor of wasm worker library. NFC (#26429)
As far as I can tell there is no way to actually use this library since libwasm_workers is only ever included when `-sWASM_WORKERS` is used. Given that it not active/usable I think we should remove it until there is demand for something like this. Also, remove the addition of `-fPIC` (that is handled already by get_base_cflags); Also, remove the addition of `-DNDEBUG` (that is handled already by DebugLibrary).
1 parent 5eeef58 commit 079738f

3 files changed

Lines changed: 5 additions & 130 deletions

File tree

embuilder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@
121121
'libsanitizer_common_rt',
122122
'libubsan_rt',
123123
'libwasm_workers-debug',
124-
'libwasm_workers-debug-stub',
125124
'libfetch',
126125
'libfetch-mt',
127126
'libwasmfs',

system/lib/wasm_worker/library_wasm_worker_stub.c

Lines changed: 0 additions & 88 deletions
This file was deleted.

tools/system_libs.py

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,15 +1504,12 @@ def can_use(self):
15041504
class libwasm_workers(DebugLibrary):
15051505
name = 'libwasm_workers'
15061506
includes = ['system/lib/libc']
1507-
1508-
def __init__(self, **kwargs):
1509-
self.is_stub = kwargs.pop('stub')
1510-
super().__init__(**kwargs)
1507+
src_dir = 'system/lib/wasm_worker'
1508+
src_files = ['library_wasm_worker.c', 'wasm_worker_initialize.S']
15111509

15121510
def get_cflags(self):
1513-
cflags = super().get_cflags()
1511+
cflags = super().get_cflags() + ['-sWASM_WORKERS']
15141512
if self.is_debug:
1515-
cflags += ['-D_DEBUG']
15161513
# library_wasm_worker.c contains an assert that a nonnull parameter
15171514
# is no NULL, which llvm now warns is redundant/tautological.
15181515
cflags += ['-Wno-tautological-pointer-compare']
@@ -1521,45 +1518,12 @@ def get_cflags(self):
15211518
# https://github.com/emscripten-core/emscripten/issues/19331
15221519
cflags += ['-O0']
15231520
else:
1524-
cflags += ['-DNDEBUG', '-Oz']
1525-
if settings.MAIN_MODULE:
1526-
cflags += ['-fPIC']
1527-
if not self.is_stub:
1528-
cflags += ['-sWASM_WORKERS']
1521+
cflags += ['-Oz']
15291522
return cflags
15301523

1531-
def get_base_name(self):
1532-
name = super().get_base_name()
1533-
if self.is_stub:
1534-
name += '-stub'
1535-
return name
1536-
1537-
@classmethod
1538-
def vary_on(cls):
1539-
return super().vary_on() + ['stub']
1540-
1541-
@classmethod
1542-
def get_default_variation(cls, **kwargs):
1543-
return super().get_default_variation(stub=not settings.WASM_WORKERS, **kwargs)
1544-
1545-
def get_files(self):
1546-
files = []
1547-
if self.is_stub:
1548-
files = [
1549-
'library_wasm_worker_stub.c',
1550-
]
1551-
else:
1552-
files = [
1553-
'library_wasm_worker.c',
1554-
'wasm_worker_initialize.S',
1555-
]
1556-
return files_in_path(
1557-
path='system/lib/wasm_worker',
1558-
filenames=files)
1559-
15601524
def can_use(self):
15611525
# see src/library_wasm_worker.js
1562-
return super().can_use() and not settings.SINGLE_FILE and not settings.MAIN_MODULE
1526+
return super().can_use() and not settings.SINGLE_FILE and not settings.MAIN_MODULE and settings.WASM_WORKERS
15631527

15641528

15651529
class libsockets(MuslInternalLibrary, MTLibrary):

0 commit comments

Comments
 (0)