File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1066,7 +1066,7 @@ try:
10661066 # At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it)
10671067 exports = ',' .join (map (lambda exp : exp [1 :], shared .Settings .EXPORTED_FUNCTIONS ))
10681068 # internalize carefully, llvm 3.2 will remove even main if not told not to
1069- link_opts += [ '-internalize' , '-internalize-public-api-list=' + exports , '-globaldce' ]
1069+ link_opts += shared . Building . get_safe_internalize () + [ '-globaldce' ]
10701070 if DEBUG : print >> sys .stderr , 'emcc: LLVM linktime:' , link_opts
10711071 shared .Building .llvm_opt (in_temp (target_basename + '.bc' ), link_opts )
10721072 if DEBUG : save_intermediate ('dce' , 'bc' )
Original file line number Diff line number Diff line change @@ -921,6 +921,12 @@ def can_use_unsafe_opts():
921921 def can_inline ():
922922 return Settings .INLINING_LIMIT == 0
923923
924+ @staticmethod
925+ def get_safe_internalize ():
926+ exports = ',' .join (map (lambda exp : exp [1 :], Settings .EXPORTED_FUNCTIONS ))
927+ # internalize carefully, llvm 3.2 will remove even main if not told not to
928+ return ['-internalize' , '-internalize-public-api-list=' + exports ]
929+
924930 @staticmethod
925931 def pick_llvm_opts (optimization_level ):
926932 '''
@@ -956,7 +962,7 @@ def pick_llvm_opts(optimization_level):
956962 opts .append ('-basicaa' ) # makes fannkuch slow but primes fast
957963
958964 if Building .can_build_standalone ():
959- opts . append ( '-internalize' )
965+ opts += Building . get_safe_internalize ( )
960966
961967 opts .append ('-globalopt' )
962968 opts .append ('-ipsccp' )
You can’t perform that action at this time.
0 commit comments