<div dir="ltr">At first I thought you were trying to store the linker version in an archive. But by "version" you mean "version script", right?<div><br></div><div>I'd think it is useful to write a version number to an archive in some way -- probably as a comment in a response file or as a separate text file.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 5, 2016 at 6:19 AM, Rafael Espindola via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Sun Jun  5 08:19:39 2016<br>
New Revision: 271829<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=271829&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=271829&view=rev</a><br>
Log:<br>
Include version in --reproduce.<br>
<br>
Modified:<br>
    lld/trunk/ELF/Driver.cpp<br>
    lld/trunk/test/ELF/reproduce.s<br>
<br>
Modified: lld/trunk/ELF/Driver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=271829&r1=271828&r2=271829&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=271829&r1=271828&r2=271829&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Driver.cpp (original)<br>
+++ lld/trunk/ELF/Driver.cpp Sun Jun  5 08:19:39 2016<br>
@@ -115,9 +115,6 @@ void LinkerDriver::addFile(StringRef Pat<br>
     return;<br>
   MemoryBufferRef MBRef = *Buffer;<br>
<br>
-  if (Cpio)<br>
-    Cpio->append(relativeToRoot(Path), MBRef.getBuffer());<br>
-<br>
   switch (identify_magic(MBRef.getBuffer())) {<br>
   case file_magic::unknown:<br>
     readLinkerScript(MBRef);<br>
@@ -153,6 +150,10 @@ Optional<MemoryBufferRef> LinkerDriver::<br>
   std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;<br>
   MemoryBufferRef MBRef = MB->getMemBufferRef();<br>
   OwningMBs.push_back(std::move(MB)); // take MB ownership<br>
+<br>
+  if (Cpio)<br>
+    Cpio->append(relativeToRoot(Path), MBRef.getBuffer());<br>
+<br>
   return MBRef;<br>
 }<br>
<br>
@@ -251,9 +252,6 @@ void LinkerDriver::main(ArrayRef<const c<br>
     return;<br>
   }<br>
<br>
-  readConfigs(Args);<br>
-  initLLVM(Args);<br>
-<br>
   if (auto *Arg = Args.getLastArg(OPT_reproduce)) {<br>
     // Note that --reproduce is a debug option so you can ignore it<br>
     // if you are trying to understand the whole picture of the code.<br>
@@ -262,6 +260,8 @@ void LinkerDriver::main(ArrayRef<const c<br>
       Cpio->append("response.txt", createResponseFile(Args));<br>
   }<br>
<br>
+  readConfigs(Args);<br>
+  initLLVM(Args);<br>
   createFiles(Args);<br>
   checkOptions(Args);<br>
   if (HasError)<br>
<br>
Modified: lld/trunk/test/ELF/reproduce.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/reproduce.s?rev=271829&r1=271828&r2=271829&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/reproduce.s?rev=271829&r1=271828&r2=271829&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/ELF/reproduce.s (original)<br>
+++ lld/trunk/test/ELF/reproduce.s Sun Jun  5 08:19:39 2016<br>
@@ -43,11 +43,19 @@<br>
 # RSP2-NEXT: --dynamic-list {{.+}}dyn<br>
 # RSP2-NEXT: -rpath {{.+}}file<br>
 # RSP2-NEXT: --script {{.+}}file<br>
-# RSP2-NEXT: --version-script {{.+}}ver<br>
+# RSP2-NEXT: --version-script [[PATH:.*]]ver<br>
 # RSP2-NEXT: --dynamic-linker "some unusual/path"<br>
 # RSP2-NEXT: -soname="foo bar"<br>
 # RSP2-NEXT: -soname="foo bar"<br>
<br>
+# RUN: cpio -t < repro2.cpio | FileCheck %s<br>
+# CHECK:      repro2/response.txt<br>
+# CHECK-NEXT: repro2/{{.*}}/dyn<br>
+# CHECK-NEXT: repro2/{{.*}}/ver<br>
+# CHECK-NEXT: repro2/{{.*}}/foo bar<br>
+# CHECK-NEXT: repro2/{{.*}}/file2<br>
+# CHECK-NEXT: repro2/{{.*}}/file<br>
+<br>
 .globl _start<br>
 _start:<br>
   mov $60, %rax<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>