Skip to content

Commit 0694d4f

Browse files
committed
Merge remote-tracking branch 'origin/incoming' into node-pthreads
2 parents 5a7731d + 2d2442c commit 0694d4f

File tree

28 files changed

+488
-266
lines changed

28 files changed

+488
-266
lines changed

.circleci/config.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ commands:
2626
# persistent workspace and to avoid any confusion with the version
2727
# we are trying to test.
2828
rm -Rf emscripten
29-
echo "V8_ENGINE = '`pwd`/upstream/bin/d8'" >> ~/.emscripten
30-
echo "JS_ENGINES = [NODE_JS, V8_ENGINE]" >> ~/.emscripten
31-
echo "WASM_ENGINES = []" >> ~/.emscripten
3229
echo "import os" >> ~/.emscripten
30+
echo "V8_ENGINE = os.path.expanduser('~/.jsvu/v8')" >> ~/.emscripten
31+
echo "JS_ENGINES = [NODE_JS]" >> ~/.emscripten
32+
echo "if os.path.exists(V8_ENGINE): JS_ENGINES.append(V8_ENGINE)" >> ~/.emscripten
33+
echo "WASM_ENGINES = []" >> ~/.emscripten
3334
test -f ~/vms/wasmtime && echo "WASMTIME = os.path.expanduser(os.path.join('~', 'vms', 'wasmtime')) ; WASM_ENGINES.append(WASMTIME)" >> ~/.emscripten || true
3435
test -f ~/vms/wasmer && echo "WASMER = os.path.expanduser(os.path.join('~', 'vms', 'wasmer')) ; WASM_ENGINES.append(WASMER)" >> ~/.emscripten || true
3536
cd -
@@ -72,6 +73,7 @@ commands:
7273
- .emscripten_ports/
7374
- .emscripten
7475
- vms
76+
- .jsvu
7577
run-tests:
7678
description: "Runs emscripten tests"
7779
parameters:
@@ -392,6 +394,15 @@ jobs:
392394
wget https://github.com/CraneStation/wasmtime/releases/download/dev/wasmtime-dev-x86_64-linux.tar.xz
393395
tar -xf wasmtime-dev-x86_64-linux.tar.xz
394396
cp wasmtime-dev-x86_64-linux/wasmtime ~/vms
397+
- run:
398+
name: get v8
399+
command: |
400+
wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz
401+
tar -xf node-v12.13.0-linux-x64.tar.xz
402+
export PATH="`pwd`/node-v12.13.0-linux-x64/bin:${PATH}"
403+
npm install jsvu -g
404+
export PATH="${HOME}/.jsvu:${PATH}"
405+
jsvu --os=default --engines=v8
395406
- build-upstream
396407
test-upstream-wasm0:
397408
executor: bionic

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,3 +431,4 @@ a license to everyone to use it as detailed in LICENSE.)
431431
* Cesar Guirao Robles <[email protected]>
432432
* Mehdi Sabwat <[email protected]>
433433
* MinganMuon <[email protected]>
434+
* Osman Turan <[email protected]>

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ See docs/process.md for how version tagging works.
1717

1818
Current Trunk
1919
-------------
20+
21+
v1.39.1: 10/30/2019
22+
-------------------
2023
- Only MEMFS is included by default, others (NODEFS, IDBFS, WORKERFS, PROXYFS)
2124
must be linked in explicitly, using `-lnodefs.js`, `-lidbfs.js`',
2225
`-lworkerfs.js`, `-lproxyfs.js`. See #9645
2326

2427
v1.39.0: 10/18/2019
2528
-------------------
29+
- The emsdk defaults to the upstream backend (instead of fastcomp) from this
30+
release onward (but both backends are still fully supported).
2631
- Add support for overriding `.emscripten` config variables using environment
2732
variables. Any config variable `FOO` can be overridden by `EM_FOO` in the
2833
environment.

cmake/Modules/Platform/Emscripten.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
# It teaches CMake about the Emscripten compiler, so that CMake can generate makefiles
33
# from CMakeLists.txt that invoke emcc.
44

