[lld] r271829 - Include version in --reproduce.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 5 06:43:52 PDT 2016


At first I thought you were trying to store the linker version in an
archive. But by "version" you mean "version script", right?

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.

On Sun, Jun 5, 2016 at 6:19 AM, Rafael Espindola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rafael
> Date: Sun Jun  5 08:19:39 2016
> New Revision: 271829
>
> URL: http://llvm.org/viewvc/llvm-project?rev=271829&view=rev
> Log:
> Include version in --reproduce.
>
> Modified:
>     lld/trunk/ELF/Driver.cpp
>     lld/trunk/test/ELF/reproduce.s
>
> Modified: lld/trunk/ELF/Driver.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=271829&r1=271828&r2=271829&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Driver.cpp (original)
> +++ lld/trunk/ELF/Driver.cpp Sun Jun  5 08:19:39 2016
> @@ -115,9 +115,6 @@ void LinkerDriver::addFile(StringRef Pat
>      return;
>    MemoryBufferRef MBRef = *Buffer;
>
> -  if (Cpio)
> -    Cpio->append(relativeToRoot(Path), MBRef.getBuffer());
> -
>    switch (identify_magic(MBRef.getBuffer())) {
>    case file_magic::unknown:
>      readLinkerScript(MBRef);
> @@ -153,6 +150,10 @@ Optional<MemoryBufferRef> LinkerDriver::
>    std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;
>    MemoryBufferRef MBRef = MB->getMemBufferRef();
>    OwningMBs.push_back(std::move(MB)); // take MB ownership
> +
> +  if (Cpio)
> +    Cpio->append(relativeToRoot(Path), MBRef.getBuffer());
> +
>    return MBRef;
>  }
>
> @@ -251,9 +252,6 @@ void LinkerDriver::main(ArrayRef<const c
>      return;
>    }
>
> -  readConfigs(Args);
> -  initLLVM(Args);
> -
>    if (auto *Arg = Args.getLastArg(OPT_reproduce)) {
>      // Note that --reproduce is a debug option so you can ignore it
>      // if you are trying to understand the whole picture of the code.
> @@ -262,6 +260,8 @@ void LinkerDriver::main(ArrayRef<const c
>        Cpio->append("response.txt", createResponseFile(Args));
>    }
>
> +  readConfigs(Args);
> +  initLLVM(Args);
>    createFiles(Args);
>    checkOptions(Args);
>    if (HasError)
>
> Modified: lld/trunk/test/ELF/reproduce.s
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/reproduce.s?rev=271829&r1=271828&r2=271829&view=diff
>
> ==============================================================================
> --- lld/trunk/test/ELF/reproduce.s (original)
> +++ lld/trunk/test/ELF/reproduce.s Sun Jun  5 08:19:39 2016
> @@ -43,11 +43,19 @@
>  # RSP2-NEXT: --dynamic-list {{.+}}dyn
>  # RSP2-NEXT: -rpath {{.+}}file
>  # RSP2-NEXT: --script {{.+}}file
> -# RSP2-NEXT: --version-script {{.+}}ver
> +# RSP2-NEXT: --version-script [[PATH:.*]]ver
>  # RSP2-NEXT: --dynamic-linker "some unusual/path"
>  # RSP2-NEXT: -soname="foo bar"
>  # RSP2-NEXT: -soname="foo bar"
>
> +# RUN: cpio -t < repro2.cpio | FileCheck %s
> +# CHECK:      repro2/response.txt
> +# CHECK-NEXT: repro2/{{.*}}/dyn
> +# CHECK-NEXT: repro2/{{.*}}/ver
> +# CHECK-NEXT: repro2/{{.*}}/foo bar
> +# CHECK-NEXT: repro2/{{.*}}/file2
> +# CHECK-NEXT: repro2/{{.*}}/file
> +
>  .globl _start
>  _start:
>    mov $60, %rax
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160605/713f1215/attachment.html>


More information about the llvm-commits mailing list