[all-commits] [llvm/llvm-project] 889847: [lld/mac] Warn that writing zippered outputs isn't...

Nico Weber via All-commits all-commits at lists.llvm.org
Thu Apr 21 09:06:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 889847922dc6b9247f7f9189cf06e46fa5591049
      https://github.com/llvm/llvm-project/commit/889847922dc6b9247f7f9189cf06e46fa5591049
  Author: Nico Weber <thakis at chromium.org>
  Date:   2022-04-21 (Thu, 21 Apr 2022)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/MachO/InputFiles.cpp
    M lld/test/MachO/invalid/incompatible-arch.s
    M lld/test/MachO/invalid/incompatible-target-tapi.test
    M lld/test/MachO/lc-build-version.s
    M lld/test/MachO/objc-uses-custom-personality.s
    M lld/test/MachO/platform-version.s
    M lld/test/MachO/tapi-link-by-arch.s
    M lld/test/MachO/zippered.yaml

  Log Message:
  -----------
  [lld/mac] Warn that writing zippered outputs isn't implemented

A "zippered" dylib contains several LC_BUILD_VERSION load commands, usually
one each for "normal" macOS and one for macCatalyst.

These are usually created by passing something like

   -shared -target arm64-apple-macos -darwin-target-variant arm64-apple-ios13.1-macabi

to clang, which turns it into

    -platform_version macos 12.0.0 12.3 -platform_version "mac catalyst" 14.0.0 15.4

for the linker.

ld64.lld can read these files fine, but it can't write them.  Before this
change, it would just silently use the last -platform_version flag and ignore
the rest.

This change adds a warning that writing zippered dylibs isn't implemented yet
instead.

Sadly, parts of ld64.lld's test suite relied on the previous
"silently use last flag" semantics for its test suite: `%lld` always expanded
to `ld64.lld -platform_version macos 10.15 11.0` and tests that wanted a
different value passed a 2nd `-platform_version` flag later on. But this now
produces a warning if the platform passed to `-platform_version` is not `macos`.

There weren't very many cases of this, so move these to use `%no-arg-lld` and
manually pass `-arch`.

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




More information about the All-commits mailing list