diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-19 14:02:34 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-19 14:02:34 -0800 |
commit | 1c796635aa711764d18a47577d5e94ead309506c (patch) | |
tree | dd97efc4a41a618b78d42771de06e1c124baa3f5 /tools | |
parent | fca29f7958688e613801f4f13c784796f1270bad (diff) |
remove --remove-duplicates
Diffstat (limited to 'tools')
-rw-r--r-- | tools/shared.py | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/tools/shared.py b/tools/shared.py index 0a041669..4b63d436 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -712,7 +712,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e Popen([LLVM_EXTRACT, filename, '-delete', '-func=' + symbol, '-o', filename], stderr=PIPE).communicate() @staticmethod - def link(files, target, remove_duplicates=False): + def link(files, target): actual_files = [] unresolved_symbols = set(['main']) # tracking unresolveds is necessary for .a linking, see below. (and main is always a necessary symbol) resolved_symbols = set() @@ -773,27 +773,11 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e os.chdir(cwd) try_delete(target) - if remove_duplicates: - # Remove duplicate symbols. This is a workaround for how we compile .a files, we try to - # emulate ld behavior which is permissive TODO: cache llvm-nm results - seen_symbols = set() - print >> sys.stderr, actual_files - for actual in actual_files: - symbols = Building.llvm_nm(actual) - dupes = seen_symbols.intersection(symbols.defs) - if len(dupes) > 0: - print >> sys.stderr, 'emcc: warning: removing duplicates in', actual - for dupe in dupes: - print >> sys.stderr, 'emcc: warning: removing duplicate', dupe - 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) - # Finish link actual_files = list(set(actual_files)) # tolerate people trying to link a.so a.so etc. if DEBUG: print >>sys.stderr, 'emcc: llvm-linking:', actual_files output = Popen([LLVM_LINK] + actual_files + ['-o', target], stdout=PIPE).communicate()[0] - assert os.path.exists(target) and (output is None or 'Could not open input file' not in output), 'Linking error: ' + output + '\nemcc: If you get duplicate symbol errors, try --remove-duplicates' + assert os.path.exists(target) and (output is None or 'Could not open input file' not in output), 'Linking error: ' + output for temp_dir in temp_dirs: try_delete(temp_dir) |