aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/shared.py8
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)