llvm-project/lld/test/MachO/tapi-link-by-arch.s
Nico Weber 889847922d [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
2022-04-21 12:05:56 -04:00

20 lines
874 B
ArmAsm

# REQUIRES: x86, aarch64
# RUN: mkdir -p %t
# RUN: llvm-mc -filetype obj -triple arm64-apple-ios14.4 %s -o %t/arm64-ios.o
# RUN: not %no-arg-lld -dylib -arch arm64 -platform_version ios 14.4 15.0 -o /dev/null \
# RUN: -lSystem %S/Inputs/libStubLink.tbd %t/arm64-ios.o 2>&1 | FileCheck %s
# RUN: llvm-mc -filetype obj -triple x86_64-apple-iossimulator14.4 %s -o %t/x86_64-sim.o
# RUN: not %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 14.4 15.0 -o /dev/null \
# RUN: -lSystem %S/Inputs/libStubLink.tbd %t/x86_64-sim.o 2>&1 | FileCheck %s
# RUN: llvm-mc -filetype obj -triple arm64-apple-iossimulator14.4 %s -o %t/arm64-sim.o
# RUN: %no-arg-lld -dylib -arch arm64 -platform_version ios-simulator 14.4 15.0 -o \
# RUN: /dev/null %S/Inputs/libStubLink.tbd %t/arm64-sim.o
# CHECK: error: undefined symbol: _arm64_sim_only
.data
.quad _arm64_sim_only