diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-10 17:40:34 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-21 10:47:40 -0800 |
commit | 68fa40ad92b6aade0fbf5140fd85c3944046d890 (patch) | |
tree | d09239715fcc9e552f90324095dc8754a261ea19 | |
parent | 5d28c31f508e2229bdcfd464c368a6d2830397b7 (diff) |
safely internalize in s_x_x tests too
-rwxr-xr-x | emcc | 2 | ||||
-rw-r--r-- | tools/shared.py | 8 |
2 files changed, 8 insertions, 2 deletions
@@ -1066,7 +1066,7 @@ try: # At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it) exports = ','.join(map(lambda exp: exp[1:], shared.Settings.EXPORTED_FUNCTIONS)) # internalize carefully, llvm 3.2 will remove even main if not told not to - link_opts += ['-internalize', '-internalize-public-api-list=' + exports, '-globaldce'] + link_opts += shared.Building.get_safe_internalize() + ['-globaldce'] if DEBUG: print >> sys.stderr, 'emcc: LLVM linktime:', link_opts shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts) if DEBUG: save_intermediate('dce', 'bc') diff --git a/tools/shared.py b/tools/shared.py index 0e219175..97b4fd05 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -922,6 +922,12 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e return Settings.INLINING_LIMIT == 0 @staticmethod + def get_safe_internalize(): + exports = ','.join(map(lambda exp: exp[1:], Settings.EXPORTED_FUNCTIONS)) + # internalize carefully, llvm 3.2 will remove even main if not told not to + return ['-internalize', '-internalize-public-api-list=' + exports] + + @staticmethod def pick_llvm_opts(optimization_level): ''' It may be safe to use nonportable optimizations (like -OX) if we remove the platform info from the .ll @@ -956,7 +962,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e opts.append('-basicaa') # makes fannkuch slow but primes fast if Building.can_build_standalone(): - opts.append('-internalize') + opts += Building.get_safe_internalize() opts.append('-globalopt') opts.append('-ipsccp') |