[lld] r268229 - Copy thin archive members with --reproduce.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 10:49:46 PDT 2016


It is much easier than I thought. Nice!

On Mon, May 2, 2016 at 6:54 AM, Rafael Espindola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rafael
> Date: Mon May  2 08:54:10 2016
> New Revision: 268229
>
> URL: http://llvm.org/viewvc/llvm-project?rev=268229&view=rev
> Log:
> Copy thin archive members with --reproduce.
>
> Added:
>     lld/trunk/test/ELF/reproduce-thin-archive.s
> Modified:
>     lld/trunk/ELF/InputFiles.cpp
>
> Modified: lld/trunk/ELF/InputFiles.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=268229&r1=268228&r2=268229&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/InputFiles.cpp (original)
> +++ lld/trunk/ELF/InputFiles.cpp Mon May  2 08:54:10 2016
> @@ -372,6 +372,9 @@ MemoryBufferRef ArchiveFile::getMember(c
>    if (!Seen.insert(C.getChildOffset()).second)
>      return MemoryBufferRef();
>
> +  if (!Config->Reproduce.empty() && C.getParent()->isThin())
> +    copyInputFile(check(C.getFullName()));
> +
>    return check(C.getMemoryBufferRef(),
>                 "could not get the buffer for the member defining symbol "
> +
>                     Sym->getName());
>
> Added: lld/trunk/test/ELF/reproduce-thin-archive.s
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/reproduce-thin-archive.s?rev=268229&view=auto
>
> ==============================================================================
> --- lld/trunk/test/ELF/reproduce-thin-archive.s (added)
> +++ lld/trunk/test/ELF/reproduce-thin-archive.s Mon May  2 08:54:10 2016
> @@ -0,0 +1,14 @@
> +# REQUIRES: x86, shell
> +
> +# RUN: rm -rf %t.dir
> +# RUN: mkdir -p %t.dir
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.dir/foo.o
> +# RUN: cd %t.dir
> +# RUN: llvm-ar rcT foo.a foo.o
> +# RUN: ld.lld -m elf_x86_64 foo.a -o bar --reproduce repro
> +# RUN: diff foo.a repro/%:t.dir/foo.a
> +# RUN: diff foo.o repro/%:t.dir/foo.o
> +
> +.globl _start
> +_start:
> +  nop
>
>
> _______________________________________________
> 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/20160502/0eef1832/attachment.html>


More information about the llvm-commits mailing list