diff options
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/tools/shared.py b/tools/shared.py index 63dcefca..c816f091 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -314,7 +314,7 @@ def find_temp_directory(): # we re-check sanity when the settings are changed) # We also re-check sanity and clear the cache when the version changes -EMSCRIPTEN_VERSION = '1.6.3' +EMSCRIPTEN_VERSION = '1.6.4' def generate_sanity(): return EMSCRIPTEN_VERSION + '|' + get_llvm_target() + '|' + LLVM_ROOT @@ -364,7 +364,7 @@ def check_sanity(force=False): logging.critical('Node.js (%s) does not seem to work, check the paths in %s' % (NODE_JS, EM_CONFIG)) sys.exit(1) - for cmd in [CLANG, LINK_CMD[0], LLVM_AR, LLVM_OPT, LLVM_AS, LLVM_DIS, LLVM_NM]: + for cmd in [CLANG, LINK_CMD[0], LLVM_AR, LLVM_OPT, LLVM_AS, LLVM_DIS, LLVM_NM, LLVM_INTERPRETER]: if not os.path.exists(cmd) and not os.path.exists(cmd + '.exe'): # .exe extension required for Windows logging.critical('Cannot find %s, check the paths in %s' % (cmd, EM_CONFIG)) sys.exit(1) @@ -758,8 +758,6 @@ class Settings2(type): self.attrs['ASM_JS'] = 1 self.attrs['ASSERTIONS'] = 0 self.attrs['DISABLE_EXCEPTION_CATCHING'] = 1 - self.attrs['EMIT_GENERATED_FUNCTIONS'] = 1 - if opt_level >= 2: self.attrs['RELOOP'] = 1 self.attrs['ALIASING_FUNCTION_POINTERS'] = 1 if opt_level >= 3: @@ -1426,11 +1424,11 @@ class Building: emcc_leave_inputs_raw = os.environ.get('EMCC_LEAVE_INPUTS_RAW') if emcc_leave_inputs_raw: del os.environ['EMCC_LEAVE_INPUTS_RAW'] - def make(opt_level): + def make(opt_level, reloop): raw = relooper + '.raw.js' Building.emcc(os.path.join('relooper', 'Relooper.cpp'), ['-I' + os.path.join('relooper'), '--post-js', os.path.join('relooper', 'emscripten', 'glue.js'), - '--memory-init-file', '0', + '--memory-init-file', '0', '-s', 'RELOOP=%d' % reloop, '-s', 'EXPORTED_FUNCTIONS=["_rl_set_output_buffer","_rl_make_output_buffer","_rl_new_block","_rl_delete_block","_rl_block_add_branch_to","_rl_new_relooper","_rl_delete_relooper","_rl_relooper_add_block","_rl_relooper_calculate","_rl_relooper_render", "_rl_set_asm_js_mode"]', '-s', 'DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=["memcpy", "memset", "malloc", "free", "puts"]', '-s', 'RELOOPER="' + relooper + '"', @@ -1445,10 +1443,10 @@ class Building: # bootstrap phase 1: generate unrelooped relooper, for which we do not need a relooper (so we cannot recurse infinitely in this function) logging.info(' bootstrap phase 1') - make(1) + make(2, 0) # bootstrap phase 2: generate relooped relooper, using the unrelooped relooper (we see relooper.js exists so we cannot recurse infinitely in this function) logging.info(' bootstrap phase 2') - make(2) + make(2, 1) logging.info('bootstrapping relooper succeeded') logging.info('=======================================') ok = True @@ -1460,7 +1458,15 @@ class Building: logging.error('bootstrapping relooper failed. You may need to manually create relooper.js by compiling it, see src/relooper/emscripten') try_delete(relooper) # do not leave a phase-1 version if phase 2 broke 1/0 - + + @staticmethod + def ensure_struct_info(info_path): + if os.path.exists(info_path): return + Cache.ensure() + + import gen_struct_info + gen_struct_info.main(['-qo', info_path, path_from_root('src/struct_info.json')]) + @staticmethod def preprocess(infile, outfile): ''' |