diff --git a/.circleci/config.yml b/.circleci/config.yml index 8d6faf2f153aa..409c07f66f9ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -240,6 +240,10 @@ commands: description: "Name of given test suite" type: string default: "" + extra-cflags: + description: "Extra EMCC_CFLAGS" + type: string + default: "" steps: - when: # We only set EMTEST_RETRY_FLAKY on pull requests. When we run @@ -250,6 +254,8 @@ commands: - set-retry-flaky-tests - run: name: run tests (<< parameters.title >>) + environment: + EMCC_CFLAGS: << parameters.extra-cflags >> command: | env ./test/runner << parameters.test_targets >> @@ -765,6 +771,7 @@ jobs: node_version: "10.19.0" - run-tests: title: "node (oldest / 10.19.0)" + extra-cflags: "-sMIN_NODE_VERSION=101900" test_targets: " other.test_gen_struct_info other.test_native_call_before_init diff --git a/embuilder.py b/embuilder.py index af634eea12d13..bdee69849ee7b 100755 --- a/embuilder.py +++ b/embuilder.py @@ -30,7 +30,6 @@ # Minimal subset of targets used by CI systems to build enough to be useful MINIMAL_TASKS = [ - 'libbulkmemory', 'libcompiler_rt', 'libcompiler_rt-wasm-sjlj', 'libcompiler_rt-ww', diff --git a/emcc.py b/emcc.py index 1ae6a24f94477..1ce16b7d0d299 100644 --- a/emcc.py +++ b/emcc.py @@ -385,14 +385,6 @@ def get_clang_flags(user_args): if '-mbulk-memory' not in user_args: flags.append('-mbulk-memory') - # In emscripten we currently disable bulk memory by default. - # This should be removed/updated when we als update the default browser targets. - if '-mbulk-memory' not in user_args and '-mno-bulk-memory' not in user_args: - # Bulk memory may be enabled via threads or directly via -s. - if not settings.BULK_MEMORY: - flags.append('-mno-bulk-memory') - flags.append('-mno-bulk-memory-opt') - if settings.RELOCATABLE and '-fPIC' not in user_args: flags.append('-fPIC') diff --git a/src/library.js b/src/library.js index 607e18e68de0d..14c45f6b10963 100644 --- a/src/library.js +++ b/src/library.js @@ -405,38 +405,6 @@ addToLibrary({ // the initial values of the environment accessible by getenv. $ENV: {}, - // In -Oz builds, we replace memcpy() altogether with a non-unrolled wasm - // variant, so we should never emit _emscripten_memcpy_js() in the build. - // In STANDALONE_WASM we avoid the _emscripten_memcpy_js dependency so keep - // the wasm file standalone. - // In BULK_MEMORY mode we include native versions of these functions based - // on memory.fill and memory.copy. - // In MAIN_MODULE=1 or EMCC_FORCE_STDLIBS mode all of libc is force included - // so we cannot override parts of it, and therefore cannot use libc_optz. -#if (SHRINK_LEVEL < 2 || LINKABLE || process.env.EMCC_FORCE_STDLIBS) && !STANDALONE_WASM && !BULK_MEMORY - -#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_SAFARI_VERSION < 100101 - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/copyWithin lists browsers that support TypedArray.prototype.copyWithin, but it - // has outdated information for Safari, saying it would not support it. - // https://github.com/WebKit/webkit/commit/24a800eea4d82d6d595cdfec69d0f68e733b5c52#diff-c484911d8df319ba75fce0d8e7296333R1 suggests support was added on Aug 28, 2015. - // Manual testing suggests: - // Safari/601.1 Version/9.0 on iPhone 4s with iOS 9.3.6 (released September 30, 2015) does not support copyWithin. - // but the following systems do: - // AppleWebKit/602.2.14 Safari/602.1 Version/10.0 Mobile/14B100 iPhone OS 10_1_1 on iPhone 5s with iOS 10.1.1 (released October 31, 2016) - // AppleWebKit/603.3.8 Safari/602.1 Version/10.0 on iPhone 5 with iOS 10.3.4 (released July 22, 2019) - // AppleWebKit/605.1.15 iPhone OS 12_3_1 Version/12.1.1 Safari/604.1 on iPhone SE with iOS 12.3.1 - // AppleWebKit/605.1.15 Safari/604.1 Version/13.0.4 iPhone OS 13_3 on iPhone 6s with iOS 13.3 - // AppleWebKit/605.1.15 Version/13.0.3 Intel Mac OS X 10_15_1 on Safari 13.0.3 (15608.3.10.1.4) on macOS Catalina 10.15.1 - // Hence the support status of .copyWithin() for Safari version range [10.0.0, 10.1.0] is unknown. - _emscripten_memcpy_js: `= Uint8Array.prototype.copyWithin - ? (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num) - : (dest, src, num) => HEAPU8.set(HEAPU8.subarray(src, src+num), dest)`, -#else - _emscripten_memcpy_js: (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num), -#endif - -#endif - #if !STANDALONE_WASM // ========================================================================== // assert.h diff --git a/src/library_sigs.js b/src/library_sigs.js index b3b8cea87afa6..2f6029b0fdf00 100644 --- a/src/library_sigs.js +++ b/src/library_sigs.js @@ -321,7 +321,6 @@ sigs = { _emscripten_get_progname__sig: 'vpi', _emscripten_init_main_thread_js__sig: 'vp', _emscripten_lookup_name__sig: 'ip', - _emscripten_memcpy_js__sig: 'vppp', _emscripten_notify_mailbox_postmessage__sig: 'vpp', _emscripten_push_main_loop_blocker__sig: 'vppp', _emscripten_push_uncounted_main_loop_blocker__sig: 'vppp', diff --git a/system/lib/libc/emscripten_internal.h b/system/lib/libc/emscripten_internal.h index 8ad255c581c06..6527f57e3ea15 100644 --- a/system/lib/libc/emscripten_internal.h +++ b/system/lib/libc/emscripten_internal.h @@ -30,12 +30,6 @@ _Noreturn void _abort_js(void); void setThrew(uintptr_t threw, int value); -// An external JS implementation that is efficient for very large copies, using -// HEAPU8.set() -void _emscripten_memcpy_js(void* __restrict__ dest, - const void* __restrict__ src, - size_t n) EM_IMPORT(_emscripten_memcpy_js); - void* _emscripten_memcpy_bulkmem(void* __restrict__ dest, const void* __restrict__ src, size_t n); diff --git a/system/lib/libc/emscripten_memcpy.c b/system/lib/libc/emscripten_memcpy.c index f6a58956e4c6a..7e30f567463c2 100644 --- a/system/lib/libc/emscripten_memcpy.c +++ b/system/lib/libc/emscripten_memcpy.c @@ -9,20 +9,20 @@ #include "emscripten_internal.h" // Use the simple/naive version of memcpy when building with asan -#if defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) || __has_feature(address_sanitizer) +#if __has_feature(address_sanitizer) static void *__memcpy(void *dest, const void *src, size_t n) { unsigned char *d = (unsigned char *)dest; const unsigned char *s = (const unsigned char *)src; -#pragma clang loop unroll(disable) while(n--) *d++ = *s++; return dest; } -#elif defined(__wasm_bulk_memory__) +#elif defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) static void *__memcpy(void *restrict dest, const void *restrict src, size_t n) { - return n ? _emscripten_memcpy_bulkmem(dest, src, n) : dest; + // TODO: Ensure this is inlined with Binaryen or inline asm + return _emscripten_memcpy_bulkmem(dest, src, n); } #else @@ -35,12 +35,10 @@ static void *__memcpy(void *restrict dest, const void *restrict src, size_t n) { unsigned char *block_aligned_d_end; unsigned char *d_end; -#if !defined(EMSCRIPTEN_STANDALONE_WASM) if (n >= 512) { - _emscripten_memcpy_js(dest, src, n); - return dest; + // TODO: Re-investigate the size threshold to enable this + return _emscripten_memcpy_bulkmem(dest, src, n); } -#endif d_end = d + n; if ((((uintptr_t)d) & 3) == (((uintptr_t)s) & 3)) { diff --git a/system/lib/libc/emscripten_memcpy_bulkmem.S b/system/lib/libc/emscripten_memcpy_bulkmem.S index 7a59102f24105..876b997944893 100644 --- a/system/lib/libc/emscripten_memcpy_bulkmem.S +++ b/system/lib/libc/emscripten_memcpy_bulkmem.S @@ -7,10 +7,17 @@ .globl _emscripten_memcpy_bulkmem _emscripten_memcpy_bulkmem: .functype _emscripten_memcpy_bulkmem (PTR, PTR, PTR) -> (PTR) - local.get 0 - local.get 1 local.get 2 - memory.copy 0, 0 +#ifdef __wasm64__ + i32.wrap_i64 +#endif + // memory.copy traps on OOB zero-length copies, but memcpy must not. + if + local.get 0 + local.get 1 + local.get 2 + memory.copy 0, 0 + end_if local.get 0 end_function diff --git a/system/lib/libc/emscripten_memset.c b/system/lib/libc/emscripten_memset.c index 1b51a68b9c76a..111a99f495e62 100644 --- a/system/lib/libc/emscripten_memset.c +++ b/system/lib/libc/emscripten_memset.c @@ -9,16 +9,7 @@ __attribute__((no_sanitize("address"))) void *__memset(void *str, int c, size_t __attribute__((__weak__)) void *__musl_memset(void *str, int c, size_t n); __attribute__((__weak__)) void *__memset(void *str, int c, size_t n); -#ifdef EMSCRIPTEN_OPTIMIZE_FOR_OZ - -void *__memset(void *str, int c, size_t n) { - unsigned char *s = (unsigned char *)str; -#pragma clang loop unroll(disable) - while(n--) *s++ = c; - return str; -} - -#elif defined(__wasm_bulk_memory__) +#if defined(EMSCRIPTEN_OPTIMIZE_FOR_OZ) void *__memset(void *str, int c, size_t n) { return _emscripten_memset_bulkmem(str, c, n); diff --git a/system/lib/libc/emscripten_memset_bulkmem.S b/system/lib/libc/emscripten_memset_bulkmem.S index f734e6ccc0ad5..ba8d91bb0ae8f 100644 --- a/system/lib/libc/emscripten_memset_bulkmem.S +++ b/system/lib/libc/emscripten_memset_bulkmem.S @@ -7,10 +7,17 @@ .globl _emscripten_memset_bulkmem _emscripten_memset_bulkmem: .functype _emscripten_memset_bulkmem (PTR, i32, PTR) -> (PTR) - local.get 0 - local.get 1 local.get 2 - memory.fill 0 +#ifdef __wasm64__ + i32.wrap_i64 +#endif + // memory.fill traps on OOB zero-length sets, but memset must not. + if + local.get 0 + local.get 1 + local.get 2 + memory.fill 0 + end_if local.get 0 end_function diff --git a/test/browser/test_small_js_flags.js.size b/test/browser/test_small_js_flags.js.size index bce5ffdd8fabd..cbc92e3811d9b 100644 --- a/test/browser/test_small_js_flags.js.size +++ b/test/browser/test_small_js_flags.js.size @@ -1 +1 @@ -4374 +4341 diff --git a/test/code_size/embind_hello_wasm.json b/test/code_size/embind_hello_wasm.json index daeb7529eb8e5..62e6c089692f6 100644 --- a/test/code_size/embind_hello_wasm.json +++ b/test/code_size/embind_hello_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 9879, "a.js.gz": 4288, - "a.wasm": 7479, - "a.wasm.gz": 3441, - "total": 17910, - "total_gz": 8109 + "a.wasm": 7348, + "a.wasm.gz": 3375, + "total": 17779, + "total_gz": 8043 } diff --git a/test/code_size/embind_val_wasm.json b/test/code_size/embind_val_wasm.json index 51cdc9e885ce5..acfadb889a929 100644 --- a/test/code_size/embind_val_wasm.json +++ b/test/code_size/embind_val_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 7153, "a.js.gz": 3042, - "a.wasm": 9233, - "a.wasm.gz": 4742, - "total": 16938, - "total_gz": 8164 + "a.wasm": 9119, + "a.wasm.gz": 4701, + "total": 16824, + "total_gz": 8123 } diff --git a/test/code_size/hello_webgl2_wasm.json b/test/code_size/hello_webgl2_wasm.json index 57518ddaba94c..7a020bf4f620b 100644 --- a/test/code_size/hello_webgl2_wasm.json +++ b/test/code_size/hello_webgl2_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 328, "a.js": 4538, "a.js.gz": 2320, - "a.wasm": 10206, - "a.wasm.gz": 6663, - "total": 15198, - "total_gz": 9311 + "a.wasm": 10148, + "a.wasm.gz": 6641, + "total": 15140, + "total_gz": 9289 } diff --git a/test/code_size/hello_webgl2_wasm2js.json b/test/code_size/hello_webgl2_wasm2js.json index 3074c7154d437..738a68f71eed7 100644 --- a/test/code_size/hello_webgl2_wasm2js.json +++ b/test/code_size/hello_webgl2_wasm2js.json @@ -2,7 +2,7 @@ "a.html": 346, "a.html.gz": 262, "a.js": 22202, - "a.js.gz": 11604, + "a.js.gz": 11636, "total": 22548, - "total_gz": 11866 + "total_gz": 11898 } diff --git a/test/code_size/hello_webgl_wasm.json b/test/code_size/hello_webgl_wasm.json index 1aad262f62aa7..10242da677f71 100644 --- a/test/code_size/hello_webgl_wasm.json +++ b/test/code_size/hello_webgl_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 328, "a.js": 4076, "a.js.gz": 2163, - "a.wasm": 10206, - "a.wasm.gz": 6663, - "total": 14736, - "total_gz": 9154 + "a.wasm": 10148, + "a.wasm.gz": 6641, + "total": 14678, + "total_gz": 9132 } diff --git a/test/code_size/hello_webgl_wasm2js.json b/test/code_size/hello_webgl_wasm2js.json index c0b731a9418e9..ce0cfb4281a7d 100644 --- a/test/code_size/hello_webgl_wasm2js.json +++ b/test/code_size/hello_webgl_wasm2js.json @@ -2,7 +2,7 @@ "a.html": 346, "a.html.gz": 262, "a.js": 21728, - "a.js.gz": 11435, + "a.js.gz": 11470, "total": 22074, - "total_gz": 11697 + "total_gz": 11732 } diff --git a/test/code_size/hello_world_wasm.json b/test/code_size/hello_world_wasm.json index dc5b02a59ba81..ba2630c8edfe2 100644 --- a/test/code_size/hello_world_wasm.json +++ b/test/code_size/hello_world_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 283, "a.js.gz": 244, - "a.wasm": 103, + "a.wasm": 106, "a.wasm.gz": 113, - "total": 938, + "total": 941, "total_gz": 737 } diff --git a/test/code_size/hello_world_wasm2js.js b/test/code_size/hello_world_wasm2js.js index 506eec49240aa..b9049f3928eb0 100644 --- a/test/code_size/hello_world_wasm2js.js +++ b/test/code_size/hello_world_wasm2js.js @@ -15,6 +15,7 @@ function e(b) { for (var v, p = 0, t = a, w = f.length, y = a + (3 * w >> 2) - ("=" == f[w - 2]) - ("=" == f[w - 1]); p < w; p += 4) a = m[f.charCodeAt(p + 1)], v = m[f.charCodeAt(p + 2)], c[t++] = m[f.charCodeAt(p)] << 2 | a >> 4, t < y && (c[t++] = a << 4 | v >> 2), t < y && (c[t++] = v << 6 | m[f.charCodeAt(p + 3)]); + return c; } for (var q, m = new Uint8Array(123), n = 25; 0 <= n; --n) m[48 + n] = 52 + n, m[65 + n] = n, m[97 + n] = 26 + n; diff --git a/test/code_size/hello_world_wasm2js.json b/test/code_size/hello_world_wasm2js.json index 4b2ebea84cdfe..191e70bae00a0 100644 --- a/test/code_size/hello_world_wasm2js.json +++ b/test/code_size/hello_world_wasm2js.json @@ -1,8 +1,8 @@ { "a.html": 323, "a.html.gz": 253, - "a.js": 1052, - "a.js.gz": 630, - "total": 1375, - "total_gz": 883 + "a.js": 1061, + "a.js.gz": 629, + "total": 1384, + "total_gz": 882 } diff --git a/test/code_size/math_wasm.json b/test/code_size/math_wasm.json index af0e00a9e9803..16ace6aaf9370 100644 --- a/test/code_size/math_wasm.json +++ b/test/code_size/math_wasm.json @@ -3,8 +3,8 @@ "a.html.gz": 380, "a.js": 110, "a.js.gz": 125, - "a.wasm": 2695, - "a.wasm.gz": 1664, - "total": 3357, - "total_gz": 2169 + "a.wasm": 2698, + "a.wasm.gz": 1666, + "total": 3360, + "total_gz": 2171 } diff --git a/test/code_size/random_printf_wasm.json b/test/code_size/random_printf_wasm.json index ade5c33a60bb4..f75c7599c6da3 100644 --- a/test/code_size/random_printf_wasm.json +++ b/test/code_size/random_printf_wasm.json @@ -1,6 +1,6 @@ { - "a.html": 12517, - "a.html.gz": 6871, - "total": 12517, - "total_gz": 6871 + "a.html": 12449, + "a.html.gz": 6811, + "total": 12449, + "total_gz": 6811 } diff --git a/test/code_size/random_printf_wasm2js.json b/test/code_size/random_printf_wasm2js.json index ea20a2b833652..01548fcbdd758 100644 --- a/test/code_size/random_printf_wasm2js.json +++ b/test/code_size/random_printf_wasm2js.json @@ -1,6 +1,6 @@ { - "a.html": 17195, - "a.html.gz": 7480, - "total": 17195, - "total_gz": 7480 + "a.html": 17233, + "a.html.gz": 7535, + "total": 17233, + "total_gz": 7535 } diff --git a/test/other/codesize/test_codesize_cxx_ctors1.gzsize b/test/other/codesize/test_codesize_cxx_ctors1.gzsize index 1c35f29ce93d9..53251bf6a4ed0 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.gzsize +++ b/test/other/codesize/test_codesize_cxx_ctors1.gzsize @@ -1 +1 @@ -8365 +8346 diff --git a/test/other/codesize/test_codesize_cxx_ctors1.imports b/test/other/codesize/test_codesize_cxx_ctors1.imports index 39ee5c0a1feea..b4c8651dc0e7a 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.imports +++ b/test/other/codesize/test_codesize_cxx_ctors1.imports @@ -1,6 +1,5 @@ env.__cxa_throw env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.environ_get diff --git a/test/other/codesize/test_codesize_cxx_ctors1.jssize b/test/other/codesize/test_codesize_cxx_ctors1.jssize index 6ba1262cc45a0..066d3691a416d 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.jssize +++ b/test/other/codesize/test_codesize_cxx_ctors1.jssize @@ -1 +1 @@ -20373 +20320 diff --git a/test/other/codesize/test_codesize_cxx_ctors1.sent b/test/other/codesize/test_codesize_cxx_ctors1.sent index 469227e5c1d77..ba1faccf2d36d 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.sent +++ b/test/other/codesize/test_codesize_cxx_ctors1.sent @@ -1,6 +1,5 @@ __cxa_throw _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_ctors1.size b/test/other/codesize/test_codesize_cxx_ctors1.size index 97a21fd37a9a7..a3b5de60e54aa 100644 --- a/test/other/codesize/test_codesize_cxx_ctors1.size +++ b/test/other/codesize/test_codesize_cxx_ctors1.size @@ -1 +1 @@ -129570 +129218 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.gzsize b/test/other/codesize/test_codesize_cxx_ctors2.gzsize index a665dbc2e401e..6b663b45b81f6 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.gzsize +++ b/test/other/codesize/test_codesize_cxx_ctors2.gzsize @@ -1 +1 @@ -8347 +8328 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.imports b/test/other/codesize/test_codesize_cxx_ctors2.imports index b706c07df528f..ddadf337d0f2a 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.imports +++ b/test/other/codesize/test_codesize_cxx_ctors2.imports @@ -1,5 +1,4 @@ env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.fd_close diff --git a/test/other/codesize/test_codesize_cxx_ctors2.jssize b/test/other/codesize/test_codesize_cxx_ctors2.jssize index 092e8f41d3d1a..cf805aaa4eb92 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.jssize +++ b/test/other/codesize/test_codesize_cxx_ctors2.jssize @@ -1 +1 @@ -20341 +20288 diff --git a/test/other/codesize/test_codesize_cxx_ctors2.sent b/test/other/codesize/test_codesize_cxx_ctors2.sent index 469227e5c1d77..ba1faccf2d36d 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.sent +++ b/test/other/codesize/test_codesize_cxx_ctors2.sent @@ -1,6 +1,5 @@ __cxa_throw _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_ctors2.size b/test/other/codesize/test_codesize_cxx_ctors2.size index 639381f461d96..0ee50d8f96ee0 100644 --- a/test/other/codesize/test_codesize_cxx_ctors2.size +++ b/test/other/codesize/test_codesize_cxx_ctors2.size @@ -1 +1 @@ -129019 +128630 diff --git a/test/other/codesize/test_codesize_cxx_except.gzsize b/test/other/codesize/test_codesize_cxx_except.gzsize index 83df514078c83..9efff217ba802 100644 --- a/test/other/codesize/test_codesize_cxx_except.gzsize +++ b/test/other/codesize/test_codesize_cxx_except.gzsize @@ -1 +1 @@ -9369 +9348 diff --git a/test/other/codesize/test_codesize_cxx_except.imports b/test/other/codesize/test_codesize_cxx_except.imports index 260df48a1cee4..862370e134c8c 100644 --- a/test/other/codesize/test_codesize_cxx_except.imports +++ b/test/other/codesize/test_codesize_cxx_except.imports @@ -7,7 +7,6 @@ env.__cxa_throw env.__cxa_uncaught_exceptions env.__resumeException env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap env.invoke_diii @@ -17,7 +16,6 @@ env.invoke_ii env.invoke_iii env.invoke_iiii env.invoke_iiiii -env.invoke_iiiiii env.invoke_iiiiiii env.invoke_iiiiiiii env.invoke_iiiiiiiiiiii diff --git a/test/other/codesize/test_codesize_cxx_except.jssize b/test/other/codesize/test_codesize_cxx_except.jssize index 0091e1deb81de..9157ae447d558 100644 --- a/test/other/codesize/test_codesize_cxx_except.jssize +++ b/test/other/codesize/test_codesize_cxx_except.jssize @@ -1 +1 @@ -24141 +24088 diff --git a/test/other/codesize/test_codesize_cxx_except.sent b/test/other/codesize/test_codesize_cxx_except.sent index 74d4d57edf6f8..812e8004418b0 100644 --- a/test/other/codesize/test_codesize_cxx_except.sent +++ b/test/other/codesize/test_codesize_cxx_except.sent @@ -7,7 +7,6 @@ __cxa_throw __cxa_uncaught_exceptions __resumeException _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_except.size b/test/other/codesize/test_codesize_cxx_except.size index 2486c660eef18..1bae0e2d633b9 100644 --- a/test/other/codesize/test_codesize_cxx_except.size +++ b/test/other/codesize/test_codesize_cxx_except.size @@ -1 +1 @@ -171248 +170886 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.gzsize b/test/other/codesize/test_codesize_cxx_except_wasm.gzsize index 6b663b45b81f6..a9af80ca4b9ae 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.gzsize +++ b/test/other/codesize/test_codesize_cxx_except_wasm.gzsize @@ -1 +1 @@ -8328 +8290 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.imports b/test/other/codesize/test_codesize_cxx_except_wasm.imports index 91a534c9f66f0..686c058477034 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.imports +++ b/test/other/codesize/test_codesize_cxx_except_wasm.imports @@ -1,5 +1,4 @@ env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.environ_get diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.jssize b/test/other/codesize/test_codesize_cxx_except_wasm.jssize index 21ce7fe7a474d..afa59f67f3557 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.jssize +++ b/test/other/codesize/test_codesize_cxx_except_wasm.jssize @@ -1 +1 @@ -20267 +20213 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.sent b/test/other/codesize/test_codesize_cxx_except_wasm.sent index 7dc8ebef23ae9..f307b35a2ffb0 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.sent +++ b/test/other/codesize/test_codesize_cxx_except_wasm.sent @@ -1,5 +1,4 @@ _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_except_wasm.size b/test/other/codesize/test_codesize_cxx_except_wasm.size index fbcaf9e6fe055..cdbcd17b502d1 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm.size @@ -1 +1 @@ -142510 +142169 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.gzsize b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.gzsize index 6b663b45b81f6..a9af80ca4b9ae 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.gzsize +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.gzsize @@ -1 +1 @@ -8328 +8290 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.imports b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.imports index 91a534c9f66f0..686c058477034 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.imports +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.imports @@ -1,5 +1,4 @@ env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.environ_get diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.jssize b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.jssize index 21ce7fe7a474d..afa59f67f3557 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.jssize +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.jssize @@ -1 +1 @@ -20267 +20213 diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.sent b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.sent index 7dc8ebef23ae9..f307b35a2ffb0 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.sent +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.sent @@ -1,5 +1,4 @@ _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size index 90b8c859f5018..b122612579300 100644 --- a/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size +++ b/test/other/codesize/test_codesize_cxx_except_wasm_exnref.size @@ -1 +1 @@ -145056 +144715 diff --git a/test/other/codesize/test_codesize_cxx_lto.size b/test/other/codesize/test_codesize_cxx_lto.size index e7718976c5355..608d1dc3431e9 100644 --- a/test/other/codesize/test_codesize_cxx_lto.size +++ b/test/other/codesize/test_codesize_cxx_lto.size @@ -1 +1 @@ -122262 +122145 diff --git a/test/other/codesize/test_codesize_cxx_mangle.gzsize b/test/other/codesize/test_codesize_cxx_mangle.gzsize index f4514b3a9fef8..e67246fd0e7b3 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.gzsize +++ b/test/other/codesize/test_codesize_cxx_mangle.gzsize @@ -1 +1 @@ -9374 +9354 diff --git a/test/other/codesize/test_codesize_cxx_mangle.imports b/test/other/codesize/test_codesize_cxx_mangle.imports index 260df48a1cee4..862370e134c8c 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.imports +++ b/test/other/codesize/test_codesize_cxx_mangle.imports @@ -7,7 +7,6 @@ env.__cxa_throw env.__cxa_uncaught_exceptions env.__resumeException env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap env.invoke_diii @@ -17,7 +16,6 @@ env.invoke_ii env.invoke_iii env.invoke_iiii env.invoke_iiiii -env.invoke_iiiiii env.invoke_iiiiiii env.invoke_iiiiiiii env.invoke_iiiiiiiiiiii diff --git a/test/other/codesize/test_codesize_cxx_mangle.jssize b/test/other/codesize/test_codesize_cxx_mangle.jssize index 27cd4f5eea3a3..267a871ffc4ce 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.jssize +++ b/test/other/codesize/test_codesize_cxx_mangle.jssize @@ -1 +1 @@ -24142 +24089 diff --git a/test/other/codesize/test_codesize_cxx_mangle.sent b/test/other/codesize/test_codesize_cxx_mangle.sent index 74d4d57edf6f8..812e8004418b0 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.sent +++ b/test/other/codesize/test_codesize_cxx_mangle.sent @@ -7,7 +7,6 @@ __cxa_throw __cxa_uncaught_exceptions __resumeException _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_mangle.size b/test/other/codesize/test_codesize_cxx_mangle.size index 6b592912f5f15..8e8b38b5c13b0 100644 --- a/test/other/codesize/test_codesize_cxx_mangle.size +++ b/test/other/codesize/test_codesize_cxx_mangle.size @@ -1 +1 @@ -233088 +232731 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.gzsize b/test/other/codesize/test_codesize_cxx_noexcept.gzsize index 1c35f29ce93d9..53251bf6a4ed0 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.gzsize +++ b/test/other/codesize/test_codesize_cxx_noexcept.gzsize @@ -1 +1 @@ -8365 +8346 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.imports b/test/other/codesize/test_codesize_cxx_noexcept.imports index 39ee5c0a1feea..b4c8651dc0e7a 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.imports +++ b/test/other/codesize/test_codesize_cxx_noexcept.imports @@ -1,6 +1,5 @@ env.__cxa_throw env._abort_js -env._emscripten_memcpy_js env._tzset_js env.emscripten_resize_heap wasi_snapshot_preview1.environ_get diff --git a/test/other/codesize/test_codesize_cxx_noexcept.jssize b/test/other/codesize/test_codesize_cxx_noexcept.jssize index 6ba1262cc45a0..066d3691a416d 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.jssize +++ b/test/other/codesize/test_codesize_cxx_noexcept.jssize @@ -1 +1 @@ -20373 +20320 diff --git a/test/other/codesize/test_codesize_cxx_noexcept.sent b/test/other/codesize/test_codesize_cxx_noexcept.sent index 469227e5c1d77..ba1faccf2d36d 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.sent +++ b/test/other/codesize/test_codesize_cxx_noexcept.sent @@ -1,6 +1,5 @@ __cxa_throw _abort_js -_emscripten_memcpy_js _tzset_js emscripten_resize_heap environ_get diff --git a/test/other/codesize/test_codesize_cxx_noexcept.size b/test/other/codesize/test_codesize_cxx_noexcept.size index 81828aafc4387..232be2fc5f578 100644 --- a/test/other/codesize/test_codesize_cxx_noexcept.size +++ b/test/other/codesize/test_codesize_cxx_noexcept.size @@ -1 +1 @@ -132146 +131781 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.gzsize b/test/other/codesize/test_codesize_cxx_wasmfs.gzsize index 2fb87dfdb1514..94037c4c42aa8 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_cxx_wasmfs.gzsize @@ -1 +1 @@ -3599 +3574 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.imports b/test/other/codesize/test_codesize_cxx_wasmfs.imports index 04f0a4519e9fc..9abae4f3562be 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.imports +++ b/test/other/codesize/test_codesize_cxx_wasmfs.imports @@ -1,6 +1,5 @@ env.__cxa_throw env._abort_js -env._emscripten_memcpy_js env._tzset_js env._wasmfs_copy_preloaded_file_data env._wasmfs_get_num_preloaded_dirs diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.jssize b/test/other/codesize/test_codesize_cxx_wasmfs.jssize index 5cc8c0c95d5f0..d7be241fd641c 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.jssize +++ b/test/other/codesize/test_codesize_cxx_wasmfs.jssize @@ -1 +1 @@ -7794 +7741 diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.sent b/test/other/codesize/test_codesize_cxx_wasmfs.sent index a0049ced118ca..4c86de922a934 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.sent +++ b/test/other/codesize/test_codesize_cxx_wasmfs.sent @@ -1,6 +1,5 @@ __cxa_throw _abort_js -_emscripten_memcpy_js _tzset_js _wasmfs_copy_preloaded_file_data _wasmfs_get_num_preloaded_dirs diff --git a/test/other/codesize/test_codesize_cxx_wasmfs.size b/test/other/codesize/test_codesize_cxx_wasmfs.size index df54fcf7d0a30..b592a30c75210 100644 --- a/test/other/codesize/test_codesize_cxx_wasmfs.size +++ b/test/other/codesize/test_codesize_cxx_wasmfs.size @@ -1 +1 @@ -169407 +169188 diff --git a/test/other/codesize/test_codesize_files_js_fs.size b/test/other/codesize/test_codesize_files_js_fs.size index 6bb2f4ee89f3f..bd03e260e74c2 100644 --- a/test/other/codesize/test_codesize_files_js_fs.size +++ b/test/other/codesize/test_codesize_files_js_fs.size @@ -1 +1 @@ -389 +392 diff --git a/test/other/codesize/test_codesize_files_wasmfs.exports b/test/other/codesize/test_codesize_files_wasmfs.exports index 1b3d6ede9e560..b64e135c8e3cf 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.exports +++ b/test/other/codesize/test_codesize_files_wasmfs.exports @@ -1,4 +1,4 @@ -q (memory) -r (__wasm_call_ctors) -s (main) -t (__indirect_function_table) +p (memory) +q (__wasm_call_ctors) +r (main) +s (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_files_wasmfs.funcs b/test/other/codesize/test_codesize_files_wasmfs.funcs index f623e63db651d..c1cc7ba6982bd 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.funcs +++ b/test/other/codesize/test_codesize_files_wasmfs.funcs @@ -22,15 +22,12 @@ $__cxxabiv1::__vmi_class_type_info::has_unambiguous_public_base\28__cxxabiv1::__ $__cxxabiv1::__vmi_class_type_info::search_above_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20void\20const*\2c\20int\2c\20bool\29\20const $__cxxabiv1::__vmi_class_type_info::search_below_dst\28__cxxabiv1::__dynamic_cast_info*\2c\20void\20const*\2c\20int\2c\20bool\29\20const $__lockfile -$__memcpy -$__memset $__pthread_mutex_lock $__throw_bad_alloc_shim\28\29 $__unlockfile $__wasm_call_ctors $abort $abort_message -$char*\20std::__2::__constexpr_memmove\5babi:nn190106\5d\28char*\2c\20char\20const*\2c\20std::__2::__element_count\29 $decltype\28auto\29\20std::__2::__variant_detail::__visitation::__base::__dispatcher<0ul>::__dispatch\5babi:nn190106\5d>\2c\20int>\2c\20\28std::__2::__variant_detail::_Trait\291>::__destroy\5babi:nn190106\5d\28\29::'lambda'\28auto&\29&&\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20std::__2::vector>\2c\20int>&>\28auto\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20std::__2::vector>\2c\20int>&\29 $decltype\28auto\29\20std::__2::__variant_detail::__visitation::__base::__dispatcher<1ul>::__dispatch\5babi:nn190106\5d>\2c\20\28std::__2::__variant_detail::_Trait\291>::__destroy\5babi:nn190106\5d\28\29::'lambda'\28auto&\29&&\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20long\2c\20std::__2::shared_ptr>&>\28auto\2c\20std::__2::__variant_detail::__base<\28std::__2::__variant_detail::_Trait\291\2c\20long\2c\20std::__2::shared_ptr>&\29 $dummy @@ -39,7 +36,6 @@ $fflush $is_equal\28std::type_info\20const*\2c\20std::type_info\20const*\2c\20bool\29 $main $memcmp -$memmove $operator\20delete\28void*\29 $operator\20new\28unsigned\20long\29 $pthread_mutex_init diff --git a/test/other/codesize/test_codesize_files_wasmfs.gzsize b/test/other/codesize/test_codesize_files_wasmfs.gzsize index 295764c17da68..72502b61b48f1 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_files_wasmfs.gzsize @@ -1 +1 @@ -2836 +2817 diff --git a/test/other/codesize/test_codesize_files_wasmfs.imports b/test/other/codesize/test_codesize_files_wasmfs.imports index 74ec884c2cde4..519a7e0d06403 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.imports +++ b/test/other/codesize/test_codesize_files_wasmfs.imports @@ -11,6 +11,5 @@ j (_wasmfs_get_preloaded_child_path) k (_wasmfs_get_num_preloaded_files) l (_wasmfs_get_num_preloaded_dirs) m (_wasmfs_copy_preloaded_file_data) -n (_emscripten_memcpy_js) -o (_abort_js) -p (random_get) +n (_abort_js) +o (random_get) diff --git a/test/other/codesize/test_codesize_files_wasmfs.jssize b/test/other/codesize/test_codesize_files_wasmfs.jssize index 53e0347a1984b..550c8b9aa3cfa 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.jssize +++ b/test/other/codesize/test_codesize_files_wasmfs.jssize @@ -1 +1 @@ -6083 +6050 diff --git a/test/other/codesize/test_codesize_files_wasmfs.sent b/test/other/codesize/test_codesize_files_wasmfs.sent index 74ec884c2cde4..519a7e0d06403 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.sent +++ b/test/other/codesize/test_codesize_files_wasmfs.sent @@ -11,6 +11,5 @@ j (_wasmfs_get_preloaded_child_path) k (_wasmfs_get_num_preloaded_files) l (_wasmfs_get_num_preloaded_dirs) m (_wasmfs_copy_preloaded_file_data) -n (_emscripten_memcpy_js) -o (_abort_js) -p (random_get) +n (_abort_js) +o (random_get) diff --git a/test/other/codesize/test_codesize_files_wasmfs.size b/test/other/codesize/test_codesize_files_wasmfs.size index 6167a7f4f4fb9..61a21c88ed6b8 100644 --- a/test/other/codesize/test_codesize_files_wasmfs.size +++ b/test/other/codesize/test_codesize_files_wasmfs.size @@ -1 +1 @@ -51011 +50049 diff --git a/test/other/codesize/test_codesize_hello_O0.funcs b/test/other/codesize/test_codesize_hello_O0.funcs index a1ff7c64739d8..accaa3d588d37 100644 --- a/test/other/codesize/test_codesize_hello_O0.funcs +++ b/test/other/codesize/test_codesize_hello_O0.funcs @@ -23,6 +23,7 @@ $__unlockfile $__vfprintf_internal $__wasi_syscall_ret $__wasm_call_ctors +$_emscripten_memcpy_bulkmem $_emscripten_stack_alloc $_emscripten_stack_restore $emscripten_stack_get_base diff --git a/test/other/codesize/test_codesize_hello_O0.gzsize b/test/other/codesize/test_codesize_hello_O0.gzsize index b1449acbaabed..ffd7b3d6e32c8 100644 --- a/test/other/codesize/test_codesize_hello_O0.gzsize +++ b/test/other/codesize/test_codesize_hello_O0.gzsize @@ -1 +1 @@ -7913 +7883 diff --git a/test/other/codesize/test_codesize_hello_O0.imports b/test/other/codesize/test_codesize_hello_O0.imports index caa640aadbb19..de07703175666 100644 --- a/test/other/codesize/test_codesize_hello_O0.imports +++ b/test/other/codesize/test_codesize_hello_O0.imports @@ -1,2 +1 @@ -env._emscripten_memcpy_js wasi_snapshot_preview1.fd_write diff --git a/test/other/codesize/test_codesize_hello_O0.jssize b/test/other/codesize/test_codesize_hello_O0.jssize index 9ca615af52eb8..be8a9dce3d78c 100644 --- a/test/other/codesize/test_codesize_hello_O0.jssize +++ b/test/other/codesize/test_codesize_hello_O0.jssize @@ -1 +1 @@ -21045 +20983 diff --git a/test/other/codesize/test_codesize_hello_O0.sent b/test/other/codesize/test_codesize_hello_O0.sent index 60fe5feb789b6..4fa386c695da8 100644 --- a/test/other/codesize/test_codesize_hello_O0.sent +++ b/test/other/codesize/test_codesize_hello_O0.sent @@ -1,2 +1 @@ -_emscripten_memcpy_js fd_write diff --git a/test/other/codesize/test_codesize_hello_O0.size b/test/other/codesize/test_codesize_hello_O0.size index 5e161ac666248..96b0a1d19abf4 100644 --- a/test/other/codesize/test_codesize_hello_O0.size +++ b/test/other/codesize/test_codesize_hello_O0.size @@ -1 +1 @@ -15087 +15113 diff --git a/test/other/codesize/test_codesize_hello_O1.funcs b/test/other/codesize/test_codesize_hello_O1.funcs index 68623ee907e22..79df2037ea380 100644 --- a/test/other/codesize/test_codesize_hello_O1.funcs +++ b/test/other/codesize/test_codesize_hello_O1.funcs @@ -11,6 +11,7 @@ $__towrite $__unlockfile $__wasi_syscall_ret $__wasm_call_ctors +$_emscripten_memcpy_bulkmem $_emscripten_stack_alloc $_emscripten_stack_restore $emscripten_stack_get_current diff --git a/test/other/codesize/test_codesize_hello_O1.gzsize b/test/other/codesize/test_codesize_hello_O1.gzsize index 8933964377fbf..9e4687c072b66 100644 --- a/test/other/codesize/test_codesize_hello_O1.gzsize +++ b/test/other/codesize/test_codesize_hello_O1.gzsize @@ -1 +1 @@ -2694 +2658 diff --git a/test/other/codesize/test_codesize_hello_O1.imports b/test/other/codesize/test_codesize_hello_O1.imports index caa640aadbb19..de07703175666 100644 --- a/test/other/codesize/test_codesize_hello_O1.imports +++ b/test/other/codesize/test_codesize_hello_O1.imports @@ -1,2 +1 @@ -env._emscripten_memcpy_js wasi_snapshot_preview1.fd_write diff --git a/test/other/codesize/test_codesize_hello_O1.jssize b/test/other/codesize/test_codesize_hello_O1.jssize index a25b0436b3627..1be5e3f4c2ddc 100644 --- a/test/other/codesize/test_codesize_hello_O1.jssize +++ b/test/other/codesize/test_codesize_hello_O1.jssize @@ -1 +1 @@ -6899 +6837 diff --git a/test/other/codesize/test_codesize_hello_O1.sent b/test/other/codesize/test_codesize_hello_O1.sent index 60fe5feb789b6..4fa386c695da8 100644 --- a/test/other/codesize/test_codesize_hello_O1.sent +++ b/test/other/codesize/test_codesize_hello_O1.sent @@ -1,2 +1 @@ -_emscripten_memcpy_js fd_write diff --git a/test/other/codesize/test_codesize_hello_O1.size b/test/other/codesize/test_codesize_hello_O1.size index d061229a5f7d6..74f61fc759e9d 100644 --- a/test/other/codesize/test_codesize_hello_O1.size +++ b/test/other/codesize/test_codesize_hello_O1.size @@ -1 +1 @@ -2655 +2671 diff --git a/test/other/codesize/test_codesize_hello_O2.gzsize b/test/other/codesize/test_codesize_hello_O2.gzsize index 773f46ded04e7..ed5edbf7f250d 100644 --- a/test/other/codesize/test_codesize_hello_O2.gzsize +++ b/test/other/codesize/test_codesize_hello_O2.gzsize @@ -1 +1 @@ -2356 +2320 diff --git a/test/other/codesize/test_codesize_hello_O2.imports b/test/other/codesize/test_codesize_hello_O2.imports index caa640aadbb19..de07703175666 100644 --- a/test/other/codesize/test_codesize_hello_O2.imports +++ b/test/other/codesize/test_codesize_hello_O2.imports @@ -1,2 +1 @@ -env._emscripten_memcpy_js wasi_snapshot_preview1.fd_write diff --git a/test/other/codesize/test_codesize_hello_O2.jssize b/test/other/codesize/test_codesize_hello_O2.jssize index 7e8c8fed96c82..7f776c653b31c 100644 --- a/test/other/codesize/test_codesize_hello_O2.jssize +++ b/test/other/codesize/test_codesize_hello_O2.jssize @@ -1 +1 @@ -4831 +4778 diff --git a/test/other/codesize/test_codesize_hello_O2.sent b/test/other/codesize/test_codesize_hello_O2.sent index 60fe5feb789b6..4fa386c695da8 100644 --- a/test/other/codesize/test_codesize_hello_O2.sent +++ b/test/other/codesize/test_codesize_hello_O2.sent @@ -1,2 +1 @@ -_emscripten_memcpy_js fd_write diff --git a/test/other/codesize/test_codesize_hello_O2.size b/test/other/codesize/test_codesize_hello_O2.size index d644427299908..ede5ca4172efa 100644 --- a/test/other/codesize/test_codesize_hello_O2.size +++ b/test/other/codesize/test_codesize_hello_O2.size @@ -1 +1 @@ -1999 +1975 diff --git a/test/other/codesize/test_codesize_hello_O3.exports b/test/other/codesize/test_codesize_hello_O3.exports index 99502013435fa..a88ed67232916 100644 --- a/test/other/codesize/test_codesize_hello_O3.exports +++ b/test/other/codesize/test_codesize_hello_O3.exports @@ -1,4 +1,4 @@ -c (memory) -d (__wasm_call_ctors) -e (main) -f (__indirect_function_table) +b (memory) +c (__wasm_call_ctors) +d (main) +e (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_hello_O3.gzsize b/test/other/codesize/test_codesize_hello_O3.gzsize index 19697800ce696..24ff55f1588d7 100644 --- a/test/other/codesize/test_codesize_hello_O3.gzsize +++ b/test/other/codesize/test_codesize_hello_O3.gzsize @@ -1 +1 @@ -2297 +2278 diff --git a/test/other/codesize/test_codesize_hello_O3.imports b/test/other/codesize/test_codesize_hello_O3.imports index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_O3.imports +++ b/test/other/codesize/test_codesize_hello_O3.imports @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_O3.jssize b/test/other/codesize/test_codesize_hello_O3.jssize index 3658ed8053766..4f652d136a346 100644 --- a/test/other/codesize/test_codesize_hello_O3.jssize +++ b/test/other/codesize/test_codesize_hello_O3.jssize @@ -1 +1 @@ -4753 +4720 diff --git a/test/other/codesize/test_codesize_hello_O3.sent b/test/other/codesize/test_codesize_hello_O3.sent index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_O3.sent +++ b/test/other/codesize/test_codesize_hello_O3.sent @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_O3.size b/test/other/codesize/test_codesize_hello_O3.size index 173a6680f8970..b0539e90d9ac1 100644 --- a/test/other/codesize/test_codesize_hello_O3.size +++ b/test/other/codesize/test_codesize_hello_O3.size @@ -1 +1 @@ -1737 +1735 diff --git a/test/other/codesize/test_codesize_hello_Os.exports b/test/other/codesize/test_codesize_hello_Os.exports index 99502013435fa..a88ed67232916 100644 --- a/test/other/codesize/test_codesize_hello_Os.exports +++ b/test/other/codesize/test_codesize_hello_Os.exports @@ -1,4 +1,4 @@ -c (memory) -d (__wasm_call_ctors) -e (main) -f (__indirect_function_table) +b (memory) +c (__wasm_call_ctors) +d (main) +e (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_hello_Os.gzsize b/test/other/codesize/test_codesize_hello_Os.gzsize index 19697800ce696..24ff55f1588d7 100644 --- a/test/other/codesize/test_codesize_hello_Os.gzsize +++ b/test/other/codesize/test_codesize_hello_Os.gzsize @@ -1 +1 @@ -2297 +2278 diff --git a/test/other/codesize/test_codesize_hello_Os.imports b/test/other/codesize/test_codesize_hello_Os.imports index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_Os.imports +++ b/test/other/codesize/test_codesize_hello_Os.imports @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_Os.jssize b/test/other/codesize/test_codesize_hello_Os.jssize index 3658ed8053766..4f652d136a346 100644 --- a/test/other/codesize/test_codesize_hello_Os.jssize +++ b/test/other/codesize/test_codesize_hello_Os.jssize @@ -1 +1 @@ -4753 +4720 diff --git a/test/other/codesize/test_codesize_hello_Os.sent b/test/other/codesize/test_codesize_hello_Os.sent index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_Os.sent +++ b/test/other/codesize/test_codesize_hello_Os.sent @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_Os.size b/test/other/codesize/test_codesize_hello_Os.size index 54c9fc81b32d0..921f45ad4bffa 100644 --- a/test/other/codesize/test_codesize_hello_Os.size +++ b/test/other/codesize/test_codesize_hello_Os.size @@ -1 +1 @@ -1728 +1726 diff --git a/test/other/codesize/test_codesize_hello_Oz.size b/test/other/codesize/test_codesize_hello_Oz.size index b151ec96e078d..39eb8283b0002 100644 --- a/test/other/codesize/test_codesize_hello_Oz.size +++ b/test/other/codesize/test_codesize_hello_Oz.size @@ -1 +1 @@ -1286 +1261 diff --git a/test/other/codesize/test_codesize_hello_dylink.gzsize b/test/other/codesize/test_codesize_hello_dylink.gzsize index 20b75178d80e5..06d0b728023d8 100644 --- a/test/other/codesize/test_codesize_hello_dylink.gzsize +++ b/test/other/codesize/test_codesize_hello_dylink.gzsize @@ -1 +1 @@ -6026 +5992 diff --git a/test/other/codesize/test_codesize_hello_dylink.imports b/test/other/codesize/test_codesize_hello_dylink.imports index c986c46c080b2..ed7c6d9be94fb 100644 --- a/test/other/codesize/test_codesize_hello_dylink.imports +++ b/test/other/codesize/test_codesize_hello_dylink.imports @@ -3,7 +3,6 @@ env.__indirect_function_table env.__memory_base env.__stack_pointer env.__table_base -env._emscripten_memcpy_js env.emscripten_resize_heap env.memory wasi_snapshot_preview1.fd_write diff --git a/test/other/codesize/test_codesize_hello_dylink.jssize b/test/other/codesize/test_codesize_hello_dylink.jssize index 0d9eaaec75df0..c19262676f100 100644 --- a/test/other/codesize/test_codesize_hello_dylink.jssize +++ b/test/other/codesize/test_codesize_hello_dylink.jssize @@ -1 +1 @@ -13316 +13241 diff --git a/test/other/codesize/test_codesize_hello_dylink.sent b/test/other/codesize/test_codesize_hello_dylink.sent index 01672c0ec979f..1ca2e37d90365 100644 --- a/test/other/codesize/test_codesize_hello_dylink.sent +++ b/test/other/codesize/test_codesize_hello_dylink.sent @@ -3,7 +3,6 @@ __indirect_function_table __memory_base __stack_pointer __table_base -_emscripten_memcpy_js emscripten_resize_heap fd_write memory diff --git a/test/other/codesize/test_codesize_hello_dylink.size b/test/other/codesize/test_codesize_hello_dylink.size index e95ec6103f385..c7549e4708ae6 100644 --- a/test/other/codesize/test_codesize_hello_dylink.size +++ b/test/other/codesize/test_codesize_hello_dylink.size @@ -1 +1 @@ -9736 +9712 diff --git a/test/other/codesize/test_codesize_hello_wasmfs.exports b/test/other/codesize/test_codesize_hello_wasmfs.exports index 99502013435fa..a88ed67232916 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.exports +++ b/test/other/codesize/test_codesize_hello_wasmfs.exports @@ -1,4 +1,4 @@ -c (memory) -d (__wasm_call_ctors) -e (main) -f (__indirect_function_table) +b (memory) +c (__wasm_call_ctors) +d (main) +e (__indirect_function_table) diff --git a/test/other/codesize/test_codesize_hello_wasmfs.gzsize b/test/other/codesize/test_codesize_hello_wasmfs.gzsize index 19697800ce696..24ff55f1588d7 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.gzsize +++ b/test/other/codesize/test_codesize_hello_wasmfs.gzsize @@ -1 +1 @@ -2297 +2278 diff --git a/test/other/codesize/test_codesize_hello_wasmfs.imports b/test/other/codesize/test_codesize_hello_wasmfs.imports index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.imports +++ b/test/other/codesize/test_codesize_hello_wasmfs.imports @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_wasmfs.jssize b/test/other/codesize/test_codesize_hello_wasmfs.jssize index 3658ed8053766..4f652d136a346 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.jssize +++ b/test/other/codesize/test_codesize_hello_wasmfs.jssize @@ -1 +1 @@ -4753 +4720 diff --git a/test/other/codesize/test_codesize_hello_wasmfs.sent b/test/other/codesize/test_codesize_hello_wasmfs.sent index 747be6c703000..6da83238cc224 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.sent +++ b/test/other/codesize/test_codesize_hello_wasmfs.sent @@ -1,2 +1 @@ a (fd_write) -b (_emscripten_memcpy_js) diff --git a/test/other/codesize/test_codesize_hello_wasmfs.size b/test/other/codesize/test_codesize_hello_wasmfs.size index 173a6680f8970..b0539e90d9ac1 100644 --- a/test/other/codesize/test_codesize_hello_wasmfs.size +++ b/test/other/codesize/test_codesize_hello_wasmfs.size @@ -1 +1 @@ -1737 +1735 diff --git a/test/other/codesize/test_codesize_libcxxabi_message_O3.size b/test/other/codesize/test_codesize_libcxxabi_message_O3.size index c17e934b51c1f..29d6383b52c13 100644 --- a/test/other/codesize/test_codesize_libcxxabi_message_O3.size +++ b/test/other/codesize/test_codesize_libcxxabi_message_O3.size @@ -1 +1 @@ -97 +100 diff --git a/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.size b/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.size index eec49411b8413..3af99eeec11bb 100644 --- a/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.size +++ b/test/other/codesize/test_codesize_libcxxabi_message_O3_standalone.size @@ -1 +1 @@ -177 +180 diff --git a/test/other/codesize/test_codesize_mem_O3.size b/test/other/codesize/test_codesize_mem_O3.size index 2c9122f5b758b..ce94be3b6ea28 100644 --- a/test/other/codesize/test_codesize_mem_O3.size +++ b/test/other/codesize/test_codesize_mem_O3.size @@ -1 +1 @@ -5288 +5291 diff --git a/test/other/codesize/test_codesize_mem_O3_grow.size b/test/other/codesize/test_codesize_mem_O3_grow.size index 82758ce061e87..3ae79a93ab2b2 100644 --- a/test/other/codesize/test_codesize_mem_O3_grow.size +++ b/test/other/codesize/test_codesize_mem_O3_grow.size @@ -1 +1 @@ -5289 +5292 diff --git a/test/other/codesize/test_codesize_mem_O3_grow_standalone.size b/test/other/codesize/test_codesize_mem_O3_grow_standalone.size index a0096d7853f16..d9ab575e0e703 100644 --- a/test/other/codesize/test_codesize_mem_O3_grow_standalone.size +++ b/test/other/codesize/test_codesize_mem_O3_grow_standalone.size @@ -1 +1 @@ -5612 +5615 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone.size b/test/other/codesize/test_codesize_mem_O3_standalone.size index b7b57d282909f..b1fe233b1092f 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone.size +++ b/test/other/codesize/test_codesize_mem_O3_standalone.size @@ -1 +1 @@ -5537 +5540 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_lib.size b/test/other/codesize/test_codesize_mem_O3_standalone_lib.size index 25db995aa2569..554553b353b9b 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_lib.size +++ b/test/other/codesize/test_codesize_mem_O3_standalone_lib.size @@ -1 +1 @@ -5300 +5303 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_narg.size b/test/other/codesize/test_codesize_mem_O3_standalone_narg.size index e650e5aa24adc..66ff790e932f6 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_narg.size +++ b/test/other/codesize/test_codesize_mem_O3_standalone_narg.size @@ -1 +1 @@ -5330 +5333 diff --git a/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.size b/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.size index bcfe4e9786b14..d5cf5c28b6a26 100644 --- a/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.size +++ b/test/other/codesize/test_codesize_mem_O3_standalone_narg_flto.size @@ -1 +1 @@ -4138 +4141 diff --git a/test/other/codesize/test_codesize_minimal_O0.size b/test/other/codesize/test_codesize_minimal_O0.size index 7061465351498..5fcff9ffbf46d 100644 --- a/test/other/codesize/test_codesize_minimal_O0.size +++ b/test/other/codesize/test_codesize_minimal_O0.size @@ -1 +1 @@ -1125 +1156 diff --git a/test/other/codesize/test_codesize_minimal_O1.size b/test/other/codesize/test_codesize_minimal_O1.size index 29aae8eeca636..2b20fd09737d6 100644 --- a/test/other/codesize/test_codesize_minimal_O1.size +++ b/test/other/codesize/test_codesize_minimal_O1.size @@ -1 +1 @@ -418 +449 diff --git a/test/other/codesize/test_codesize_minimal_pthreads.size b/test/other/codesize/test_codesize_minimal_pthreads.size index 59501bf076992..0f60aa5d0b843 100644 --- a/test/other/codesize/test_codesize_minimal_pthreads.size +++ b/test/other/codesize/test_codesize_minimal_pthreads.size @@ -1 +1 @@ -19448 +19405 diff --git a/test/other/test_INCOMING_MODULE_JS_API.js.size b/test/other/test_INCOMING_MODULE_JS_API.js.size index 8151f378a5913..3dc49aa04aae0 100644 --- a/test/other/test_INCOMING_MODULE_JS_API.js.size +++ b/test/other/test_INCOMING_MODULE_JS_API.js.size @@ -1 +1 @@ -3766 +3733 diff --git a/test/other/test_unoptimized_code_size.js.size b/test/other/test_unoptimized_code_size.js.size index a0fed1c48a5f1..a9abb660fbe9c 100644 --- a/test/other/test_unoptimized_code_size.js.size +++ b/test/other/test_unoptimized_code_size.js.size @@ -1 +1 @@ -52898 +52739 diff --git a/test/other/test_unoptimized_code_size.wasm.size b/test/other/test_unoptimized_code_size.wasm.size index 5e161ac666248..96b0a1d19abf4 100644 --- a/test/other/test_unoptimized_code_size.wasm.size +++ b/test/other/test_unoptimized_code_size.wasm.size @@ -1 +1 @@ -15087 +15113 diff --git a/test/other/test_unoptimized_code_size_no_asserts.js.size b/test/other/test_unoptimized_code_size_no_asserts.js.size index eaeedc1a5532b..918c9c91947b0 100644 --- a/test/other/test_unoptimized_code_size_no_asserts.js.size +++ b/test/other/test_unoptimized_code_size_no_asserts.js.size @@ -1 +1 @@ -28646 +28487 diff --git a/test/other/test_unoptimized_code_size_no_asserts.wasm.size b/test/other/test_unoptimized_code_size_no_asserts.wasm.size index 3b081b1eeb5dc..59029a8227a5f 100644 --- a/test/other/test_unoptimized_code_size_no_asserts.wasm.size +++ b/test/other/test_unoptimized_code_size_no_asserts.wasm.size @@ -1 +1 @@ -12168 +12194 diff --git a/test/other/test_unoptimized_code_size_strict.js.size b/test/other/test_unoptimized_code_size_strict.js.size index 185191061e0f4..8a03cbf8f27f0 100644 --- a/test/other/test_unoptimized_code_size_strict.js.size +++ b/test/other/test_unoptimized_code_size_strict.js.size @@ -1 +1 @@ -51681 +51522 diff --git a/test/other/test_unoptimized_code_size_strict.wasm.size b/test/other/test_unoptimized_code_size_strict.wasm.size index 5e161ac666248..96b0a1d19abf4 100644 --- a/test/other/test_unoptimized_code_size_strict.wasm.size +++ b/test/other/test_unoptimized_code_size_strict.wasm.size @@ -1 +1 @@ -15087 +15113 diff --git a/test/test_core.py b/test/test_core.py index d3269cd3f816e..fd5076d4e026f 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -7807,7 +7807,7 @@ def get_dwarf_addr(line, col): # Get the wat, printing with -g which has binary offsets wat = self.run_process([Path(building.get_binaryen_bin(), 'wasm-opt'), - wasm_filename, '-g', '--print'], stdout=PIPE).stdout + wasm_filename, '-g', '--print', '-all'], stdout=PIPE).stdout # We expect to see a pattern like this in optimized builds (there isn't # much that can change with such calls to JS (they can't be reordered or diff --git a/test/test_other.py b/test/test_other.py index 7708c4ecdd1c8..879865606d0e9 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -10422,7 +10422,10 @@ def test_wasm_features_section(self, args): self.verify_custom_sec_existence('a.out.wasm', 'target_features', False) def test_wasm_features(self): - # Test that wasm features are explicitly enabled or disabled based on target engine version + # Test that wasm features are explicitly enabled or disabled based on + # target engine version. Here we are reading the features section and + # trusting that LLVM and/or Binaryen faithfully represent what features + # are used def verify_features_sec(feature, expect_in, linked=False): with webassembly.Module('a.out.wasm' if linked else 'hello_world.o') as module: features = module.get_target_features() @@ -10441,7 +10444,7 @@ def compile(flags): self.run_process([EMCC, test_file('hello_world.c')] + flags) compile(['-c']) - verify_features_sec('bulk-memory', False) + verify_features_sec('bulk-memory', True) verify_features_sec('nontrapping-fptoint', True) verify_features_sec('sign-ext', True) verify_features_sec('mutable-globals', True) @@ -10451,35 +10454,35 @@ def compile(flags): # Disable a feature compile(['-mno-sign-ext', '-c']) verify_features_sec('sign-ext', False) - # Disabling overrides default browser versions + # Disable via browser selection + compile(['-sMIN_FIREFOX_VERSION=61']) + verify_features_sec_linked('sign-ext', False) + # Flag disabling overrides default browser versions compile(['-mno-sign-ext']) verify_features_sec_linked('sign-ext', False) - # Disabling overrides manual browser versions + # Flag disabling overrides explicit browser version compile(['-sMIN_SAFARI_VERSION=150000', '-mno-sign-ext']) - # Disable via browser selection - compile(['-sMIN_FIREFOX_VERSION=61']) verify_features_sec_linked('sign-ext', False) - # Manual enable overrides browser version + # Flag enabling overrides explicit browser version compile(['-sMIN_FIREFOX_VERSION=61', '-msign-ext']) verify_features_sec_linked('sign-ext', True) + # Flag disabling overrides explicit version for bulk memory + compile(['-sMIN_SAFARI_VERSION=150000', '-mno-bulk-memory']) + verify_features_sec_linked('bulk-memory-opt', False) - compile(['-mno-nontrapping-fptoint']) + # TODO(https://github.com/emscripten-core/emscripten/issues/23184) set this back to 14.1 + # Also the section below can be deleted/updated once the default is 15.1 + compile(['-sMIN_SAFARI_VERSION=140000']) + verify_features_sec_linked('bulk-memory-opt', False) verify_features_sec_linked('nontrapping-fptoint', False) - # Setting this SAFARI_VERSION should enable bulk memory because it links in emscripten_memcpy_bulkmem - # However it does not enable nontrapping-fptoint yet because it has no effect at compile time and - # no libraries include nontrapping yet. compile(['-sMIN_SAFARI_VERSION=150000']) verify_features_sec_linked('sign-ext', True) verify_features_sec_linked('mutable-globals', True) verify_features_sec_linked('multivalue', True) - verify_features_sec_linked('bulk-memory', True) + verify_features_sec_linked('bulk-memory-opt', True) verify_features_sec_linked('nontrapping-fptoint', True) - compile(['-sMIN_SAFARI_VERSION=150000', '-mno-bulk-memory']) - # -mno-bulk-memory at link time overrides MIN_SAFARI_VERSION - verify_features_sec_linked('bulk-memory', False) - def test_js_preprocess(self): # Use stderr rather than stdout here because stdout is redirected to the output JS file itself. create_file('lib.js', ''' @@ -13359,7 +13362,7 @@ def test_offset_convertor_plus_wasm2js(self): def test_standard_library_mapping(self): # Test the `-l` flags on the command line get mapped the correct libraries variant - libs = ['-lc', '-lbulkmemory', '-lcompiler_rt', '-lmalloc'] + libs = ['-lc', '-lcompiler_rt', '-lmalloc'] err = self.run_process([EMCC, test_file('hello_world.c'), '-pthread', '-nodefaultlibs', '-v'] + libs, stderr=PIPE).stderr # Check that the linker was run with `-mt` variants because `-pthread` was passed. @@ -14690,34 +14693,6 @@ def test_wasi_with_sjlj(self): self.set_setting('DEFAULT_TO_CXX') self.do_runf(test_file('core/test_longjmp.c'), emcc_args=self.get_emcc_args()) - def test_memops_bulk_memory(self): - self.emcc_args += ['--profiling-funcs', '-fno-builtin'] - - def run(args, expect_bulk_mem): - self.do_runf('other/test_memops_bulk_memory.c', emcc_args=args) - funcs = self.parse_wasm('test_memops_bulk_memory.wasm')[2] - js = read_file('test_memops_bulk_memory.js') - if expect_bulk_mem: - self.assertNotContained('_emscripten_memcpy_js', js) - self.assertIn('$_emscripten_memcpy_bulkmem', funcs) - else: - self.assertContained('_emscripten_memcpy_js', js) - self.assertNotIn('$_emscripten_memcpy_bulkmem', funcs) - - # By default we expect to find `_emscripten_memcpy_js` in the generaed JS - # and not to find the `emscripten_memcpy_bulkmem` function on the wasm - # side. - run([], expect_bulk_mem=False) - - # With bulk memory enabled we expect *not* to find it. - run(['-mbulk-memory'], expect_bulk_mem=True) - - run(['-mbulk-memory', '-mno-bulk-memory'], expect_bulk_mem=False) - - # -pthread implicitly enables bulk memory too. - self.setup_node_pthreads() - run(['-pthread'], expect_bulk_mem=True) - def test_memory_init_file_unsupported(self): err = self.expect_fail([EMCC, test_file('hello_world.c'), '--memory-init-file=1']) self.assertContained('error: --memory-init-file is no longer supported', err) @@ -14909,7 +14884,7 @@ def test_preload_module(self, args): @node_pthreads def test_standalone_whole_archive(self): - self.emcc_args += ['-sSTANDALONE_WASM', '-pthread', '-Wl,--whole-archive', '-lbulkmemory', '-lstandalonewasm', '-Wl,--no-whole-archive'] + self.emcc_args += ['-sSTANDALONE_WASM', '-pthread', '-Wl,--whole-archive', '-lstandalonewasm', '-Wl,--no-whole-archive'] self.do_runf('hello_world.c') @parameterized({ diff --git a/tools/feature_matrix.py b/tools/feature_matrix.py index 283c9e52f2c21..75d6872f28e17 100644 --- a/tools/feature_matrix.py +++ b/tools/feature_matrix.py @@ -53,16 +53,19 @@ class Feature(IntEnum): 'chrome': 74, 'firefox': 62, 'safari': 140100, + 'node': 120000, }, Feature.BULK_MEMORY: { 'chrome': 75, 'firefox': 79, - 'safari': 150000, + 'safari': 140100, # TODO: Reset this to 150000 when we update the default. + 'node': 130000, }, Feature.MUTABLE_GLOBALS: { 'chrome': 74, 'firefox': 61, 'safari': 120000, + 'node': 120000, }, Feature.JS_BIGINT_INTEGRATION: { 'chrome': 67, @@ -74,6 +77,7 @@ class Feature(IntEnum): 'chrome': 74, 'firefox': 79, 'safari': 140100, + 'node': 160400, }, Feature.GLOBALTHIS: { 'chrome': 71, @@ -134,6 +138,13 @@ def enable_feature(feature, reason, override=False): if settings[name] < min_version: if name in user_settings: # If the user explicitly chose an older version we issue a warning. + if name == 'MIN_SAFARI_VERSION' and reason == 'pthreads': + # But as a special case, don't warn when forcing on bulk memory on Safari. + # This is because Safari implemented part of bulk memory along with threads in 14.1, + # but not all of it. So bulk-mem is listed as supported in 15.0. So we want to + # continue enabling bulk memory via pthreads without a warning in 14.1, but without + # enabling other features requiring 15.0. + continue diagnostics.warning( 'compatibility', f'{name}={user_settings[name]} is not compatible with {reason} ' @@ -160,6 +171,8 @@ def apply_min_browser_versions(): if settings.PTHREADS: enable_feature(Feature.THREADS, 'pthreads') enable_feature(Feature.BULK_MEMORY, 'pthreads') + elif settings.WASM_WORKERS or settings.SHARED_MEMORY: + enable_feature(Feature.BULK_MEMORY, 'shared-mem') if settings.AUDIO_WORKLET: enable_feature(Feature.GLOBALTHIS, 'AUDIO_WORKLET') if settings.MEMORY64 == 1: diff --git a/tools/link.py b/tools/link.py index b8e7042dcde00..6bf9b2abc8573 100644 --- a/tools/link.py +++ b/tools/link.py @@ -342,7 +342,11 @@ def get_binaryen_passes(): passes += ['--signext-lowering'] # nontrapping-fp is enabled by default in llvm. Lower it away if requested. if not feature_matrix.caniuse(feature_matrix.Feature.NON_TRAPPING_FPTOINT): + logger.debug('lowering nontrapping-fp feature due to incompatible target browser engines') passes += ['--llvm-nontrapping-fptoint-lowering'] + if not feature_matrix.caniuse(feature_matrix.Feature.BULK_MEMORY): + logger.debug('lowering bulk-memory feature due to incompatible target browser engines') + passes += ['--llvm-memory-copy-fill-lowering'] if optimizing: passes += ['--post-emscripten'] if settings.SIDE_MODULE: diff --git a/tools/system_libs.py b/tools/system_libs.py index 5d3c4051ca711..efc2d6168c254 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -1047,6 +1047,7 @@ def get_libcall_files(self): other_files = files_in_path( path='system/lib/libc', filenames=['emscripten_memcpy.c', 'emscripten_memset.c', + 'emscripten_memcpy_bulkmem.S', 'emscripten_memset_bulkmem.S', 'emscripten_scan_stack.c', 'emscripten_get_heap_size.c', # needed by malloc 'emscripten_memmove.c']) @@ -1288,6 +1289,8 @@ def get_files(self): 'emscripten_memcpy.c', 'emscripten_memmove.c', 'emscripten_memset.c', + 'emscripten_memcpy_bulkmem.S', + 'emscripten_memset_bulkmem.S', 'emscripten_mmap.c', 'emscripten_scan_stack.c', 'emscripten_time.c', @@ -1389,17 +1392,6 @@ def can_use(self): not settings.LINKABLE and not os.environ.get('EMCC_FORCE_STDLIBS') -class libbulkmemory(MuslInternalLibrary, AsanInstrumentedLibrary): - name = 'libbulkmemory' - src_dir = 'system/lib/libc' - src_files = ['emscripten_memcpy.c', 'emscripten_memset.c', - 'emscripten_memcpy_bulkmem.S', 'emscripten_memset_bulkmem.S'] - cflags = ['-mbulk-memory'] - - def can_use(self): - return super(libbulkmemory, self).can_use() and settings.BULK_MEMORY - - class libprintf_long_double(libc): name = 'libprintf_long_double' cflags = ['-DEMSCRIPTEN_PRINTF_LONG_DOUBLE'] @@ -2210,9 +2202,6 @@ def get_files(self): filenames=['standalone.c', 'standalone_wasm_stdio.c', '__main_void.c']) - files += files_in_path( - path='system/lib/libc', - filenames=['emscripten_memcpy.c', 'emscripten_memset.c']) # It is more efficient to use JS methods for time, normally. files += files_in_path( path='system/lib/libc/musl/src/time', @@ -2370,8 +2359,6 @@ def add_sanitizer_libs(): if settings.SHRINK_LEVEL >= 2 and not settings.LINKABLE and \ not os.environ.get('EMCC_FORCE_STDLIBS'): add_library('libc_optz') - if settings.BULK_MEMORY: - add_library('libbulkmemory') if settings.STANDALONE_WASM: add_library('libstandalonewasm') if settings.ALLOW_UNIMPLEMENTED_SYSCALLS: