[PATCH] D127060: [ORC] Add initial support for aarch64 in ELFNixPlatform

Sunho Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 4 17:46:36 PDT 2022


sunho created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
sunho requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch adds the aarch64 support in ELFNixPlatform. These are few simple changes, but it allows us to use the orc runtime  in ELF/AARCH64 backend. I observed that it succesfully run the static initializers of libc++ iostream implementation so that "cout << Hello world" testcase starts to work.


https://reviews.llvm.org/D127060

Files:
  llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp


Index: llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
===================================================================
--- llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
+++ llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
@@ -10,6 +10,7 @@
 
 #include "llvm/BinaryFormat/ELF.h"
 #include "llvm/ExecutionEngine/JITLink/ELF_x86_64.h"
+#include "llvm/ExecutionEngine/JITLink/aarch64.h"
 #include "llvm/ExecutionEngine/JITLink/x86_64.h"
 #include "llvm/ExecutionEngine/Orc/DebugUtils.h"
 #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
@@ -47,6 +48,11 @@
       Endianness = support::endianness::little;
       EdgeKind = jitlink::x86_64::Pointer64;
       break;
+    case Triple::aarch64:
+      PointerSize = 8;
+      Endianness = support::endianness::little;
+      EdgeKind = jitlink::aarch64::Pointer64;
+      break;
     default:
       llvm_unreachable("Unrecognized architecture");
     }
@@ -274,6 +280,7 @@
 bool ELFNixPlatform::supportedTarget(const Triple &TT) {
   switch (TT.getArch()) {
   case Triple::x86_64:
+  case Triple::aarch64:
     return true;
   default:
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127060.434299.patch
Type: text/x-patch
Size: 1109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220605/49246853/attachment.bin>


More information about the llvm-commits mailing list