[all-commits] [llvm/llvm-project] f03013: [lld-macho] Allow linking with ABI compatible arch...

Vincent Lee via All-commits all-commits at lists.llvm.org
Thu Jul 28 17:16:53 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f030132c72d9bbf2aa99191fff11b7e9e3e4de54
  Author: Vincent Lee <leevince at fb.com>
  Date:   2022-07-28 (Thu, 28 Jul 2022)

  Changed paths:
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/InputFiles.cpp
    M lld/test/MachO/tapi-link.s

  Log Message:
  [lld-macho] Allow linking with ABI compatible architectures

Linking fails when targeting `x86_64-apple-darwin` for runtimes. The issue
is that LLD strictly assumes the target architecture be present in the tbd
files (which isn't always true). For example, when targeting `x86_64h`, it should
work with `x86_64` because they are ABI compatible. This is also inline with what
ld64 does.

An environment variable (which ld64 also supports) is also added to preserve the
existing behavior of strict architecture matching.

Reviewed By: #lld-macho, int3

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

More information about the All-commits mailing list