Use JITLink on RISC-V

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.

See the equivalent change upstream in https://reviews.llvm.org/D129092,
committed for LLVM 15 in a4e2c1f762
This commit is contained in:
Jonas Hahnfeld 2023-02-01 19:06:44 +01:00 committed by jenkins
parent e65614cb92
commit eb82dc505a

View File

@ -405,10 +405,11 @@ Error RTDynamicLibrarySearchGenerator::tryToGenerate(
static bool UseJITLink(const Triple& TT) {
bool jitLink = false;
// Default to JITLink on macOS, as done in LLVM by
// Default to JITLink on macOS and RISC-V, as done in (recent) LLVM by
// LLJITBuilderState::prepareForConstruction.
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))) {
jitLink = true;
}
// Finally, honor the user's choice by setting an environment variable.