5-
# At the moment this required minimum version is not exact (i.e. we do not know of a feature that needs CMake 3.0.0 specifically)
6-
# It is possible that CMake 3.0.0 is too old and will not actually work. If you do find such a case, please report it at Emscripten
7-
# bug tracker to revise the minimum requirement. See also https://github.com/emscripten-core/emsdk/issues/108
8-
cmake_minimum_required(VERSION 3.0.0)
9-
105
# To use this toolchain file with CMake, invoke CMake with the following command line parameters
116
# cmake -DCMAKE_TOOLCHAIN_FILE=<EmscriptenRoot>/cmake/Modules/Platform/Emscripten.cmake
127
# -DCMAKE_BUILD_TYPE=<Debug|RelWithDebInfo|Release|MinSizeRel>

emcc.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,15 @@ def run(args):
526526
# An online HTML version (which may be of a different version of Emscripten)
527527
# is up at http://kripken.github.io/emscripten-site/docs/tools_reference/emcc.html
528528

529-
print('''%s
529+
with open(shared.path_from_root('site', 'build', 'text', 'docs', 'tools_reference', 'emcc.txt'), 'r') as f:
530+
print(f.read())
530531

532+
print('''
531533
------------------------------------------------------------------
532534
533535
emcc: supported targets: llvm bitcode, javascript, NOT elf
534536
(autoconf likes to see elf above to enable shared object support)
535-
''' % (open(shared.path_from_root('site', 'build', 'text', 'docs', 'tools_reference', 'emcc.txt')).read()))
537+
''')
536538
return 0
537539

538540
if '--version' in args:
@@ -1814,8 +1816,6 @@ def check_human_readable_list(items):
18141816
exit_with_error('STANDALONE_WASM is only available in the upstream wasm backend path')
18151817
if shared.Settings.USE_PTHREADS:
18161818
exit_with_error('STANDALONE_WASM does not support pthreads yet')
1817-
if shared.Settings.SIMD:
1818-
exit_with_error('STANDALONE_WASM does not support simd yet')
18191819
# the wasm must be runnable without the JS, so there cannot be anything that
18201820
# requires JS legalization
18211821
shared.Settings.LEGALIZE_JS_FFI = 0
@@ -1883,6 +1883,9 @@ def is_link_flag(flag):
18831883
return any(flag.startswith(x) for x in ('-l', '-L', '-Wl,'))
18841884

18851885
compile_args = [a for a in newargs if a and not is_link_flag(a)]
1886+
if '-fPIC' in compile_args and not shared.Settings.RELOCATABLE:
1887+
shared.warning('ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE')
1888+
compile_args.remove('-fPIC')
18861889

