diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 12:32:49 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-07 12:32:49 -0800 |
commit | b0b611c9f738d3badceb6d00f56ef25a79a76aea (patch) | |
tree | f33bb2bb458df2eace69b9f27c1e4a5df66642c0 /tools | |
parent | 483313890c45dd15df909ec44ecea0df8809c38d (diff) |
add parts of system bitcode libraries when necessary, and refactor library inclusion decision code
Diffstat (limited to 'tools')
-rw-r--r-- | tools/shared.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py index 1f9c8fe5..86a5ba77 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -707,6 +707,11 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e return generated_libs @staticmethod + def remove_symbol(filename, symbol): + Popen([LLVM_EXTRACT, filename, '-delete', '-glob=' + symbol, '-o', filename], stderr=PIPE).communicate() + Popen([LLVM_EXTRACT, filename, '-delete', '-func=' + symbol, '-o', filename], stderr=PIPE).communicate() + + @staticmethod def link(files, target, remove_duplicates=False): actual_files = [] unresolved_symbols = set(['main']) # tracking unresolveds is necessary for .a linking, see below. (and main is always a necessary symbol) @@ -775,8 +780,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e print >> sys.stderr, 'emcc: warning: removing duplicates in', actual for dupe in dupes: print >> sys.stderr, 'emcc: warning: removing duplicate', dupe - Popen([LLVM_EXTRACT, actual, '-delete', '-glob=' + dupe, '-o', actual], stderr=PIPE).communicate() - Popen([LLVM_EXTRACT, actual, '-delete', '-func=' + dupe, '-o', actual], stderr=PIPE).communicate() + Building.remove_symbol(actual, dupe) Popen([LLVM_EXTRACT, actual, '-delete', '-glob=.str', '-o', actual], stderr=PIPE).communicate() # garbage that appears here seen_symbols = seen_symbols.union(symbols.defs) |