aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-10 12:23:42 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-21 10:47:39 -0800
commite9fe31fb2f629a2b94809c7f9a91577425728b1e (patch)
treee80be918fcd74573db05bd2e87880cfda5141b25
parentc5845c5f593a87cebd8117ec7d6b26ade962e276 (diff)
llvm 3.2 internalize internalizes even main, so manually keep it and other exports alive
-rwxr-xr-xemcc3
1 files changed, 2 insertions, 1 deletions
diff --git a/emcc b/emcc
index e0372e4d..1b86ee9b 100755
--- a/emcc
+++ b/emcc
@@ -1060,7 +1060,8 @@ try:
link_opts.append('-std-link-opts')
else:
# At least remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it)
- link_opts += ['-internalize', '-globaldce']
+ exports = ','.join(map(lambda exp: exp[1:], shared.Settings.EXPORTED_FUNCTIONS))
+ link_opts += ['-internalize', '-internalize-public-api-list=' + exports, '-globaldce']
if link_opts:
if DEBUG: print >> sys.stderr, 'emcc: LLVM linktime:', link_opts
shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts)