[all-commits] [llvm/llvm-project] 83e60f: [lld/mac] Add --reproduce option

Nico Weber via All-commits all-commits at lists.llvm.org
Mon Nov 30 05:44:54 PST 2020


  Branch: refs/heads/temp-test-main
  Home:   https://github.com/llvm/llvm-project
  Commit: 83e60f5a554d2f531b17875e835eab0cbb487211
      https://github.com/llvm/llvm-project/commit/83e60f5a554d2f531b17875e835eab0cbb487211
  Author: Nico Weber <thakis at chromium.org>
  Date:   2020-11-30 (Mon, 30 Nov 2020)

  Changed paths:
    M lld/Common/Reproduce.cpp
    M lld/ELF/DriverUtils.cpp
    M lld/MachO/Driver.cpp
    M lld/MachO/Driver.h
    M lld/MachO/DriverUtils.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputFiles.h
    M lld/MachO/Options.td
    A lld/test/MachO/reproduce.s

  Log Message:
  -----------
  [lld/mac] Add --reproduce option

This adds support for ld.lld's --reproduce / lld-link's /reproduce:
flag to the MachO port. This flag can be added to a link command
to make the link write a tar file containing all inputs to the link
and a response file containing the link command. This can be used
to reproduce the link on another machine, which is useful for sharing
bug report inputs or performance test loads.

Since the linker is usually called through the clang driver and
adding linker flags can be a bit cumbersome, setting the env var
`LLD_REPRODUCE=foo.tar` triggers the feature as well.

The file response.txt in the archive can be used with
`ld64.lld.darwinnew $(cat response.txt)` as long as the contents are
smaller than the command-line limit, or with `ld64.lld.darwinnew
@response.txt` once D92149 is in.

The support in this patch is sufficient to create a tar file for
Chromium's base_unittests that can link after unpacking on a different
machine.

Differential Revision: https://reviews.llvm.org/D92274




More information about the All-commits mailing list