From e093e421070d737395fbedf2bce10fe311213f49 Mon Sep 17 00:00:00 2001 From: Sunho Kim Date: Fri, 10 Jun 2022 13:34:24 +0900 Subject: [PATCH] [ORC][AArch64] Add initial support for aarch64 in ELFNixPlatform. Adds the aarch64 support in ELFNixPlatform. These are few simple changes, but it allows us to use the orc runtime in ELF/AARCH64 backend. It succesfully run the static initializers of stdlibc++ iostream so that "cout << Hello world" testcase starts to work. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D127060 --- llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp index c2577a9..0185a9d 100644 --- a/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp +++ b/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 @@ public: 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::isInitializerSection(StringRef SecName) { bool ELFNixPlatform::supportedTarget(const Triple &TT) { switch (TT.getArch()) { case Triple::x86_64: + case Triple::aarch64: return true; default: return false; -- 2.7.4