diff --git a/embuilder.py b/embuilder.py index 80549f7407e27..08d6d2f386397 100755 --- a/embuilder.py +++ b/embuilder.py @@ -32,11 +32,13 @@ # Minimal subset of targets used by CI systems to build enough to be useful MINIMAL_TASKS = [ 'libcompiler_rt', + 'libcompiler_rt-mt', 'libcompiler_rt-legacysjlj', 'libcompiler_rt-wasmsjlj', 'libcompiler_rt-ww', 'libc', 'libc-debug', + 'libc-mt-debug', 'libc-ww-debug', 'libc_optz', 'libc_optz-debug', @@ -48,6 +50,7 @@ 'libc++abi-debug-legacyexcept', 'libc++abi-debug-wasmexcept', 'libc++abi-debug-noexcept', + 'libc++abi-debug-mt-noexcept', 'libc++abi-debug-ww-noexcept', 'libc++', 'libc++-legacyexcept', @@ -58,15 +61,18 @@ 'libc++-debug-wasmexcept', 'libc++-debug-legacyexcept', 'libc++-debug-noexcept', + 'libc++-debug-mt-noexcept', 'libc++-debug-ww-noexcept', 'libal', 'libdlmalloc', 'libdlmalloc-tracing', 'libdlmalloc-debug', + 'libdlmalloc-mt-debug', 'libdlmalloc-ww', 'libdlmalloc-ww-debug', 'libembind', 'libembind-rtti', + 'libembind-mt-rtti', 'libemmalloc', 'libemmalloc-debug', 'libemmalloc-memvalidate', @@ -76,12 +82,14 @@ 'libmimalloc-mt', 'libGL', 'libGL-getprocaddr', + 'libGL-mt-getprocaddr', 'libGL-emu-getprocaddr', 'libGL-emu-webgl2-ofb-getprocaddr', 'libGL-webgl2-ofb-getprocaddr', 'libGL-ww-getprocaddr', 'libhtml5', 'libsockets', + 'libsockets-mt', 'libsockets-ww', 'libstubs', 'libstubs-debug', @@ -100,29 +108,22 @@ # Additional tasks on top of MINIMAL_TASKS that are necessary for PIC testing on # CI (which has slightly more tests than other modes that want to use MINIMAL) MINIMAL_PIC_TASKS = MINIMAL_TASKS + [ - 'libcompiler_rt-mt', 'libc-mt', - 'libc-mt-debug', 'libc_optz-mt', 'libc_optz-mt-debug', 'libc++abi-mt', 'libc++abi-mt-noexcept', 'libc++abi-debug-mt', - 'libc++abi-debug-mt-noexcept', 'libc++-mt', 'libc++-mt-noexcept', 'libc++-debug-mt', - 'libc++-debug-mt-noexcept', 'libdlmalloc-mt', - 'libdlmalloc-mt-debug', 'libGL-emu', 'libGL-emu-webgl2-getprocaddr', - 'libGL-mt-getprocaddr', 'libGL-mt-emu', 'libGL-mt-emu-webgl2-getprocaddr', 'libGL-mt-emu-webgl2-ofb-getprocaddr', 'libsockets_proxy', - 'libsockets-mt', 'crtbegin', 'libsanitizer_common_rt', 'libubsan_rt', diff --git a/test/test_other.py b/test/test_other.py index 4ce2b8b3960a1..9a50cec10b67b 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -3644,11 +3644,16 @@ def test_embind_tsgen_bigint(self): self.run_process(args) self.assertFileContents(test_file('other/embind_tsgen_bigint.d.ts'), read_file('embind_tsgen_bigint.d.ts')) + @parameterized({ + '': [[]], + 'pthread': [['-pthread']], + }) @requires_wasm64 - def test_embind_tsgen_memory64(self): + def test_embind_tsgen_memory64(self, args): # Check that when memory64 is enabled longs & unsigned longs are mapped to bigint in the generated TS bindings self.run_process([EMXX, test_file('other/embind_tsgen_memory64.cpp'), '-lembind', '--emit-tsd', 'embind_tsgen_memory64.d.ts', '-sMEMORY64'] + + args + self.get_cflags()) self.assertFileContents(test_file('other/embind_tsgen_memory64.d.ts'), read_file('embind_tsgen_memory64.d.ts')) diff --git a/tools/link.py b/tools/link.py index f47c41b25c3a9..0dc2dba0d1c81 100644 --- a/tools/link.py +++ b/tools/link.py @@ -2036,6 +2036,12 @@ def run_embind_gen(options, wasm_target, js_syms, extra_settings): if basename == 'libembind.js': settings.JS_LIBRARIES[i] = os.path.join(dirname, 'libembind_gen.js') settings.MIN_NODE_VERSION = 160000 if settings.MEMORY64 else 150000 + # The final version of the memory64 proposal is not implemented until node + # v24, so we need to lower it away in order to execute the binary at build + # time. + # TODO Remove lowering when emsdk version of node is >= 24 and just require it. + if settings.MEMORY64: + settings.MEMORY64 = 2 # Source maps haven't been generated yet and aren't needed to run embind_gen. settings.LOAD_SOURCE_MAP = 0 outfile_js = in_temp('tsgen.js') @@ -2045,9 +2051,7 @@ def run_embind_gen(options, wasm_target, js_syms, extra_settings): # Build the flags needed by Node.js to properly run the output file. node_args = [] if settings.MEMORY64: - # The final version of the memory64 proposal is not yet implemented in any - # shipping version of node, so we need to lower it away in order to - # execute the binary at built time. + # See comment above about lowering memory64. building.run_wasm_opt(outfile_wasm, outfile_wasm, ['--memory64-lowering', '--table64-lowering']) if settings.WASM_EXCEPTIONS: node_args += shared.node_exception_flags(config.NODE_JS)