@@ -106,7 +106,8 @@ def exit_with_error(message):
106106
107107class Intermediate (object ):
108108 counter = 0
109- # this method uses the global 'final' variable, which contains the current
109+
110+ # this function uses the global 'final' variable, which contains the current
110111# final output file. if a method alters final, and calls this method, then it
111112# must modify final globally (i.e. it can't receive final as a param and
112113# return it)
@@ -119,6 +120,7 @@ def save_intermediate(name=None, suffix='js'):
119120 return
120121 shutil .copyfile (final , name )
121122 Intermediate .counter += 1
123+
122124def save_intermediate_with_wasm (name , wasm_binary ):
123125 save_intermediate (name ) # save the js
124126 name = os .path .join (shared .get_emscripten_temp_dir (), 'emcc-%d-%s.wasm' % (Intermediate .counter - 1 , name ))
@@ -2297,6 +2299,7 @@ def do_binaryen(target, asm_target, options, memfile, wasm_binary_target,
22972299 global final
22982300 logging .debug ('using binaryen, with method: ' + shared .Settings .BINARYEN_METHOD )
22992301 binaryen_bin = shared .Building .get_binaryen_bin ()
2302+ binaryen_lib = shared .Building .get_binaryen_lib ()
23002303 # Emit wasm.js at the top of the js. This is *not* optimized with the rest of the code, since
23012304 # (1) it contains asm.js, whose validation would be broken, and (2) it's very large so it would
23022305 # be slow in cleanup/JSDCE etc.
@@ -2305,7 +2308,7 @@ def do_binaryen(target, asm_target, options, memfile, wasm_binary_target,
23052308 # BINARYEN_METHOD with something that doesn't use the polyfill, then we don't need it.
23062309 if not shared .Settings .BINARYEN_METHOD or 'interpret' in shared .Settings .BINARYEN_METHOD :
23072310 logging .debug ('integrating wasm.js polyfill interpreter' )
2308- wasm_js = open (os .path .join (binaryen_bin , 'wasm.js' )).read ()
2311+ wasm_js = open (os .path .join (binaryen_lib , 'wasm.js' )).read ()
23092312 wasm_js = wasm_js .replace ('EMSCRIPTEN_' , 'emscripten_' ) # do not confuse the markers
23102313 js = open (final ).read ()
23112314 combined = open (final , 'w' )
0 commit comments