[all-commits] [llvm/llvm-project] 95831a: [lld-macho] Implement -object_path_lto

Jez Ng via All-commits all-commits at lists.llvm.org
Thu Dec 10 15:58:42 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 95831a56d092c563b03167ece592be301a2a0081
      https://github.com/llvm/llvm-project/commit/95831a56d092c563b03167ece592be301a2a0081
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-12-10 (Thu, 10 Dec 2020)

  Changed paths:
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/LTO.cpp
    M lld/MachO/Options.td
    A lld/test/MachO/lto-object-path.ll

  Log Message:
  -----------
  [lld-macho] Implement -object_path_lto

This makes it possible for STABS entries to reference the debug info
contained in the LTO-compiled output.

I'm not sure how to test the file mtime within llvm-lit -- GNU and BSD
`stat` take different command-line arguments. I've omitted the check for
now.

Reviewed By: clayborg

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


  Commit: 863f7a745e6ba5b9aebca82eeba1a2fb1db53e20
      https://github.com/llvm/llvm-project/commit/863f7a745e6ba5b9aebca82eeba1a2fb1db53e20
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-12-10 (Thu, 10 Dec 2020)

  Changed paths:
    M lld/MachO/Dwarf.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputFiles.h
    M lld/MachO/Writer.cpp
    M lld/test/MachO/stabs.s

  Log Message:
  -----------
  [lld-macho] Don't attempt to emit rebase opcodes for debug sections

This was causing a crash as we were attempting to look up the
nonexistent parent OutputSection of the debug sections. We didn't detect
it earlier because there was no test for PIEs with debug info (PIEs
require us to emit rebases for X86_64_RELOC_UNSIGNED).

This diff filters out the debug sections while loading the ObjFiles. In
addition to fixing the above problem, it also lets us avoid doing
redundant work -- we no longer parse / apply relocations / attempt to
emit dyld opcodes for these sections that we don't emit.

Fixes llvm.org/PR48392.

Reviewed By: thakis

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


  Commit: 29d3b0e47113e011c6fc541fc81c868ef3df21a3
      https://github.com/llvm/llvm-project/commit/29d3b0e47113e011c6fc541fc81c868ef3df21a3
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-12-10 (Thu, 10 Dec 2020)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/MachO/LTO.cpp
    M lld/MachO/Options.td
    A lld/test/MachO/codemodel.ll
    A lld/test/MachO/cpu-string.ll
    A lld/test/MachO/mattrs.ll

  Log Message:
  -----------
  [lld-macho] Add support for -mcpu, -mattr, -code-model in LTO

`-mcpu` and `-code-model` tests were copied from similar ones in
LLD-ELF.

There doesn't seem to be an equivalent test for `-mattr` in LLD-ELF, so
I've verified our behavior by cribbing a test from
CodeGen/X86/recip-fastmath.ll.

Reviewed By: #lld-macho, compnerd, MaskRay

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


  Commit: 74d799926e557928352dcd980788cae6487e421c
      https://github.com/llvm/llvm-project/commit/74d799926e557928352dcd980788cae6487e421c
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-12-10 (Thu, 10 Dec 2020)

  Changed paths:
    M lld/MachO/Driver.cpp
    A lld/test/MachO/module-asm.ll

  Log Message:
  -----------
  [lld-macho] Initialize AsmParsers earlier

We need to initialize AsmParsers before any calls to `addFile`, as
bitcode files may require them. Otherwise we trigger `Assertion T &&
T->hasMCAsmParser()' failed`.

Reviewed By: #lld-macho, compnerd

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


  Commit: 6a348f6158ecdb7a4bcac3f4cd1d3c5b6e80a550
      https://github.com/llvm/llvm-project/commit/6a348f6158ecdb7a4bcac3f4cd1d3c5b6e80a550
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-12-10 (Thu, 10 Dec 2020)

  Changed paths:
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/Options.td
    A lld/test/MachO/implicit-dylibs.s
    M lld/test/MachO/reexport-stub.s
    M lld/test/MachO/stub-link.s

  Log Message:
  -----------
  [lld-macho] Implement `-no_implicit_dylibs`

Dylibs that are "public" -- i.e. top-level system libraries -- are considered
implicitly linked when another library re-exports them. That is, we should load
them & bind directly to their symbols instead of via their re-exporting
umbrella library. This diff implements that behavior by default, as well as an
opt-out flag.

In theory, this is just a performance optimization, but in practice it seems
that it's needed for correctness.

Fixes llvm.org/PR48395.

Reviewed By: thakis

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


  Commit: 76c36c11a9c620a5eeced5750b844a1097ab7586
      https://github.com/llvm/llvm-project/commit/76c36c11a9c620a5eeced5750b844a1097ab7586
  Author: Jez Ng <jezng at fb.com>
  Date:   2020-12-10 (Thu, 10 Dec 2020)

  Changed paths:
    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/test/MachO/dylink.s
    M lld/test/MachO/implicit-dylibs.s
    M lld/test/MachO/lc-linker-option.ll

  Log Message:
  -----------
  [lld-macho] Don't load dylibs more than once

Also remove `DylibFile::reexported` since it's unused.

Fixes llvm.org/PR48393.

Reviewed By: thakis

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


Compare: https://github.com/llvm/llvm-project/compare/dd1aa4fdd82b...76c36c11a9c6


More information about the All-commits mailing list