diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-31 20:50:34 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-03 00:33:48 +0200 |
commit | 8d0158e08f0eb769c2208d23e46673f7cb705189 (patch) | |
tree | 20f79571a571c6681aae3ff175182bac412823b6 /testing/emscripten/binaryen-wasm-js-path.patch | |
parent | 14286b372051d27be543244666881f79198c0cbf (diff) | |
download | aports-8d0158e08f0eb769c2208d23e46673f7cb705189.tar.bz2 aports-8d0158e08f0eb769c2208d23e46673f7cb705189.tar.xz |
testing/emscripten: fix multiple issues
Diffstat (limited to 'testing/emscripten/binaryen-wasm-js-path.patch')
-rw-r--r-- | testing/emscripten/binaryen-wasm-js-path.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/testing/emscripten/binaryen-wasm-js-path.patch b/testing/emscripten/binaryen-wasm-js-path.patch new file mode 100644 index 0000000000..d2c7ab994a --- /dev/null +++ b/testing/emscripten/binaryen-wasm-js-path.patch @@ -0,0 +1,40 @@ +From: Jakub Jirutka <jakub@jirutka.cz> +Date: Sun, 02 Mar 2017 22:42:00 +0200 +Subject: [PATCH] Allow to specify path to wasm.js + +Add configuration variable BINARYEN_WASM_JS that allows to specify location of +the Binaryen's wasm.js file. + +--- a/emcc.py ++++ b/emcc.py +@@ -1282,6 +1282,11 @@ + shared.Settings.BINARYEN_ROOT = shared.BINARYEN_ROOT + except: + pass ++ if not shared.Settings.BINARYEN_WASM_JS: ++ try: ++ shared.Settings.BINARYEN_WASM_JS = shared.BINARYEN_WASM_JS ++ except: ++ shared.Settings.BINARYEN_WASM_JS = os.path.join(BINARYEN_ROOT, 'bin', 'wasm.js') + # default precise-f32 to on, since it works well in wasm + # also always use f32s when asm.js is not in the picture + if ('PRECISE_F32=0' not in settings_changes and 'PRECISE_F32=2' not in settings_changes) or 'asmjs' not in shared.Settings.BINARYEN_METHOD: +@@ -2110,7 +2115,7 @@ + # BINARYEN_METHOD with something that doesn't use the polyfill, then we don't need it. + if not shared.Settings.BINARYEN_METHOD or 'interpret' in shared.Settings.BINARYEN_METHOD: + logging.debug('integrating wasm.js polyfill interpreter') +- wasm_js = open(os.path.join(binaryen_bin, 'wasm.js')).read() ++ wasm_js = open(shared.Settings.BINARYEN_WASM_JS).read() + wasm_js = wasm_js.replace('EMSCRIPTEN_', 'emscripten_') # do not confuse the markers + js = open(js_target).read() + combined = open(js_target, 'w') +--- a/src/settings.js ++++ b/src/settings.js +@@ -709,6 +709,7 @@ + // required for all but the smallest modules to run in V8 + var BINARYEN_ROOT = ""; // Directory where we can find Binaryen. Will be automatically set for you, + // but you can set it to override if you are a Binaryen developer. ++var BINARYEN_WASM_JS = ""; // Path to the file wasm.js, the Binaryen components compiled to JavaScript. + + var WASM = 0; // Alias for BINARYEN, the two are identical. Both make us compile code to WebAssembly. + |