[PATCH] D103985: [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 12:21:06 PDT 2021


thakis created this revision.
thakis added a reviewer: lld-macho.
Herald added a subscriber: dang.
Herald added a reviewer: int3.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
thakis requested review of this revision.

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.


https://reviews.llvm.org/D103985

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103985.350970.patch
Type: text/x-patch
Size: 7268 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210609/6df4f80b/attachment.bin>


More information about the llvm-commits mailing list