diff --git a/.circleci/config.yml b/.circleci/config.yml index f6a3797d67cc0..3dfcd7c115dd8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -478,4 +478,3 @@ workflows: - test-upstream-browser-firefox: requires: - build-upstream - diff --git a/ChangeLog.md b/ChangeLog.md index d5df4997b4868..42a72c453b7d2 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -19,6 +19,9 @@ See docs/process.md for how version tagging works. Current Trunk ------------- + - LLVM backend pthread builds no longer use external memory initialization + files, replacing them with passive data segments. + v1.38.39: 07/16/2019 -------------------- - Add support for [address sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html). (#8884) diff --git a/emcc.py b/emcc.py index 69fb9be4c85e9..a78ee8c89b8c7 100755 --- a/emcc.py +++ b/emcc.py @@ -1438,16 +1438,17 @@ 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 = not shared.Settings.USE_PTHREADS + 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: diff --git a/tools/shared.py b/tools/shared.py index 58e68877e17ec..06d8ae80c842e 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -1848,6 +1848,7 @@ def link_lld(args, target, opts=[], lto_level=0): if Settings.USE_PTHREADS: cmd.append('--shared-memory') + cmd.append('--passive-segments') for a in Building.llvm_backend_args(): cmd += ['-mllvm', a]