[PATCH] D87095: [Triple][MachO] Define "arm64e", an AArch64 subarch for Pointer Auth.

Ahmed Bougacha via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 3 09:33:48 PDT 2020


ab created this revision.
Herald added subscribers: cfe-commits, danielkiss, cmtice, rupprecht, dexonsmith, steven_wu, hiraditya, kristof.beyls, arichardson.
Herald added a reviewer: jhenderson.
Herald added a reviewer: MaskRay.
Herald added projects: clang, LLVM.
ab requested review of this revision.
Herald added a subscriber: ormris.

This is the first of many Pointer Authentication-related patches we're happy to finally upstream =]
For a high-level overview, see our llvm-dev RFC: http://lists.llvm.org/pipermail/llvm-dev/2019-October/136091.html, as well as the devmtg talk we did at the same time last year.
For concrete code that builds on this, see the staging PR in apple/llvm-project: https://github.com/apple/llvm-project/pull/14.  Though we've made changes downstream since then, the general concepts and added constructs are mostly identical.

Per commit message:

  This also teaches MachO writers/readers about the MachO cpu subtype,
  beyond the minimal subtype reader support present at the moment.
  
  This also defines a preprocessor macro to allow users to distinguish
  __arm64__ from __arm64e__.
  
  arm64e defaults to an "apple-a12" CPU, which supports v8.3a, allowing
  pointer-authentication codegen.
  It also currently defaults to ios14+ and macos11+.

If it helps, we can obviously split this patch further, but I feel like this all belongs together, as the core boilerplate needed for new (darwin) targets.

Note that this adds a `Triple::isArm64e()`, which is a bit of a departure from prior subarches, in part because we check it more often.  The obvious alternative would be to compare `Triple::getArchName()` with "arm64e";  I'm fine with either.   However, I would like to preserve the "arm64e" naming, as we refer to that extensively in Darwin-land.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87095

Files:
  clang/lib/Basic/Targets/AArch64.cpp
  clang/lib/Driver/ToolChain.cpp
  clang/lib/Driver/ToolChains/Arch/AArch64.cpp
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/test/Driver/aarch64-cpus.c
  clang/test/Driver/arclite-link.c
  clang/test/Driver/target-triple-deployment.c
  clang/test/Preprocessor/arm64e.c
  llvm/include/llvm/ADT/Triple.h
  llvm/lib/BinaryFormat/MachO.cpp
  llvm/lib/LTO/LTOCodeGenerator.cpp
  llvm/lib/LTO/LTOModule.cpp
  llvm/lib/Object/MachOObjectFile.cpp
  llvm/lib/Support/ARMTargetParser.cpp
  llvm/lib/Support/Triple.cpp
  llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
  llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
  llvm/test/MC/AArch64/arm64e-subtype.s
  llvm/test/MC/AArch64/arm64e.s
  llvm/test/MC/MachO/AArch64/arm-darwin-version-min-load-command.s
  llvm/test/tools/llvm-dwarfdump/AArch64/arm64e.ll
  llvm/test/tools/llvm-objdump/MachO/universal-arm64.test
  llvm/test/tools/llvm-readobj/macho-arm64e.test
  llvm/unittests/ADT/TripleTest.cpp
  llvm/utils/UpdateTestChecks/asm.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87095.289742.patch
Type: text/x-patch
Size: 21935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200903/6262ccc1/attachment-0001.bin>


More information about the cfe-commits mailing list