Merge pull request #34082 from akien-mga/emscripten-clamp-fastcomp

Emscripten: Re-add BINARYEN_TRAP_MODE='clamp' for fastcomp
This commit is contained in:
Rémi Verschelde 2019-12-03 15:00:58 +01:00 committed by GitHub
commit 52e2105e61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,6 +131,13 @@ def configure(env):
env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) env.Append(LINKFLAGS=['-s', 'BINARYEN=1'])
# This needs to be defined for Emscripten using 'fastcomp' (default pre-1.39.0)
# and undefined if using 'upstream'. And to make things simple, earlier
# Emscripten versions didn't include 'fastcomp' in their path, so we check
# against the presence of 'upstream' to conditionally add the flag.
if not "upstream" in em_config['EMSCRIPTEN_ROOT']:
env.Append(LINKFLAGS=['-s', 'BINARYEN_TRAP_MODE=\'clamp\''])
# Allow increasing memory buffer size during runtime. This is efficient # Allow increasing memory buffer size during runtime. This is efficient
# when using WebAssembly (in comparison to asm.js) and works well for # when using WebAssembly (in comparison to asm.js) and works well for
# us since we don't know requirements at compile-time. # us since we don't know requirements at compile-time.