How to enable AArch64 V8.3A support in clang?

Hey:
Apple’s version of Clang has support for -arch arm64ewhich enables ARM PAC support. IIRC a few years ago someone from Apple/ARM says they are planning to merge the support back to upstream and judging by my very limited experience with backend it seems to be the case. However I just couldn’t get that part to work. Directly using -arch arm64e doesn’t seem to work and results in a invalid arch name '-arch arm64e'.

I then tried multiple combinations like -target arm64-apple-ios5.0.0 -march=armv8.3-a but has no effect. The binary still doesn’t have any V8.3A instructions. Am I missing something here?

Thanks

Zhang

Hi Zhang,

Hey:
Apple's version of Clang has support for ``-arch arm64e``which enables ARM PAC support. IIRC a few years ago someone from Apple/ARM says they are planning to merge the support back to upstream and judging by my very limited experience with backend it seems to be the case. However I just couldn't get that part to work. Directly using ``-arch arm64e`` doesn't seem to work and results in a ``invalid arch name '-arch arm64e'``.

I then tried multiple combinations like ``-target arm64-apple-ios5.0.0 -march=armv8.3-a`` but has no effect. The binary still doesn't have any V8.3A instructions. Am I missing something here?

arm64e is only supported by Apple Clang at this time.
Upstream LLVM/Clang has various bits and pieces, including: full
assembler/disassembler for v8.3a, some basic codegen (for return
address signing and v8.5a BTI), and minimal MachO object reading.

Let me know if you have any questions,
-Ahmed

We will push back the full implementation. Stay tuned.

-Gerolf

Thanks for the reply, great to hear!
Is such support available in Swift-LLVM or is it only available in binary format? Outside of personal interest of messing around we do have internal tools based on top of LLVM and adding the same CodeGeneration ability to it without hooking pieces in Apple binary would be beneficial.

Thanks again,
Zhang