diff options
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -933,7 +933,7 @@ try: if default_cxx_std: newargs = newargs + [default_cxx_std] - if js_opts is None: js_opts = True + if js_opts is None: js_opts = opt_level >= 1 if llvm_opts is None: llvm_opts = LLVM_OPT_LEVEL[opt_level] if llvm_lto is None and opt_level >= 3: llvm_lto = 3 if opt_level == 0: debug_level = 4 @@ -1136,6 +1136,7 @@ try: if shared.Settings.MAIN_MODULE or shared.Settings.SIDE_MODULE: assert not memory_init_file, 'memory init file is not supported with module linking' + assert shared.Settings.ASM_JS, 'module linking requires asm.js output (-s ASM_JS=1)' shared.Settings.LINKABLE = 1 # TODO: add FORCE_DCE option for the brave people that do want to dce here and in side modules debug_level = max(debug_level, 2) @@ -1160,6 +1161,9 @@ try: if proxy_to_worker: shared.Settings.PROXY_TO_WORKER = 1 + if js_opts: + shared.Settings.RUNNING_JS_OPTS = 1 + ## Compile source code to bitcode logging.debug('compiling to bitcode') @@ -1239,7 +1243,7 @@ try: extra_files_to_link = [] - if not LEAVE_INPUTS_RAW and not AUTODEBUG and \ + if not LEAVE_INPUTS_RAW and \ not shared.Settings.BUILD_AS_SHARED_LIB == 2 and \ not shared.Settings.SIDE_MODULE: # shared libraries/side modules link no C libraries, need them in parent @@ -1703,7 +1707,7 @@ try: global final, js_optimizer_queue, js_optimizer_extra_info if len(js_optimizer_extra_info) == 0: js_optimizer_extra_info = None - if len(js_optimizer_queue) > 0 and not(len(js_optimizer_queue) == 1 and js_optimizer_queue[0] == 'last'): + if len(js_optimizer_queue) > 0 and not(not shared.Settings.ASM_JS and len(js_optimizer_queue) == 1 and js_optimizer_queue[0] == 'last'): if DEBUG != '2': if shared.Settings.ASM_JS: js_optimizer_queue = ['asm'] + js_optimizer_queue @@ -1738,7 +1742,10 @@ try: else: return 'eliminate' - js_optimizer_queue += [get_eliminate(), 'simplifyExpressions'] + js_optimizer_queue += [get_eliminate()] + + if opt_level >= 2: + js_optimizer_queue += ['simplifyExpressions'] if closure and not shared.Settings.ASM_JS: flush_js_optimizer_queue() |