From f58382cc14ee1d27c7fd966cab203e7ef9ddc8a7 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 12 Jul 2019 11:20:01 -0700 Subject: [PATCH 1/4] Use passive segments instead of mem files --- emcc.py | 2 +- tools/shared.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/emcc.py b/emcc.py index c5e9a16528dea..eaf90f979df65 100755 --- a/emcc.py +++ b/emcc.py @@ -1447,7 +1447,7 @@ def check(input_file): options.memory_init_file = True # we will include the mem init data in the wasm, when we don't need the # mem init file to be loadable by itself - shared.Settings.MEM_INIT_IN_WASM = not shared.Settings.USE_PTHREADS + shared.Settings.MEM_INIT_IN_WASM = True # WASM_ASYNC_COMPILATION and SWAPPABLE_ASM_MODULE do not have a meaning in MINIMAL_RUNTIME (always async) if not shared.Settings.MINIMAL_RUNTIME: diff --git a/tools/shared.py b/tools/shared.py index 58e68877e17ec..4bcc658912a19 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -1848,6 +1848,8 @@ def link_lld(args, target, opts=[], lto_level=0): if Settings.USE_PTHREADS: cmd.append('--shared-memory') + if not Settings.WASM2JS: + cmd.append('--passive-segments') for a in Building.llvm_backend_args(): cmd += ['-mllvm', a] From 8ca94e93a9e5bab41dbc8703224b65babc6a1b7b Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 12 Jul 2019 17:01:35 -0700 Subject: [PATCH 2/4] Changelog and new error + comments --- ChangeLog.md | 2 ++ emcc.py | 15 ++++++++------- tools/shared.py | 3 +-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 597540ae471bc..6d36ca894d9e8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -19,6 +19,8 @@ See docs/process.md for how version tagging works. Current Trunk ------------- + - LLVM backend pthread builds no longer use external memory initialization files + v1.38.38: 07/08/2019 -------------------- diff --git a/emcc.py b/emcc.py index eaf90f979df65..81f60eea8df70 100755 --- a/emcc.py +++ b/emcc.py @@ -1438,15 +1438,16 @@ def check(input_file): if any(s.startswith('MEM_INIT_METHOD=') for s in settings_changes): exit_with_error('MEM_INIT_METHOD is not supported in wasm. Memory will be embedded in the wasm binary if threads are not used, and included in a separate file if threads are used.') if shared.Settings.WASM2JS: - # in wasm2js, keep the mem init in the wasm itself if we can (no pthreads), and if the options - # wouldn't tell a js build to use a separate mem init file - shared.Settings.MEM_INIT_IN_WASM = not shared.Settings.USE_PTHREADS and not options.memory_init_file + # wasm2js does not support passive segments or atomics + if shared.Settings.USE_PTHREADS: + exit_with_error('WASM2JS does not yet support pthreads') + # in wasm2js, keep the mem init in the wasm itself if we can and if the + # options wouldn't tell a js build to use a separate mem init file + shared.Settings.MEM_INIT_IN_WASM = not options.memory_init_file else: - # wasm normally includes the mem init in the wasm binary. exceptions are pthreads, where we need - # to split it out until we have full bulk memory support, and wasm2js, which behaves more like js. + # wasm includes the mem init in the wasm binary. The exception is + # wasm2js, which behaves more like js. options.memory_init_file = True - # we will include the mem init data in the wasm, when we don't need the - # mem init file to be loadable by itself shared.Settings.MEM_INIT_IN_WASM = True # WASM_ASYNC_COMPILATION and SWAPPABLE_ASM_MODULE do not have a meaning in MINIMAL_RUNTIME (always async) diff --git a/tools/shared.py b/tools/shared.py index 4bcc658912a19..06d8ae80c842e 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -1848,8 +1848,7 @@ def link_lld(args, target, opts=[], lto_level=0): if Settings.USE_PTHREADS: cmd.append('--shared-memory') - if not Settings.WASM2JS: - cmd.append('--passive-segments') + cmd.append('--passive-segments') for a in Building.llvm_backend_args(): cmd += ['-mllvm', a] From 988e700a6e0620681097590cf35655e3e131e8bc Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 12 Jul 2019 19:47:49 -0700 Subject: [PATCH 3/4] Update FireFox version to get bulk memory support --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b77b0b75a000d..496e2362f9674 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ test-firefox: &test-firefox - run: name: download firefox command: | - FF_VERSION=65.0.2 + FF_VERSION=69.0b4 wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FF_VERSION/linux-x86_64/en-US/firefox-$FF_VERSION.tar.bz2 tar xf firefox-$FF_VERSION.tar.bz2 # wget -O nightly.tar.bz2 "https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US" @@ -474,4 +474,3 @@ workflows: - test-upstream-browser-firefox: requires: - build-upstream - From 2ccc7c0b72e2ffe33faa31b468412dae2d8e33fa Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 15 Jul 2019 17:39:20 -0700 Subject: [PATCH 4/4] Unbreak fastcomp --- ChangeLog.md | 3 ++- emcc.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index fdc14c532bae3..c6fa02fd39538 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -21,7 +21,8 @@ Current Trunk - Add support for [address sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html). (#8884) - Currently, only supports one thread without dynamic linking. - - LLVM backend pthread builds no longer use external memory initialization files + - LLVM backend pthread builds no longer use external memory initialization + files, replacing them with passive data segments. v1.38.38: 07/08/2019 -------------------- diff --git a/emcc.py b/emcc.py index 946da225f7b9d..e994b390b77b8 100755 --- a/emcc.py +++ b/emcc.py @@ -1448,7 +1448,7 @@ def check(input_file): # wasm includes the mem init in the wasm binary. The exception is # wasm2js, which behaves more like js. options.memory_init_file = True - shared.Settings.MEM_INIT_IN_WASM = True + shared.Settings.MEM_INIT_IN_WASM = True if shared.Settings.WASM_BACKEND else not shared.Settings.USE_PTHREADS # WASM_ASYNC_COMPILATION and SWAPPABLE_ASM_MODULE do not have a meaning in MINIMAL_RUNTIME (always async) if not shared.Settings.MINIMAL_RUNTIME: