[PATCH] D124106: [lld/mac] Warn that writing zippered outputs isn't implemented

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 09:56:22 PDT 2022


thakis created this revision.
thakis added a reviewer: lld-macho.
Herald added subscribers: ormris, arphaman, steven_wu, hiraditya, kristof.beyls.
Herald added a reviewer: JDevlieghere.
Herald added projects: lld-macho, All.
thakis requested review of this revision.

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, 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.

So this now makes `%lld` expand to lld without that implicit -platform_version
flag, and addsd a new `%lld_mac` that still has the implicit flag. It then
updates almost all tests to use `%lld_mac`. The tests that pass an explicit
`-platform_version` flag keep using `%lld`.

(I did this by running:

  rg -l '%lld\b' lld/test/MachO | xargs sed -i '' -e 's/%lld /%lld-mac /g'

and then undoing that change for tests that pass -platform_version. For
%no-fatal-warnings-lld, I manually converted things as needed.)


https://reviews.llvm.org/D124106

Files:
  lld/MachO/Driver.cpp
  lld/MachO/InputFiles.cpp
  lld/test/MachO/U-dynamic-lookup.s
  lld/test/MachO/abs-symbols.s
  lld/test/MachO/add-ast-path.s
  lld/test/MachO/adhoc-codesign-hash.s
  lld/test/MachO/adhoc-codesign.s
  lld/test/MachO/application-extension.s
  lld/test/MachO/arch-multiple.s
  lld/test/MachO/arch.s
  lld/test/MachO/archive-symbol-resolution.s
  lld/test/MachO/archive.s
  lld/test/MachO/arm64-reloc-got-load.s
  lld/test/MachO/arm64-reloc-pointer-to-got.s
  lld/test/MachO/arm64-reloc-tlv-load.s
  lld/test/MachO/arm64-relocs.s
  lld/test/MachO/arm64-stubs.s
  lld/test/MachO/arm64-thunk-starvation.s
  lld/test/MachO/arm64-thunk-visibility.s
  lld/test/MachO/arm64-thunks.s
  lld/test/MachO/bind-opcodes.s
  lld/test/MachO/bitcode-bundle.ll
  lld/test/MachO/bss.s
  lld/test/MachO/builtin-rename.s
  lld/test/MachO/bundle-loader.s
  lld/test/MachO/cfstring-dedup.s
  lld/test/MachO/cgprofile-icf.s
  lld/test/MachO/cgprofile-obj.s
  lld/test/MachO/cgprofile-orderfile.s
  lld/test/MachO/cgprofile-print.s
  lld/test/MachO/color-diagnostics.test
  lld/test/MachO/common-symbol-coalescing.s
  lld/test/MachO/common-symbol-resolution.s
  lld/test/MachO/compact-unwind-both-local-and-dylib-personality.s
  lld/test/MachO/compact-unwind-generated.test
  lld/test/MachO/compact-unwind-stack-ind.s
  lld/test/MachO/compact-unwind-sym-relocs.s
  lld/test/MachO/compact-unwind.s
  lld/test/MachO/cstring-align.s
  lld/test/MachO/cstring-dedup.s
  lld/test/MachO/data-in-code.s
  lld/test/MachO/dead-strip-align.s
  lld/test/MachO/dead-strip-dylibs.s
  lld/test/MachO/dead-strip.s
  lld/test/MachO/demangle.s
  lld/test/MachO/dependency-info.s
  lld/test/MachO/discard-llvm-sections.s
  lld/test/MachO/driver.test
  lld/test/MachO/dso-handle.s
  lld/test/MachO/dyld-stub-binder.s
  lld/test/MachO/dylib-stub.yaml
  lld/test/MachO/dylib-version.s
  lld/test/MachO/dylib.s
  lld/test/MachO/dylink-ordinal.s
  lld/test/MachO/dylink.s
  lld/test/MachO/encryption-info.s
  lld/test/MachO/entry-symbol.s
  lld/test/MachO/error-limit.test
  lld/test/MachO/export-options.s
  lld/test/MachO/export-trie.s
  lld/test/MachO/fat-arch.s
  lld/test/MachO/fatal-warnings.s
  lld/test/MachO/filelist.s
  lld/test/MachO/final-output.s
  lld/test/MachO/flat-namespace-dysyms.s
  lld/test/MachO/flat-namespace-interposable.s
  lld/test/MachO/force-load-swift-libs.ll
  lld/test/MachO/force-load.s
  lld/test/MachO/framework.s
  lld/test/MachO/function-starts.s
  lld/test/MachO/header.s
  lld/test/MachO/headerpad.s
  lld/test/MachO/icf-arm64.s
  lld/test/MachO/icf-literals.s
  lld/test/MachO/icf-options.s
  lld/test/MachO/icf-scale.s
  lld/test/MachO/icf-undef.s
  lld/test/MachO/icf.s
  lld/test/MachO/implicit-dylibs.s
  lld/test/MachO/indirect-symtab.s
  lld/test/MachO/install-name.s
  lld/test/MachO/invalid/abs-duplicate.s
  lld/test/MachO/invalid/alignment-too-large.yaml
  lld/test/MachO/invalid/archive-no-index.s
  lld/test/MachO/invalid/arm64-thunk-undefined.s
  lld/test/MachO/invalid/bad-archive-member.s
  lld/test/MachO/invalid/bad-archive.s
  lld/test/MachO/invalid/bad-got-to-dylib-tlv-reference.s
  lld/test/MachO/invalid/bad-got-to-tlv-reference.s
  lld/test/MachO/invalid/bad-tlv-def.s
  lld/test/MachO/invalid/bad-tlv-opcode.s
  lld/test/MachO/invalid/bad-tlv-relocation.s
  lld/test/MachO/invalid/cfstring.s
  lld/test/MachO/invalid/compact-unwind-bad-reloc.s
  lld/test/MachO/invalid/compact-unwind-personalities.s
  lld/test/MachO/invalid/cstring-dedup.s
  lld/test/MachO/invalid/dso-handle-duplicate.s
  lld/test/MachO/invalid/duplicate-symbol.ll
  lld/test/MachO/invalid/duplicate-symbol.s
  lld/test/MachO/invalid/incompatible-arch.s
  lld/test/MachO/invalid/incompatible-target-tapi.test
  lld/test/MachO/invalid/invalid-executable.s
  lld/test/MachO/invalid/invalid-fat-narch.s
  lld/test/MachO/invalid/invalid-fat-offset.s
  lld/test/MachO/invalid/invalid-relocation-length.yaml
  lld/test/MachO/invalid/invalid-relocation-pcrel.yaml
  lld/test/MachO/invalid/invalid-stub.s
  lld/test/MachO/invalid/lto-bitcode-nodatalayout.ll
  lld/test/MachO/invalid/missing-dylib.s
  lld/test/MachO/invalid/no-filelist.s
  lld/test/MachO/invalid/no-id-dylink.yaml
  lld/test/MachO/invalid/no-libxar.ll
  lld/test/MachO/invalid/no-such-file.s
  lld/test/MachO/invalid/protected.ll
  lld/test/MachO/invalid/range-check.s
  lld/test/MachO/invalid/reserved-section-name.s
  lld/test/MachO/invalid/undefined-symbol.s
  lld/test/MachO/lc-linker-option.ll
  lld/test/MachO/link-search-at-executable-path.s
  lld/test/MachO/link-search-at-loader-path-symlink.s
  lld/test/MachO/link-search-at-loader-path.s
  lld/test/MachO/link-search-at-rpath.s
  lld/test/MachO/link-search-order.s
  lld/test/MachO/linkedit-contiguity.s
  lld/test/MachO/lit.local.cfg
  lld/test/MachO/literal-dedup.s
  lld/test/MachO/load-command-sequence.s
  lld/test/MachO/load-commands.s
  lld/test/MachO/local-got.s
  lld/test/MachO/local-private-extern.yaml
  lld/test/MachO/lto-archive.ll
  lld/test/MachO/lto-archivecollision.ll
  lld/test/MachO/lto-cache-dsymutil.ll
  lld/test/MachO/lto-cache.ll
  lld/test/MachO/lto-codemodel.ll
  lld/test/MachO/lto-common-symbol-coalescing.ll
  lld/test/MachO/lto-common-symbol-resolution.ll
  lld/test/MachO/lto-cpu-string.ll
  lld/test/MachO/lto-final-definition.ll
  lld/test/MachO/lto-internalize-unnamed-addr.ll
  lld/test/MachO/lto-internalize.ll
  lld/test/MachO/lto-irmover-warning.ll
  lld/test/MachO/lto-linkonce.ll
  lld/test/MachO/lto-mattrs.ll
  lld/test/MachO/lto-module-asm-err.ll
  lld/test/MachO/lto-module-asm.ll
  lld/test/MachO/lto-objc-arc-contract.ll
  lld/test/MachO/lto-object-path.ll
  lld/test/MachO/lto-opt-level.ll
  lld/test/MachO/lto-save-temps.ll
  lld/test/MachO/lto-symbol-resolution.ll
  lld/test/MachO/lto-weak-ref.ll
  lld/test/MachO/map-file.s
  lld/test/MachO/mark-dead-strippable-dylib.s
  lld/test/MachO/mh-execute-header.s
  lld/test/MachO/mh-header-link.s
  lld/test/MachO/no-exports-dylib.s
  lld/test/MachO/no-unneeded-dyld-info.s
  lld/test/MachO/nonweak-definition-override.s
  lld/test/MachO/objc-classrefs-dedup.s
  lld/test/MachO/objc.s
  lld/test/MachO/order-file.s
  lld/test/MachO/pagezero.s
  lld/test/MachO/private-extern.s
  lld/test/MachO/reexport-stub.s
  lld/test/MachO/referenced-dynamically.s
  lld/test/MachO/reloc-subtractor.s
  lld/test/MachO/rename.s
  lld/test/MachO/reproduce-thin-archives.s
  lld/test/MachO/reproduce.s
  lld/test/MachO/reroot-path.s
  lld/test/MachO/responsefile.test
  lld/test/MachO/rpath.s
  lld/test/MachO/search-paths.test
  lld/test/MachO/sectalign.s
  lld/test/MachO/sectcreate.s
  lld/test/MachO/section-headers.s
  lld/test/MachO/section-merge.s
  lld/test/MachO/section-order.s
  lld/test/MachO/segments.s
  lld/test/MachO/segprot.s
  lld/test/MachO/silent-ignore.s
  lld/test/MachO/special-symbol-ld-install-name.s
  lld/test/MachO/stabs-icf.s
  lld/test/MachO/stabs.s
  lld/test/MachO/start-end.s
  lld/test/MachO/start-lib.s
  lld/test/MachO/static-link.s
  lld/test/MachO/sub-library.s
  lld/test/MachO/subsections-symbol-relocs.s
  lld/test/MachO/symbol-resolution.s
  lld/test/MachO/symtab.s
  lld/test/MachO/syslibroot.test
  lld/test/MachO/t.s
  lld/test/MachO/tapi-framework.s
  lld/test/MachO/tapi-link.s
  lld/test/MachO/thin-archive.s
  lld/test/MachO/thinlto-jobs.ll
  lld/test/MachO/thinlto-time-trace.ll
  lld/test/MachO/threads.s
  lld/test/MachO/time-trace.s
  lld/test/MachO/tlv-dylib.s
  lld/test/MachO/tlv.s
  lld/test/MachO/treat-undef-sym.s
  lld/test/MachO/u.s
  lld/test/MachO/umbrella.s
  lld/test/MachO/unsorted-relocations.yaml
  lld/test/MachO/uuid.s
  lld/test/MachO/weak-binding.s
  lld/test/MachO/weak-def-can-be-hidden.s
  lld/test/MachO/weak-definition-direct-fetch.s
  lld/test/MachO/weak-definition-gc.s
  lld/test/MachO/weak-definition-in-main-file.s
  lld/test/MachO/weak-definition-indirect-fetch.s
  lld/test/MachO/weak-definition-order.s
  lld/test/MachO/weak-definition-over-dysym.s
  lld/test/MachO/weak-header-flags.s
  lld/test/MachO/weak-import.s
  lld/test/MachO/weak-private-extern.s
  lld/test/MachO/weak-reference.s
  lld/test/MachO/why-live.s
  lld/test/MachO/why-load.s
  lld/test/MachO/x86-64-reloc-got-load.s
  lld/test/MachO/x86-64-reloc-signed.s
  lld/test/MachO/x86-64-reloc-unsigned.s
  lld/test/MachO/x86-64-relocs.s
  lld/test/MachO/x86-64-stubs.s
  lld/test/MachO/zippered.yaml

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124106.423944.patch
Type: text/x-patch
Size: 347542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220420/284d46af/attachment-0001.bin>


More information about the llvm-commits mailing list