[PATCH] D85334: [llvm-libtool-darwin] Support universal outputs

Sameer Arora via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 09:59:11 PDT 2020


sameerarora101 added inline comments.


================
Comment at: llvm/test/tools/llvm-libtool-darwin/universal-output.test:54-66
+## Check that the subtypes of cputype CPU_TYPE_ARM64 are stored in a fat file:
+# RUN: yaml2obj %s -o %t.arm64 -DTYPE=0x0100000C -DSUBTYPE=0x0 -DSTRING=_arm64all
+# RUN: yaml2obj %s -o %t.arm64e -DTYPE=0x0100000C -DSUBTYPE=0x2 -DSTRING=_arm64e
+# RUN: llvm-libtool-darwin -static -o %t.lib %t.arm64 %t.arm64e
+# RUN: llvm-objdump --all-headers %t.lib | \
+# RUN:   FileCheck %s --check-prefix=UNIVERSAL-MEMBERS-ARM64 -DFILE=%t.lib -DPREFIX=%basename_t.tmp --implicit-check-not=Archive
+
----------------
for `CPU_TYPE_ARM64`, I cannot test whether the architecture is present with `llvm-lipo` as it says "unknown(...)" for `arm64e`.  So I did this check using `llvm-objdump`  (whether the constituent members are present inside the fat file or not). Is this ok? To allow lipo to recognize `arm64e` I would have to make a modification under `llvm/lib/Object/MachOObjectFile.cpp` :
```
  case MachO::CPU_TYPE_ARM64:
    switch (CPUSubType & ~MachO::CPU_SUBTYPE_MASK) {
    case MachO::CPU_SUBTYPE_ARM64_ALL:
      if (McpuDefault)
        *McpuDefault = "cyclone";
      if (ArchFlag)
        *ArchFlag = "arm64";
      return Triple("arm64-apple-darwin");
    default:
      return Triple();
    }
```
 Not sure what would go under `*McpuDefault = ...`  and `return Triple("...");` for the case of `arm64e`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85334/new/

https://reviews.llvm.org/D85334



More information about the llvm-commits mailing list