[all-commits] [llvm/llvm-project] 64be5b: [lld/mac] Implement -arch_multiple

Nico Weber via All-commits all-commits at lists.llvm.org
Mon Jul 5 21:27:53 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64be5b7d87139c5fa9cfbe9ee413dc15d04cedb7
      https://github.com/llvm/llvm-project/commit/64be5b7d87139c5fa9cfbe9ee413dc15d04cedb7
  Author: Nico Weber <thakis at chromium.org>
  Date:   2021-07-06 (Tue, 06 Jul 2021)

  Changed paths:
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/Options.td
    M lld/MachO/SymbolTable.cpp
    A lld/test/MachO/arch-multiple.s

  Log Message:
  -----------
  [lld/mac] Implement -arch_multiple

This is the other flag clang passes when calling clang with two -arch
flags (which means with this, `clang -arch x86_64 -arch arm64 -fuse-ld=lld ...`
now no longer prints any warnings \o/). Since clang calls the linker several
times in that setup, it's not clear to the user from which invocation the
errors are. The flag's help text is

    Specifies that the linker should augment error and warning messages
    with the architecture name.

In ld64, the only effect of the flag is that undefined symbols are prefaced
with

    Undefined symbols for architecture x86_64:

instead of the usual "Undefined symbols:". So for now, let's add this
only to undefined symbol errors too. That's probably the most common
linker diagnostic.

Another idea would be to prefix errors and warnings with "ld64.lld(x86_64):"
instead of the usual "ld64.lld:", but I'm not sure if people would
misunderstand that as a comment about the arch of ld itself.
But open to suggestions on what effect this flag should have :) And we
don't have to get it perfect now, we can iterate on it.

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




More information about the All-commits mailing list