[all-commits] [llvm/llvm-project] e87c09: [lld/mac] Print dylib search details with --print-...

Nico Weber via All-commits all-commits at lists.llvm.org
Wed Jun 9 19:08:38 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e87c095af3e3b964a7f400a1767ae1e302cfb0c4
      https://github.com/llvm/llvm-project/commit/e87c095af3e3b964a7f400a1767ae1e302cfb0c4
  Author: Nico Weber <thakis at chromium.org>
  Date:   2021-06-09 (Wed, 09 Jun 2021)

  Changed paths:
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/Driver.h
    M lld/MachO/DriverUtils.cpp
    M lld/MachO/Options.td
    M lld/test/MachO/link-search-order.s

  Log Message:
  -----------
  [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING

For debugging dylib loading, it's useful to have some insight into what
the linker is doing.

ld64 has the undocumented RC_TRACE_DYLIB_SEARCHING env var
for this printing dylib search candidates.

This adds a flag --print-dylib-search to make lld print the seame information.
It's useful for users, but also for writing tests. The output is formatted
slightly differently than ld64, but we still support RC_TRACE_DYLIB_SEARCHING
to offer at least a compatible way to trigger this.

ld64 has both `-print_statistics` and `-trace_symbol_output` to enable
diagnostics output. I went with "print" since that seems like a more
straightforward name.

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




More information about the All-commits mailing list