[all-commits] [llvm/llvm-project] fcdf75: lld: improve the `-arch` handling for MachO

Saleem Abdulrasool via All-commits all-commits at lists.llvm.org
Mon Jun 8 11:04:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fcdf7578aa697526e5eee05fb0e5390c4ef02eb9
      https://github.com/llvm/llvm-project/commit/fcdf7578aa697526e5eee05fb0e5390c4ef02eb9
  Author: Saleem Abdulrasool <compnerd at compnerd.org>
  Date:   2020-06-08 (Mon, 08 Jun 2020)

  Changed paths:
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/test/MachO/archive.s
    M lld/test/MachO/dylib.s
    M lld/test/MachO/dylink-lazy.s
    M lld/test/MachO/dylink.s
    M lld/test/MachO/entry-symbol.s
    M lld/test/MachO/export-trie.s
    M lld/test/MachO/invalid/alignment-too-large.yaml
    M lld/test/MachO/invalid/archive-no-index.s
    M lld/test/MachO/invalid/bad-archive.s
    M lld/test/MachO/invalid/duplicate-symbol.s
    M lld/test/MachO/invalid/invalid-executable.s
    M lld/test/MachO/invalid/invalid-relocation.yaml
    M lld/test/MachO/invalid/missing-dylib.s
    M lld/test/MachO/invalid/no-id-dylink.yaml
    M lld/test/MachO/invalid/no-such-file.s
    M lld/test/MachO/invalid/order-file-bad-arch.test
    M lld/test/MachO/invalid/order-file-bad-objfile.test
    M lld/test/MachO/invalid/undefined-symbol.s
    M lld/test/MachO/link-search-order.s
    M lld/test/MachO/load-commands.s
    M lld/test/MachO/no-exports-dylib.s
    M lld/test/MachO/order-file.s
    M lld/test/MachO/platform-version.test
    M lld/test/MachO/relocations.s
    M lld/test/MachO/resolution.s
    M lld/test/MachO/search-paths.test
    M lld/test/MachO/section-headers.s
    M lld/test/MachO/section-merge.s
    M lld/test/MachO/segments.s
    M lld/test/MachO/silent-ignore.test
    M lld/test/MachO/static-link.s
    M lld/test/MachO/sub-library.s
    M lld/test/MachO/subsections-section-relocs.s
    M lld/test/MachO/subsections-symbol-relocs.s
    M lld/test/MachO/symbol-order.s
    M lld/test/MachO/symtab.s
    M lld/test/MachO/x86-64-reloc-signed.s
    M lld/test/MachO/x86-64-reloc-unsigned.s

  Log Message:
  -----------
  lld: improve the `-arch` handling for MachO

Use the default target triple configured by the user to determine the
default architecture for `ld64.lld`.  Stash the architecture in the
configuration as when linking against TBDs, we will need to filter out
the symbols based upon the architecture.  Treat the Haswell slice as it
is equivalent to `x86_64` but with the extra Haswell extensions (e.g.
AVX2, FMA3, BMI1, etc).  This will make it easier to add new
architectures in the future.

This change also changes the failure mode where an invalid `-arch`
parameter will result in the linker exiting without further processing.




More information about the All-commits mailing list