[PATCH] D48413: [llvm-objcopy] Add initial support for static libraries

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 6 02:02:30 PDT 2018


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

Great, thanks for the changes! Sorry for the bother.

LGTM, with a few small modifications in the tests (deleting archives, to prevent corrupted versions messing up the test).

You might want to get @jakehehrlich's comments before committing, but I'll leave that up to you!



================
Comment at: test/tools/llvm-objcopy/strip-debug.test:33
+# RUN: cp %t2 %t.duplicate.stripped
+# RUN: llvm-ar crs %t.multiple-stripped-obj.a %t2 %t.duplicate.stripped
+# RUN: llvm-ar crs %t.multiple-obj.a %t %t.duplicate
----------------
Like with the other test cases, you need to delete %t.multiple-stripped-obj.a and %t.multiple-obj.a before running these steps, in case these objects get corrupted somehow.


================
Comment at: test/tools/llvm-objcopy/strip-debug.test:41
+# We can not use %t inside the patterns passed to FileCheck,
+# thus we have to use "recognizable" file names.
+# RUN: cp %t %t1.o
----------------
Not that I'm asking you to do it, but there is a trick a colleague of mine showed me. Since FileCheck can read its checks from any file, you can use echo to create a text file with the %t expanded in it, along with "CHECK: " etc and then use this file instead of %s to achieve the goal!


================
Comment at: test/tools/llvm-objcopy/strip-debug.test:45
+# RUN: cp %t %t3.o
+# RUN: llvm-ar r %t.non-object.a %t1.o %t2.txt %t3.o
+# RUN: llvm-ar t %t.non-object.a | FileCheck %s --check-prefix=NON-OBJECT-ARCHIVE-MEMBERS
----------------
Same as above, please delete %t.non-object.a before creating it here. Also, you should probably add the 'c' modifier as you have done with the others.


================
Comment at: test/tools/llvm-objcopy/strip-debug.test:73
+
+# RUN: llvm-ar crsT %t.non-object.thin.a %t1.o %t2.txt %t3.o
+# RUN: cp %t.non-object.thin.a %t.non-object.thin.copy.a
----------------
Ditto again, as above, please delete "%t.non-object.thin.a.


Repository:
  rL LLVM

https://reviews.llvm.org/D48413





More information about the llvm-commits mailing list