[all-commits] [llvm/llvm-project] ed2f0a: [lld/mac] Search .tbd before binary for framework ...

Nico Weber via All-commits all-commits at lists.llvm.org
Tue Sep 14 12:27:07 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ed2f0ad307193165a64c9847c24d8c9f4219f42b
      https://github.com/llvm/llvm-project/commit/ed2f0ad307193165a64c9847c24d8c9f4219f42b
  Author: Nico Weber <thakis at chromium.org>
  Date:   2021-09-14 (Tue, 14 Sep 2021)

  Changed paths:
    M lld/MachO/DriverUtils.cpp
    M lld/test/MachO/link-search-order.s

  Log Message:
  -----------
  [lld/mac] Search .tbd before binary for framework files too

This matters for example for the iPhoneSimulator14.0.sdk, which has
a System/Library/Frameworks/UIKit.framework/UIKit that has
LC_BUILD_VERSION with minos of 14.0, so linking against that file
will produce warnings like:

   .../iPhoneSimulator14.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit
   has version 14.0.0, which is newer than target minimum of 12.0.0

when targeting x86_64-apple-ios12.0-simulator. That doens't happen when
linking against UIKit.tbd instead, obviously.

Linking with RC_TRACE_DYLIB_SEARCHING=1 shows that ld64 also searches
the tbd file first, and we already get that right for non-framework
dylibs.

Fixes crbug.com/1249456.

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




More information about the All-commits mailing list