[all-commits] [llvm/llvm-project] a114ec: [lldb] Change the way we pick a platform for fat b...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Wed Mar 30 15:30:26 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a114ec0c6dc052832ec3dc1f65c9e221e3272925
      https://github.com/llvm/llvm-project/commit/a114ec0c6dc052832ec3dc1f65c9e221e3272925
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-03-30 (Wed, 30 Mar 2022)

  Changed paths:
    M lldb/include/lldb/Target/Platform.h
    M lldb/source/Target/Platform.cpp
    M lldb/source/Target/TargetList.cpp
    M lldb/unittests/Platform/CMakeLists.txt
    A lldb/unittests/Platform/PlatformTest.cpp

  Log Message:
  -----------
  [lldb] Change the way we pick a platform for fat binaries

Currently, when creating a target for a fat binary, we error out if more
than one platforms can support the different architectures in the
binary. There are situations where it makes sense for multiple platforms
to support the same architectures: for example the host and
remote-macosx platform on Darwin.

The only way to currently disambiguate between them is to specify the
architecture. This patch changes that to take into account the selected
and host platform. The new algorithm works a follows:

1. Pick the selected platform if it matches any of the architectures.
2. Pick the host platform if it matches any of the architectures.
3. If there's one platform that works for all architectures, pick that.

If none of the above apply then we either have no platform supporting
the architectures in the fat binary or multiple platforms with no good
way to disambiguate between them.

I've added a bunch of unit tests to codify this new behavior.

rdar://90360204

Differential revision: https://reviews.llvm.org/D122684




More information about the All-commits mailing list