[libcxx-commits] [PATCH] D58024: [libcxx] Preserve order, avoid duplicates when merging static archives

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 11 00:48:42 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rCXX353671: [libcxx] Preserve order, avoid duplicates when merging static archives (authored by phosek, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D58024?vs=186184&id=186192#toc

Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58024/new/

https://reviews.llvm.org/D58024

Files:
  utils/merge_archives.py


Index: utils/merge_archives.py
===================================================================
--- utils/merge_archives.py
+++ utils/merge_archives.py
@@ -78,6 +78,7 @@
         sys.stderr.write('%s\n' % report)
         if exitCode != 0:
             exit_with_cleanups(exitCode)
+    return out
 
 def main():
     parser = ArgumentParser(
@@ -119,15 +120,15 @@
     global temp_directory_root
     temp_directory_root = tempfile.mkdtemp('.libcxx.merge.archives')
 
+    files = []
     for arc in archives:
-        execute_command_verbose([ar_exe, 'x', arc], cwd=temp_directory_root,
-                                verbose=args.verbose)
+        execute_command_verbose([ar_exe, 'x', arc],
+                                cwd=temp_directory_root, verbose=args.verbose)
+        out = execute_command_verbose([ar_exe, 't', arc])
+        files.extend(out.splitlines())
 
-    files = glob.glob(os.path.join(temp_directory_root, '*.o*'))
-    if not files:
-        print_and_exit('Failed to glob for %s' % temp_directory_root)
-    cmd = [ar_exe, 'qcs', args.output] + files
-    execute_command_verbose(cmd, cwd=temp_directory_root, verbose=args.verbose)
+    execute_command_verbose([ar_exe, 'rcsD', args.output] + files,
+                            cwd=temp_directory_root, verbose=args.verbose)
 
 
 if __name__ == '__main__':


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58024.186192.patch
Type: text/x-patch
Size: 1342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190211/702790c7/attachment-0001.bin>


More information about the libcxx-commits mailing list