18871890
# Bitcode args generation code
18881891
def get_clang_command(input_files):
@@ -2996,10 +2999,10 @@ def do_binaryen(target, asm_target, options, memfile, wasm_binary_target,
29962999
options.binaryen_passes += ['--pass-arg=emscripten-sbrk-val@%d' % shared.Settings.DYNAMIC_BASE]
29973000
if DEBUG:
29983001
shared.safe_copy(wasm_binary_target, os.path.join(shared.get_emscripten_temp_dir(), os.path.basename(wasm_binary_target) + '.pre-byn'))
2999-
cmd = [os.path.join(binaryen_bin, 'wasm-opt'), wasm_binary_target, '-o', wasm_binary_target] + options.binaryen_passes
3000-
cmd += shared.Building.get_binaryen_feature_flags()
3001-
if intermediate_debug_info:
3002-
cmd += ['-g'] # preserve the debug info
3002+
cmd = shared.Building.get_wasm_opt_command(wasm_binary_target,
3003+
wasm_binary_target,
3004+
options.binaryen_passes,
3005+
debug=intermediate_debug_info)
30033006
if use_source_map(options):
30043007
cmd += ['--input-source-map=' + wasm_source_map_target]
30053008
cmd += ['--output-source-map=' + wasm_source_map_target]
@@ -3057,6 +3060,11 @@ def do_binaryen(target, asm_target, options, memfile, wasm_binary_target,
30573060
emitting_js=not target.endswith(WASM_ENDINGS))
30583061
save_intermediate_with_wasm('postclean', wasm_binary_target)
30593062

3063+
if shared.Settings.ASYNCIFY_LAZY_LOAD_CODE:
3064+
if not shared.Settings.ASYNCIFY:
3065+
exit_with_error('ASYNCIFY_LAZY_LOAD_CODE requires ASYNCIFY')
3066+
shared.Building.asyncify_lazy_load_code(wasm_binary_target, options, debug=intermediate_debug_info)
3067+
30603068
def run_closure_compiler(final):
30613069
final = shared.Building.closure_compiler(final, pretty=not optimizer.minify_whitespace,
30623070
extra_closure_args=options.closure_args)
@@ -3658,5 +3666,5 @@ def validate_arg_level(level_string, max_level, err_msg, clamp=False):
36583666
try:
36593667
sys.exit(run(sys.argv))
36603668
except KeyboardInterrupt:
3661-
logger.warning("KeyboardInterrupt")
3669+
logger.warning('KeyboardInterrupt')
36623670
sys.exit(1)

emranlib

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
#!/usr/bin/env python
2+
# Copyright 2019 The Emscripten Authors. All rights reserved.
3+
# Emscripten is available under two separate licenses, the MIT license and the
4+
# University of Illinois/NCSA Open Source License. Both these licenses can be
5+
# found in the LICENSE file.
26

3-
'''
4-
emcc - ranlib helper script
7+
8+
"""emranlib - ranlib helper script
59
===========================
610
711
This script acts as a frontend replacement for ranlib. See emcc.
8-
'''
12+
"""
13+
14+
15+
from __future__ import print_function
16+
import sys
17+
from tools import shared
18+
19+
def run():
20+
newargs = [shared.LLVM_RANLIB] + sys.argv[1:]
21+
return shared.run_process(newargs, stdin=sys.stdin, check=False).returncode
922

23+
if __name__ == '__main__':
24+
sys.exit(run())

emscripten-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"1.39.0"
1+
"1.39.1"

emscripten.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,10 +2225,11 @@ def emscript_wasm_backend(infile, outfile, memfile, compiler_engine,
22252225

22262226
asm_consts, asm_const_funcs = create_asm_consts_wasm(forwarded_json, metadata)
22272227
em_js_funcs = create_em_js(forwarded_json, metadata)
2228+
asm_const_pairs = ['%s: %s' % (key, value) for key, value in asm_consts]
2229+
asm_const_map = 'var ASM_CONSTS = {\n ' + ', \n '.join(asm_const_pairs) + '\n};\n'
22282230
pre = pre.replace(
22292231
'// === Body ===',
2230-
('// === Body ===\n\nvar ASM_CONSTS = [' +
2231-
',\n '.join(asm_consts) + '];\n' +
2232+
('// === Body ===\n\n' + asm_const_map +
22322233
asstr('\n'.join(asm_const_funcs)) +
22332234
'\n'.join(em_js_funcs) + '\n'))
22342235
pre = apply_table(pre)
@@ -2342,7 +2343,7 @@ def debug_copy(src, dst):
23422343

23432344

23442345
def create_asm_consts_wasm(forwarded_json, metadata):
2345-
asm_consts = [0] * len(metadata['asmConsts'])
2346+
asm_consts = {}
23462347
all_sigs = []
23472348
for k, v in metadata['asmConsts'].items():
23482349
const, sigs, call_types = v
@@ -2417,6 +2418,8 @@ def create_asm_consts_wasm(forwarded_json, metadata):
24172418
var args = readAsmConstArgs(sigPtr, argbuf);
24182419
return ASM_CONSTS[code].apply(null, args);
24192420
}''' % (const_name, preamble))
2421+
asm_consts = [(key, value) for key, value in asm_consts.items()]
2422+
asm_consts.sort()
24202423
return asm_consts, asm_const_funcs
24212424

24222425

0 commit comments

Comments
 (0)