[all-commits] [llvm/llvm-project] 73fd9d: [lld] Support separate native object file path in ...

Ivan Tadeu Ferreira Antunes Filho via All-commits all-commits at lists.llvm.org
Tue Apr 4 11:36:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73fd9d310fff4d7d2b95e0509aafdf28bd3c713c
      https://github.com/llvm/llvm-project/commit/73fd9d310fff4d7d2b95e0509aafdf28bd3c713c
  Author: Ivan Tadeu Ferreira Antunes Filho <antunesi at google.com>
  Date:   2023-04-04 (Tue, 04 Apr 2023)

  Changed paths:
    M lld/COFF/Config.h
    M lld/COFF/Driver.cpp
    M lld/COFF/LTO.cpp
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/LTO.cpp
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/LTO.cpp
    A lld/test/COFF/thinlto-index-file-object-prefix-replace.ll
    A lld/test/ELF/lto/thinlto-index-file-object-prefix-replace.ll
    A lld/test/MachO/thinlto-index-file-object-prefix-replace.ll
    M llvm/include/llvm/LTO/LTO.h
    M llvm/lib/LTO/LTO.cpp
    M llvm/tools/gold/gold-plugin.cpp
    M llvm/tools/llvm-lto2/llvm-lto2.cpp

  Log Message:
  -----------
  [lld] Support separate native object file path in --thinlto-prefix-replace

Currently, the --thinlto-prefix-replace="oldpath;newpath" option is used during
distributed ThinLTO thin links to specify the mapping of the input bitcode object
files' directory tree (oldpath) to the directory tree (newpath) used for both:

1) the output files of the thin link itself (the .thinlto.bc index files and the
optional .imports files)
2) the specified object file paths written to the response file given in the
--thinlto-index-only=${response} option, which is used by the final native
link and must match the paths of the native object files that will be
produced by ThinLTO backend compiles.
This patch expands the --thinlto-prefix-replace option to allow a separate directory
tree mapping to be specified for the object file paths written to the response file
(number 2 above). This is important to support builds and build systems where the
same output directory may not be written by multiple build actions (e.g. the thin link
and the ThinLTO backend compiles).

The new format is: --thinlto-prefix-replace="origpath;outpath[;objpath]"

This replaces the origpath directory tree of the thin link input files with
outpath when writing the thin link index and imports outputs (number 1
above). If objpath is specified it replaces origpath of the input files with
objpath when writing the response file (number 2 above), otherwise it
falls back to the old behavior of using outpath for this as well.

Reviewed By: tejohnson, MaskRay

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




More information about the All-commits mailing list