Skip to content

Commit 2221065

Browse files
committed
avoid separate lto pass
1 parent ea72b92 commit 2221065

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

emcc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,18 +1058,14 @@ try:
10581058
# If we can LTO, do it before dce, since it opens up dce opportunities
10591059
if llvm_lto and shared.Building.can_use_unsafe_opts():
10601060
if not shared.Building.can_inline(): link_opts.append('-disable-inlining')
1061-
link_opts += ['-std-link-opts', '-disable-internalize']
1062-
if DEBUG: print >> sys.stderr, 'emcc: LLVM linktime:', link_opts
1063-
shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts)
1064-
if DEBUG: save_intermediate('linktime', 'bc')
1065-
link_opts = []
1061+
# do not internalize in std-link-opts - it ignores the internalize-public-api-list we pass later
1062+
link_opts += ['-disable-internalize', '-std-link-opts']
10661063
# At minimum remove dead functions etc., this potentially saves a lot in the size of the generated code (and the time to compile it)
10671064
exports = ','.join(map(lambda exp: exp[1:], shared.Settings.EXPORTED_FUNCTIONS))
1068-
# internalize carefully, llvm 3.2 will remove even main if not told not to
10691065
link_opts += shared.Building.get_safe_internalize() + ['-globaldce']
10701066
if DEBUG: print >> sys.stderr, 'emcc: LLVM linktime:', link_opts
10711067
shared.Building.llvm_opt(in_temp(target_basename + '.bc'), link_opts)
1072-
if DEBUG: save_intermediate('dce', 'bc')
1068+
if DEBUG: save_intermediate('linktime', 'bc')
10731069

10741070
# Prepare .ll for Emscripten
10751071
if not LEAVE_INPUTS_RAW:

0 commit comments

Comments
 (0)