[llvm] e093e42 - [ORC][AArch64] Add initial support for aarch64 in ELFNixPlatform.
Sunho Kim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 9 21:38:16 PDT 2022
Author: Sunho Kim
Date: 2022-06-10T13:37:36+09:00
New Revision: e093e421070d737395fbedf2bce10fe311213f49
URL: https://github.com/llvm/llvm-project/commit/e093e421070d737395fbedf2bce10fe311213f49
DIFF: https://github.com/llvm/llvm-project/commit/e093e421070d737395fbedf2bce10fe311213f49.diff
LOG: [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
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
index c2577a9143087..0185a9d15de20 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 @@ class DSOHandleMaterializationUnit : public MaterializationUnit {
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;
More information about the llvm-commits
mailing list