diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-04 11:54:07 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-04 11:54:07 -0800 |
commit | 2817d5ac5526f61b748827f0fae9ecdbc16fcef6 (patch) | |
tree | 13eddcc4dd31203e8889fa28f348e5e2173b82ba /tools/shared.py | |
parent | c735bb6469370c0a6be212a630c9a73698ebdfbc (diff) |
only add in .o inside .a that are needed
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/tools/shared.py b/tools/shared.py index e292dbf3..6af1b9df 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -741,17 +741,11 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e Popen([LLVM_AR, 'x', f], stdout=PIPE).communicate() # if absolute paths, files will appear there. otherwise, in this directory contents = map(lambda content: os.path.join(temp_dir, content), contents) contents = filter(os.path.exists, map(os.path.abspath, contents)) - needed = False # We add or do not add the entire archive. We let llvm dead code eliminate parts we do not need, instead of - # doing intra-dependencies between archive contents for content in contents: new_symbols = Building.llvm_nm(content) # Link in the .o if it provides symbols, *or* this is a singleton archive (which is apparently an exception in gcc ld) if new_symbols.defs.intersection(unresolved_symbols) or len(files) == 1: - needed = True - if needed: - for content in contents: if Building.is_bitcode(content): - new_symbols = Building.llvm_nm(content) resolved_symbols = resolved_symbols.union(new_symbols.defs) unresolved_symbols = unresolved_symbols.union(new_symbols.undefs.difference(resolved_symbols)).difference(new_symbols.defs) actual_files.append(content) |