@@ -526,13 +526,15 @@ def run(args):
526
526
# An online HTML version (which may be of a different version of Emscripten)
527
527
# is up at http://kripken.github.io/emscripten-site/docs/tools_reference/emcc.html
528
528
529
- print ('''%s
529
+ with open (shared .path_from_root ('site' , 'build' , 'text' , 'docs' , 'tools_reference' , 'emcc.txt' ), 'r' ) as f :
530
+ print (f .read ())
530
531
532
+ print ('''
531
533
------------------------------------------------------------------
532
534
533
535
emcc: supported targets: llvm bitcode, javascript, NOT elf
534
536
(autoconf likes to see elf above to enable shared object support)
535
- ''' % ( open ( shared . path_from_root ( 'site' , 'build' , 'text' , 'docs' , 'tools_reference' , 'emcc.txt' )). read ()) )
537
+ ''' )
536
538
return 0
537
539
538
540
if '--version' in args :
@@ -1814,8 +1816,6 @@ def check_human_readable_list(items):
1814
1816
exit_with_error ('STANDALONE_WASM is only available in the upstream wasm backend path' )
1815
1817
if shared .Settings .USE_PTHREADS :
1816
1818
exit_with_error ('STANDALONE_WASM does not support pthreads yet' )
1817
- if shared .Settings .SIMD :
1818
- exit_with_error ('STANDALONE_WASM does not support simd yet' )
1819
1819
# the wasm must be runnable without the JS, so there cannot be anything that
1820
1820
# requires JS legalization
1821
1821
shared .Settings .LEGALIZE_JS_FFI = 0
@@ -1883,6 +1883,9 @@ def is_link_flag(flag):
1883
1883
return any (flag .startswith (x ) for x in ('-l' , '-L' , '-Wl,' ))
1884
1884
1885
1885
compile_args = [a for a in newargs if a and not is_link_flag (a )]
1886
+ if '-fPIC' in compile_args and not shared .Settings .RELOCATABLE :
1887
+ shared .warning ('ignoring -fPIC flag when not building with SIDE_MODULE or MAIN_MODULE' )
1888
+ compile_args .remove ('-fPIC' )
1886
1889
1887
1890
# Bitcode args generation code
1888
1891
def get_clang_command (input_files ):
@@ -2996,10 +2999,10 @@ def do_binaryen(target, asm_target, options, memfile, wasm_binary_target,
2996
2999
options .binaryen_passes += ['--pass-arg=emscripten-sbrk-val@%d' % shared .Settings .DYNAMIC_BASE ]
2997
3000
if DEBUG :
2998
3001
shared .safe_copy (wasm_binary_target , os .path .join (shared .get_emscripten_temp_dir (), os .path .basename (wasm_binary_target ) + '.pre-byn' ))
2999
- cmd = [ os . path . join ( binaryen_bin , 'wasm-opt' ), wasm_binary_target , '-o' , wasm_binary_target ] + options . binaryen_passes
3000
- cmd += shared . Building . get_binaryen_feature_flags ()
3001
- if intermediate_debug_info :
3002
- cmd += [ '-g' ] # preserve the debug info
3002
+ cmd = shared . Building . get_wasm_opt_command ( wasm_binary_target ,
3003
+ wasm_binary_target ,
3004
+ options . binaryen_passes ,
3005
+ debug = intermediate_debug_info )
3003
3006
if use_source_map (options ):
3004
3007
cmd += ['--input-source-map=' + wasm_source_map_target ]
3005
3008
cmd += ['--output-source-map=' + wasm_source_map_target ]
@@ -3057,6 +3060,11 @@ def do_binaryen(target, asm_target, options, memfile, wasm_binary_target,
3057
3060
emitting_js = not target .endswith (WASM_ENDINGS ))
3058
3061
save_intermediate_with_wasm ('postclean' , wasm_binary_target )
3059
3062
3063
+ if shared .Settings .ASYNCIFY_LAZY_LOAD_CODE :
3064
+ if not shared .Settings .ASYNCIFY :
3065
+ exit_with_error ('ASYNCIFY_LAZY_LOAD_CODE requires ASYNCIFY' )
3066
+ shared .Building .asyncify_lazy_load_code (wasm_binary_target , options , debug = intermediate_debug_info )
3067
+
3060
3068
def run_closure_compiler (final ):
3061
3069
final = shared .Building .closure_compiler (final , pretty = not optimizer .minify_whitespace ,
3062
3070
extra_closure_args = options .closure_args )
@@ -3658,5 +3666,5 @@ def validate_arg_level(level_string, max_level, err_msg, clamp=False):
3658
3666
try :
3659
3667
sys .exit (run (sys .argv ))
3660
3668
except KeyboardInterrupt :
3661
- logger .warning (" KeyboardInterrupt" )
3669
+ logger .warning (' KeyboardInterrupt' )
3662
3670
sys .exit (1 )
0 commit comments