Skip to content

Commit

Permalink
[Orc][LLJIT] Use JITLink on RISC-V
Browse files Browse the repository at this point in the history
RuntimeDyld does not support RISC-V, so it makes sense to enable
JITLink by default. This also makes relocations work without support
for a large code model.

Differential Revision: https://reviews.llvm.org/D129092
  • Loading branch information
hahnjo committed Jul 4, 2022
1 parent 623250b commit a4e2c1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
Expand Up @@ -666,8 +666,9 @@ Error LLJITBuilderState::prepareForConstruction() {
// JIT linker.
if (!CreateObjectLinkingLayer) {
auto &TT = JTMB->getTargetTriple();
if (TT.isOSBinFormatMachO() &&
(TT.getArch() == Triple::aarch64 || TT.getArch() == Triple::x86_64)) {
if (TT.getArch() == Triple::riscv64 ||
(TT.isOSBinFormatMachO() &&
(TT.getArch() == Triple::aarch64 || TT.getArch() == Triple::x86_64))) {

JTMB->setRelocationModel(Reloc::PIC_);
JTMB->setCodeModel(CodeModel::Small);
Expand Down

0 comments on commit a4e2c1f

Please sign in to comment.